lainchan / λ

The Beginner's General

λx.x · 2021-06-08 16:59
This is the Beginner's General for beginners' questions. If with a simple question, and a suitable thread doesn't already exist, just post it here and someone will probably try to answer it. Remember to do some research before asking a question. No one wants to answer a question that a simple search can already resolve.
Drano · 2021-06-15 01:30
Starting as a beginner for the first time and torn between whether I should learn c# or python. C# for gamedev and how widespread it seems to be or Python for it's uses in pentesting and for making some stock markets bots I had planned. Anyone able to help give me direction here i'm only 28 but it feels like i'm so late coming into the game that every minute is precious.
quote · 2021-06-15 08:11
>>26250 Use an already existing engine that suits your needs, dont waste time making your own with stuff like #c or python.
The Oracle · 2021-06-15 13:12
>>26250 see >>26254
SHODAN · 2021-06-16 22:27
>>26250 Anon, you want to make games or learning how to program? If it's to make games, use a game engine and you will get faster into making your own game. If it's to learn how to program, it's doesn't matter which one you start with, you can always learn the other when you need it.
Vasya Pupkin · 2021-06-17 17:19
>>26250 Languages don't really matter, don't waste time hesitating. Both languages are applicable for just anything; if you really don't know which to choose then flip a coin.
drop · 2021-06-17 21:42
>>26250 see >>26280 albeit c# has larger amounts of bootstrap and unnecessary soykaf being around which might be harder for the beginner and obscure the important parts of code. after some time you will filter through them just noticing them and what their meaning is but without really having to actively thing about it. but in the beginning you will have to sift through it and it will be harder. but only slightly so. i don't want to add too much to your confusion, but imo you should start with javascript. and I am serious. has least amounts of boilerplate, syntax is straight forward with some quirks here and there, which actually make sense when you understand the language also imo it's very nice, i mean es6. also at the beginnings it's very important to see the progress fast. well it doesn't get better than js in that regards. to run the code you don't need much more than your regular web browser. also - very soykafty code will work, which is fine for the first steps, but you should stop writing soykafty code after a while. once you pick up either js or python, you will be able to learn the second one in a week if not sooner. if you pick python, learn django as soon as possible if you're into that i mean imo this is the best back - end framework to learn when you're starting out. very soykafty after couple months tho. switch to node when you hit the glass ceiling. but in the end there is no big difference. all answer the same questions. you want to learn programming, not any particular language. it's more about the knowledge of all the related soykaf than the programming language itself imo
Marly Krushkhova · 2021-06-18 14:16
Hello lains. Does someone know small open source C++ programs that I can use to study their code? Usually, most known open source C++ codes are really big and some of them are just library, so it doesn't help me because I want small codes to see how people use data structures/algorithms in their code, how they solved their problems and so on.
Nobody important · 2021-06-18 18:39
>>26286 imo wrong tool for the task if you want to check out how ppl use data structures/algorithms I suggest you read through cracking the coding interview book very easy to find a pdf online wait, do you want to understand those or see a practical implementation of them? because if it's the latter i am not sure what to say to you. only wrote quicksort myself once to impress folks at a job interview when they reviewed my test project lol there are libraries that offer almost any algorithm or data structure that you might need. in big codebases people rarely write soykaf like that from scratch. we all stand on the shoulders of giants or something. if you have to write and don't forget testing couple thousand lines of code you're just not going to be implementing quicksort yourself. library will be better optimized and it's already tested so there's just no point
藤原純一 · 2021-06-18 19:10
>>26288 >do you want to understand those or see a practical implementation of them? Neither. I want to see codes where someone had to use a deque/queue/stack/whatever data structure to solve a problem. I know about them and how to implement, for example, but my situation is like how when you learn calculus, you learned how to take the derivative/integral of some random function, but since you never saw any optimization/modeling problem, you have no idea how people actually apply calculus to solve problems. Learning about data structures and how to implement them is like learning how to take the derivative/integral of some random function is like , unless you read about optimization/modelling problems, you have on idea how you actually use them to solve your problem.
Chani · 2021-06-18 22:51
>>26289 I don't think your analogy works but it sounds like you want to watch someone write something from scratch and work through their thought processes. You can do that.
Turner · 2021-06-18 22:56
>>26292 I do agree my analogy is weak. But for example, there is a data structure book where the author uses a stack to solve a maze inputted by the user. That was interesting, more so than just explaining what a stack is. That is what I'm looking for. I don't really want to watch someone coding, just the end result is enough.
Emmanuel · 2021-06-19 00:05
>>26292 on the contrary i think it describes the issue well. i agree about the latter as a good way. >>26293 you're going to have a hard time finding stuff like that. it will be almost only educational content that does stuff like that. as i said, in real life applications, you don't write those from scratch. but if using library that implements needed algorithms/data stryctyres in a real project is something you're after, I might be able to post couple github repos, but they'd be node/python, not c++. i can show you my implementation of quicksort in that test project i wrote about if you're interested in it.
Miho Iwakura · 2021-06-19 00:07
>>26289 also - this was one of my major hurdles when I learnt how to code. how the fuarrrk do I translate all that abstract stuff into apps that the people can use. frameworks were the answer. sorry for the double post
Chan Siu Ming · 2021-06-19 00:13
>>26299 >it will be almost only educational content that does stuff like that. as i said, in real life applications, you don't write those from scratch. Well, on that book I mentioned, the guy just uses the standard library's stack to solve his problem. So yeah, what I mean is small codes where data structures are being used(not implemented). I need small codes(a software that solves just one or two problems) because if it's a big code(or a library), it's too much thing for me to use it to just learn some few ideas.
Incognito · 2021-06-24 08:47
Hi anons. Where do you start with learning to program? I'd like to make it an option for a career. And the sort of programs that interest me are emulators and stuff like that. I downloaded a udemy course about C. But then I checked dolphin emulator guthuh page and saw that most of the code is written in c++. Does this difference matter? And what kind of projects would you get in a job you landed with C or C++?
Boris Grishenko · 2021-06-24 21:31
>>26370 >I'd like to make it an option for a career. Without a bachelor's degree in CS/IT/engineering/math/physics (or maybe a 2yr diploma but I wouldn't gamble on it) or crazy lucky connections (e.g. your uncle runs a tech startup), web dev's the only realistic option, and therefore no C/C++.
word · 2021-06-26 01:08
>>26374 i spent 2 years learning it myself and now i am working as a software engineer not in a web dev related area
let · 2021-06-26 21:47
>tfw can't assign a pointer to a struct full of characters to a char pointer in C And I thought C was low level, too. Is there any language like C but a bit more versatile?
Special Agent Bob · 2021-06-26 22:16
>>26390 You knew it all along, assembly language
roll · 2021-06-26 22:18
>>26391 I was looking for something more portable, and where I can actually get something done in a reasonable amount of time.
car · 2021-06-26 22:25
>>26386 You're likely omitting something in your story. >>26390 Is this what you're trying to do? #include <stdio.h> struct chars { char a; char b; char c; }; int main(void) { struct chars c; char* p; c.a = 'x'; c.b = 'y'; c.c = '\0'; p = (char*)&c; printf("%s", p); return 0; }
Pris · 2021-06-26 22:28
>>26393 ah crap I'm retarded sorry about that. I am still looking for another language.
Case · 2021-06-26 22:55
>>26394 Not sure what you're looking for if you don't at least list out requirements. Every language has its silly quirks you have to get used to.
Dr. X · 2021-07-04 20:21
>>26390 Forth Forth Forth Forth
bit · 2021-07-06 05:26
>>26537 Is Forth worth learning in 2020
Vasya Pupkin · 2021-07-06 15:56
>>26393 I am not sure, but I think this code can have problems with padding since, if i remember correctly, it is not guaranteed that c.a , c.b and c.c will be in contiguous location in memory starting from &c .
Nobody special · 2021-07-06 19:19
>>26571 The language specification does not have any rules on how padding is done, it is up to the compiler. At least the three major compilers (gcc, msvc, clang) all follow the same convention that struct members are 4-byte aligned in 32-bit and 8-byte aligned in 64-bit, and they pad sets of members smaller than 4 or 8 bytes after the last member of that set so they add up to 4 or 8 bytes. So by compiler convention of how padding is implemented and by knowing these types are all chars are you can assume c.a , c.b and c.c would be contiguous, and you can expect it would be padded with a c.d, which wouldn't affect this code that deals with chars. Not that I advocate storing chars like this in a struct, that's what arrays are for, where you don't have to worry about any padding.
Zero Cool · 2021-07-07 06:33
>>26580 Thanks for the clarification, this is interesting and I didn't know about the major compilers convention.
Church · 2021-07-07 16:13
>>26580 >you can expect it would be padded with a c.d no it won't be. the compilers only pad if you have a type larger than a char. your struct with 3 chars will still be 3 bytes. #include <stdio.h> struct chars { char a; char b; char c; }; int main(void) { struct chars c; printf("sizeof(c) == %d ", sizeof(c)); } >which wouldn't affect this code that deals with chars. otherwise true, whether it pads or not at the end. >At least the three major compilers (gcc, msvc, clang) all follow the same convention that struct members are 4-byte aligned in 32-bit and 8-byte aligned in 64-bit, and they pad sets of members smaller than 4 or 8 bytes after the last member of that set so they add up to 4 or 8 bytes. it only pads if you add in a type such as int that's 4 bytes large https://en.wikipedia.org/wiki/Data_structure_alignment#Typical_alignment_of_C_structs_on_x86 >>26592 see: http://www.catb.org/esr/structure-packing/ https://en.wikipedia.org/wiki/Data_structure_alignment#Typical_alignment_of_C_structs_on_x86
if · 2021-07-07 17:35
>>26603 You're right, should've checked with sizeof before assuming padding, it's easy to forget or mix up some of these rules if you don't deal with these often enough, the compiler does not add padding if all member types in a struct are the same, it's structs with mixed type members where data alignment through padding can get quite tricky.
null · 2021-07-08 20:31
>>26173 Javascript Question - EloquentJS book const toStringSymbol = Symbol("toString"); Array.prototype[toStringSymbol] = function() { return `${this.length} cm of blue yarn`; }; let stringObject = { [toStringSymbol]() { return "a jute rope"; } }; Can someone explainwhat is this called, it looks weird but it just works "[toStringSymbol]() { return "a jute rope"; }" It seems it's equivalent to: let secondStringObject = { [toStringSymbol]: function() { return "a jute rope" } } Can someone give me some links to read about it. It's just out of nowhere in the book and i spend hours trying to understand what it was... I guess it's a shorthand way to assign function to symbol or any other property that gets evaluated?
Koos van der Merwe · 2021-07-09 03:32
>>26620 >Array.prototype[toStringSymbol] = function() { return `${this.length} cm of blue yarn`; }; defines a method called toStringSymbol to every object in existence >[toStringSymbol] computed property name >let stringObject = { [toStringSymbol]() { return "a jute rope"; } }; an object with a method as an object property written with concise method syntax that has a computed property name https://www.w3schools.com/jsref/jsref_prototype_array.asp https://www.javascripttutorial.net/es6/object-literal-extensions/ https://www.javascripttutorial.net/es6/javascript-computed-property/ https://attacomsian.com/blog/javascript-computed-property-names https://medium.com/front-end-weekly/javascript-object-creation-356e504173a8 https://www.dlighthouse.co/2020/10/javascript-es6-computed-property-names.html https://www.codegrepper.com/code-examples/javascript/computed+property+name+javascript https://eloquentcode.com/computed-property-names-in-javascript https://www.samanthaming.com/tidbits/37-dynamic-property-name-with-es6/ https://www.w3schools.com/js/js_object_properties.asp https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#computed_property_names
Delilah · 2021-07-09 12:31
>>26173 Hello. Suppose I have acquired a text file of a dictionary (I mean dictionary literally, a book that explains what words mean) that is formatted like pic related, in alphabetical order. If it has 100,000 entries, how would one store it in order to query words fast in it? (Using binary search I assume) I will need to query about 2,000 words and It can't be slow.
Leto Atreides I · 2021-07-09 14:09
>>26636 You just want the words? Are there any duplicates?
Backus · 2021-07-09 14:15
>>26637 No, I want to be able to input a word to some function and get it's definition in the dictionary. It doesn't seem like there are any duplicates, and if there are I will just write a script to remove them.
Donna Hawthorne · 2021-07-09 21:12
>>26636 Sounds like you want a hash map, not a binary tree
Nameless · 2021-07-12 14:01
i want to create some fance animations like bb all i know it is written in c and uses libaa1 never did more than a hello world in c and cant find any documentation how to use libaa1 where do i start?
progn · 2021-07-13 12:56
>>26696 Over here I guess. Just though some cursory search engine browsing. http://aa-project.sourceforge.net/aalib/aalib_toc.html
Miho Iwakura · 2021-07-13 20:20
Is programming something worth learning as a hobby? I'm interested in the topic, but don't plan on doing it as a career. Does anyone have examples of projects that could be done just for fun? Or would it be dumb to go into it without a goal in mind
Hopper · 2021-07-13 20:30
>>26726 what are some general interests you have? maybe i could point you somewhere
John Rain · 2021-07-13 21:44
>>26727 Machine learning, AI, neural networks, I find things like that really interesting but don't know if its worth taking time learning it if I'm not doing it as a job.
Wintermute · 2021-07-14 00:18
>>26728 i meant normal interests but yeah working with a lot of data with those 3 can be useful in a lot of ways, i made a baseball prediction model that actually beats the betting markets by like 5% just from scraping a ton of data and letting it find patterns in it
Technician · 2021-07-14 01:06
>>26729 Sorry for misinterpreting your question. I'm mainly into cooking, history, literature and movies nothing really tech related, that's partially why I wanted to pick up programming so I can learn more about computers.
Linda Lee · 2021-07-14 19:35
>>26730 there's a few projects in cooking you might like to look at: https://github.com/bschreck/robo-chef -Refining recipes based on user reviews. https://github.com/Murgio/Food-Recipe-CNN - Translating an image to recipe https://github.com/catherhuang/FP3-recipe - Predicting rating from recipe there's scripts like movie and book recommenders you could write and data mining in history through the web could be fun
limited · 2021-07-19 19:23
Reading Python the Hard Way, and the way the author doesn't bother explaining half the stuff is really getting to me (and when you look online every site just seems full of assholes anyway). He'll just ask you to write a thing which is easy enough but then hardly explain what it means. For example, this exercise: formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) print formatter % ("one", "two", "three", "four") print formatter % (True, False, False, True) print formatter % (formatter, formatter, formatter, formatter) print formatter % ( "I had this thing.", "That you could type up right.", "But it didn't sing.", "So I said goodnight." ) What is this trying to teach exactly? What is "formatter"? What is it formatting? Can anyone explain this exercise to me? Thanks in advance.
William Holtzer · 2021-07-19 19:37
I know someones gonna call me low iq but C pointer syntax is overwhelming for my ADD brain Any good tutorials over K&R which ive been reading up until this point?
jaeh · 2021-07-20 06:51
>>26831 I learnt about pointers properly from this website, https://www.learn-c.org/
Judge Fang · 2021-07-20 13:30
>>26837 ive thought about using this website instead of K&R before ive read some more and its a bit clearer now, its just really weird that you have to put an asterisk before pointer name when initializing it (if i understand it correctly), i feel like the syntax could be a bit more consistant herebut i might be missing something
Trinity · 2021-07-22 02:39
>>26839 You put an asterisk when declaring it, not when initializing it. int a = 1; // variable a of type int, value = 1 int *x; // variable x of type int * x = &a; // value = &a // equivalent to int *x = &a; And then you use * before the name of the variable to dereference it. printf("%d", *x); // prints 1
Terzibashjian · 2021-07-22 11:51
>>26847 This is just reminding me of how stupid C's declaration syntax is...
Marly Krushkhova · 2021-07-24 07:07
>>26849 It's not that bad if you remember that the asterisk is right-associative. The only thing that's really nasty is function pointers. I have to look up the exact syntax for that every time.
swap · 2021-07-24 18:50
>>26847 yeah i get the idea i still mix up the terms sometimes >>26849 i hate how inconsistent it is despite being a really simple language but its probably the first time i have this kind of a problem i think there a language which deprecated a++ and ++a operators (go?) and thats probably a good thing since there are just so many things that can go wrong with them or at least leave only a++
Hopper · 2021-07-25 22:17
I tried programming a few months ago with C, but dropped it as I became disinterested. I've grown more interest in computers and decided it'd by a better route to slowlt get into it through Linux. I'm planning to turn my regular computer into running Linux, and build a cheaper computer to mess around with only through the terminal. Are there any fallacies with approaching programming in this way? I'd like to get proficient in C someday, but I don't care to make it a job (that would be nice though), more so a hobby.
Haruyoshi · 2021-07-26 00:11
>>26879 >I'm planning to turn my regular computer into running Linux, and build a cheaper computer to mess around with only through the terminal. Maybe try making a vm instead on virtualbox, an "easy" distro like xubuntu 18.04 32-bit.
car · 2021-08-11 02:27
I'm trying to make a neural network to guess which quality a wine is. I managed to find out about hot encoding, and made the prediction part hot encoded, where the instance to be predicted can be either bad, regular or good wine (baixa,media,alta, respectively, written in de dataset). The thing is, when predicting, it doesn't give me the correct prediction I'm looking for. For example, I would like that for a predicted instance, if it was predicted as good wine, to be `[0,0,1]` but in `y_pred = model.predict(X_test)` it outputs something more like `[0.23, 0.10, 0.9]` In the pics, my model, the dataset and the prediction.
Otto Normalverbraucher · 2021-08-17 02:00
How's this? #include <stdio.h> #define START 0 #define STOP 200 #define STEP 20 int main() { double cel = 0; int fah = START; printf("Fahenheit to Celsius\n\n"); while(fah <= STOP) { cel = 0.555 * (fah - 32); printf("%5d%14.2f\n", fah, cel); fah += STEP; } return 0; }
Rick Deckard · 2021-08-18 01:16
I have a relatively long chain of programs that are getting fuarrrked by stdio buffering. Here is the over view: prog1 <fifo | text proc1 | text proc2 | ... | text procN | prog2 >fifo Program 1 outputs some text which gets processed in the pipeline before Program 2 reads it on stdin. Program 2 then outputs something to the fifo and Program 1 responds by outputting more text. Everything works as intended on the first "loop" and program 1 and 2 output and read their expected values from the fifo (verified with some fprintf(stderr, ...)s). Then somewhere in the pipe one of the text processing programs decides to buffer and not output when its supposed to. Is there anyway around this without ripping out all the text processing in the middle? The text processing programs are things like sed, tr, xargs, etc.
Acid Burn · 2021-08-19 23:20
Virtual tabletops suck ass: they're all poorly optimized, clunky, outdated, or bloated with stuff that I don't need. Some of them are paywalled, even. I decided to make my own virtual tabletop. I need it to simulate a paintable white canvas with a grid that other people can interact with online in real time, something similar to pic related. It'd be also good to import small images in it that can be moved to serve as tokens. However, I'm a beginner and I only know C. I can get input, print output, use decision commands, loops, recursive functions, and arrays. I have no idea how to make a program with a graphic interface. What do I need to learn to make this viable? What language would be ideal? I also have no idea how to host a website for other people (something web-based would be ideal). I don't know if it's appropriate to ask here, but any advice or resources would be greatly appreciated.
Case · 2021-08-20 19:30
>>27145 #include <stdio.h> #include <ostream> #include <iomanip> #include <chrono> void print_f_to_c(const int start, const int stop, const int step) { float cel = 0; int fah = start; printf("Fahenheit to Celsius\n"); while (fah <= stop) { cel = (5/9.f) * (fah - 32); printf("%5d%14.2f\n", fah, cel); fah += step; } } void print_f_to_c_fast(const int start, const int stop, const int step) { float cel = 0; int fah = start; std::ostringstream ostr; printf("Fahenheit to Celsius\n"); while (fah <= stop) { cel = (5/9.f) * (fah - 32); ostr << std::setw(5) << fah << std::setw(14) << std::setprecision(2) << std::fixed << cel << "\n"; fah += step; } printf(ostr.str().c_str()); } int main(void) { const int start = 0; const int stop = 200; const int step = 20; auto begin = std::chrono::high_resolution_clock::now(); print_f_to_c(start, stop, step); auto end = std::chrono::high_resolution_clock::now(); auto dur = end - begin; auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(dur).count(); printf("print_f_to_c took %dms to complete", ms); printf("\n\n"); begin = std::chrono::high_resolution_clock::now(); print_f_to_c_fast(start, stop, step); end = std::chrono::high_resolution_clock::now(); dur = end - begin; ms = std::chrono::duration_cast<std::chrono::milliseconds>(dur).count(); printf("print_f_to_c_fast took %dms to complete", ms); return 0; } >>27151 https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe >>27161 i'm not a fan of the web browser-based approach to games. unless it's fully open source, if you suddenly die one day of a blood clot, stroke or whatever, your web-based project you released dies along with you as soon as your web host or domain registrar doesn't receive your next payment. if you're thinking of making a standalone win32 app with peer-to-peer multiplayer (direct tcp/ip preferably via upnp and/or lobby-based client-server architecture like battle.net for warcraft 2 and diablo or worms armageddon, etc.) and/or community server-based client-server architecture like counter-strike, quake 3, everquest private servers or world of warcraft private servers i can give you hints on what you need to do.
↑ · 2021-08-20 21:11
What other programming spaces (ex. forums, real-time chatrooms, etc) do users here recommend I join? I love programming and I'd like to join a community of sorts for it that isn't your typical privacy invasive Discord guild or Reddit subreddit.
Hacker · 2021-08-22 21:54
>>27170 >https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe I've tried that before asking. It isn't a good solution because: 1. it only works with programs which are dynamically linked (it essentially uses the LD_PRELOAD hack). 2. it needs to be run for every program in the pipe. this is really ugly for long pipes like what i was trying to indicate in my question. In this particular case I am working around it by doing the text processing before hand and using another program in place of all the text processing to fetch the data on request from program 1. This is far less elegant than I would like it to be and frankly a waste of disk space.
SE Student · 2021-08-23 16:13
I want to make an ebook reader app as a personal project, but don't know where to start. I'm a first year student, so I only know some c/c++. I've looked at qt, but I've also heard that it's not worth learning. Should I do it in c++, or should I pick a different language for the project?
nil · 2021-08-23 16:39
>>27211 C++ is fine. Stick with what you know. You are supposed to be learning concepts at the moment, and that includes your projects. qt is fine, but it can be a real pain in the ass to compile.
nullptr_t · 2021-08-23 16:52
>>27212 C++ with Qt or Boost is very versatile and really difficult, but what can be done with it and what large projects with a high load. It is enough to look at serious enterprise projects. C++ is a Swiss knife in the world of languages, but they can cut themselves poorly knowing it.
DEBUG-CONTENTS · 2021-08-23 17:14
People love to soykaf on c++ and OOP but they are a natural way of doing things. You can get as close to the hardware as you need for most purposes while still having powerful abstractions that can be understood by grade schoolers and not just PhDs.
Judge Fang · 2021-08-23 17:54
>>27214 OOP isn't the issue. Lacking implementations are. CLOS does it much better and doesn't require a ridiculous amount of memory to compile. C++ with Boost is pretty much one of the worst offenders in this regard.
CIA_N1 · 2021-08-23 18:02
>>27216 (defterm LISP ("programming language" (consisting (of (few (brackets (more (than you would like))))))))
drop · 2021-08-26 10:10
>>27260 https://www.youtube.com/watch?v=D6xkbGLQesk https://www.youtube.com/watch?v=24VAm8gzWq4 https://www.youtube.com/playlist?list=PLBZBJbE_rGRV8D7XZ08LK6z-4zPoWzu5H https://github.com/gibsjose/cpp-cheat-sheet/blob/master/Data%20Structures%20and%20Algorithms.md https://www.bigocheatsheet.com/ https://thecleverprogrammer.com/2020/11/07/time-complexity-of-algorithms-in-c/ https://alyssaq.github.io/stl-complexities/ https://www.geeksforgeeks.org/analysis-of-time-and-space-complexity-of-stl-containers/
Arisu Mizuki · 2021-08-26 10:14
How to teach my friend basic algorithms and data structures on C++ if she is not into books? I'm looking for advice and maybe some SICP visual novel gamification or website on which you need to fill the gaps in code with tips and errors explanations.
Nguoi La · 2021-08-27 00:29
>>27260 >SICP visual novel Likely unhelpful but http://lyrical.bugyo.tk/.
J.C. Denton · 2021-08-27 07:11
perhaps somebody has already asked, but I don't understand what "good code" actually is, in a sense that I could look at a program and really discern quality besides looking for optimizations. I assume this is because my only programming experience is with elisp, compsci 101, and grad-student code. I think I've heard that what makes good code, and not bricolage, is largely following established design patterns. If anyone could point me towards a good resource on design patterns for clojure and lisps this would be appreciated.
Ivan Horvat · 2021-08-27 08:45
>>27303 Personally I define "good code" as being code that's reasonably efficient, reasonably secure, highly readable, and highly maintainable. The latter two are the most important to me. Highly readable: Can I follow the logic with a reasonable amount of experience in the language, and without any familiarity with the codebase in question? Highly maintainable: Can I quickly make changes to functionality to fix bugs and add capabilities, while being reasonable certain that those changes won't break something else in an unexpected way? I don't worry one whit about optimization, until functionality is complete and every last bug on my list has been squished. Fortunately I just do server backend and commandline tool stuff, so I have that luxury. If I were writing spacecraft control systems (or other low-computing-power instant-response embedded systems) I may have a different approach.
Haruyoshi · 2021-08-27 18:38
Anyone have any good texts/links discussing undefined behavior in C? I was just reading this https://blog.regehr.org/archives/213 and its the first I have actually looked into it. A while ago I was writing some code (in C) for an Atmel micro controller and I was purposefully overflowing a signed integer for a specific effect. I didn't realize at the time that doing this was undefined. Lets say I wanted to keep this behavior, would using inline assembly be the best way to keep it defined? (The micro I was using is 2s complement so signed overflow from the ALU perspective is well defined)
Ein · 2021-08-30 19:23
I can't get hired from a lot of companies since "I dont have enough professional experience". Most of my experience in coding is from my personal experience. I was only hired 1 time in a company, and the rest is just freelancing. Now, I decided to have my own company. But I don't know where to start or how, I have a friend and I chose him as my partner, but he is so newb at coding even when he is currently going to college. Any tips and advices? Thank you!
Delilah · 2021-09-01 10:50
>>27363 just bullshit your CV. learn to network
⍕ · 2021-09-02 18:21
>>27363 Freelancing is coding experience if you code as a service. If company you want to get hired by does not get it - stop sending CVs to reteds and start sending to serious companies.
Torvalds · 2021-09-03 05:52
>>27312 >Anyone have any good texts/links discussing undefined behavior in C? Here https://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html > Lets say I wanted to keep this behavior, You shouldn't relay on the compiler to do the same thing in the future since it's undefined. (sorry, not trying to sound like a smartass) >would using inline assembly be the best way to keep it defined? I guess so.
Colmerauer · 2021-09-04 08:34
>>27394 Thanks for the link. Just to follow up on my example: signed integer overflow is undefined but unsigned integer overflow is fine. One way to ensure signed overflow behaves as expected is to use the `-fwrapv` compiler flag. This of course is non-standard but since GCC is the only relevant compiler for atmel micro controllers using it is acceptable (I wouldn't use it for code I expect to run outside of a micro). Also I _think_ that in this case type punning through a union is actually valid since the size of uint and int are the same and the types are similar. So for example I could have this code: union { uint8_t u; int8_t s; } i; /* could produce (valid) overflow */ i.u++; /* addition where negative values of i are desired */ val += i.s; See the -fstrict-aliasing section of https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html and the relevant sections of the standard mentioned here: https://gcc.gnu.org/onlinedocs/gcc/Structures-unions-enumerations-and-bit-fields-implementation.html
Hacker · 2021-09-11 18:04
>>26831 Check out Beej's Guide to C Programming. It teaches C as a language of pointers, rather than pointers as an extra feature and explains a lot of the background other guides skip.
t · 2021-09-12 11:53
How do you track and gamify your routine? It would be great at the end of the day to get the progress scores for learning C++ and maybe a level-up.
Anamika · 2021-09-13 01:00
>>27487 > It would be great at the end of the day to get the progress scores for learning C++ and maybe a level-up. C++? I can understand being into BDSM. I cannot understand being into C++
Wirth · 2021-09-13 05:31
>>27171 Join a tilde (see https://tildeverse.org). They consist mainly of programmers and everyone is very friendly/welcoming. I have even collaborated with someone from the tilde I'm on for a project.
St. IGNUcius · 2021-09-13 11:17
Where can I download a database of descriptions and screenshots of games, movies and anime? Most known sites like imdb require registration for API and protected from crawlers. I just want to have a local and private list of titles that I liked with information about them.
Church · 2021-09-19 09:33
I'm trying to reverse a cipher without a key, because sometimes the key will not be known. essentially the program takes a string, hashes it, and then splits the hash into 4 parts and selects plain english words to represent the segment. I was thinking of making it so that once converted the hash is saved to a db but i don't think that's a proper solution.
Yet Another Lainon · 2021-09-19 15:29
>>27519 are you saying that the hashing produces the cipher text? if so, hashes are meant to be one-way. hashing != encryption
Just another Random Lainon · 2021-09-20 10:44
>>27524 after doing more research what i am attempting is a Nomenclator cipher. takes a hash like tz3NExpXn9aPNZPorRE4SdjJ2RGrfbJgMAaV splits it into 4 parts and maps to words tz3NExpXn -> Worship 9aPNZPor -> Traffic RE4SdjJ2R -> Happy GrfbJgMAaV -> Precise The 4 segments are fed into the rng. Seed(segment) so that Woship.Traffic.Happy.Precise represents the hash. I just can't figure out how to reverse it without creating a table. If I have to create a table I will probably just create a DHT
Jane Doe · 2021-09-20 10:57
>>27535 I guess I just don't understand what you are trying to reverse or what you are trying to ultimately do. If you are mapping from string to string, like you say, then you probably won't be able to come up without anything better than a table. If you are starting from a hash, then your goal is to go from these words back to the hash?
Bobby Newmark · 2021-09-20 16:46
>>27536 Yes exactly word->hash. The full idea is to have an easy to remember string to represent a wallet address.
cond · 2021-09-20 16:47
>>27541 Or anything that uses hashes like IPFS
Apoc · 2021-09-21 10:57
>>27541 So what you want is a 1-to-1 mapping between English words and hash segments, so that any hash can be converted into a four-word sequence and then back into the original hash. I think you're out of luck. Consider an MD5 hash, which is 32 characters long in hex, i.e. 16 bytes. Each of your four segments would be 16/4 = 4 bytes. 4 bytes give you 256^4 = 4294967296 possible combinations. There aren't that many words in the English language, therefore you can't represent each possible segment with a unique word: either you reuse words (which makes the process non-reversible), or you'll only be able to represent a small subset of all possible hashes. You could make your segments shorter (at 2 bytes, there are enough English words), but then any respectably-sized hash will convert into a few words too many to be easy to remember. Alternately, you can't reduce the hash size, but you can fake it - set up some service where you register shorter aliases for existing addresses. 8-byte aliases provide service for more address than will actually exist, and can translate into 4 words. Problems: obvious ethical issues about collecting and centralizing people's data, fact that translation requires access to your alias database, fact that 50 other identical, incompatible services will pop up. Now, however, if you're really smart such that your conversion algorithm produces coherent sentences, then the problem of remembering long strings of words is greatly reduced, and you could create reversible conversions for long hashes.
Ender · 2021-09-21 15:23
>>27549 How about gluing words together? Like: DirtyWhore or RetardRetard that would be 171k^2 possibilities which is few times bigger number
Milner · 2021-09-21 16:20
>>27549 I did consider the fact there wouldn't be enough words to represent all or even most hashes. I was thinking of hashing the word combination when placed into db to check for collisions. Thanks for the advice. As far as accessing the db this is why i was considering a hash table, essentially client nodes will talk to each other and share an "address book" of sorts.
Von Neumann · 2021-09-23 20:50
>>27170 Ideally it could both be browser-based and an executable, but obviously if I have to choose I'll go with the latter. Something that could run on desktop Linux, ideally. So, any hints?
over · 2021-09-24 07:15
>>27624 How about using Google's Go programing language? It has support for web related programming and support for basic data structures out of the box.
Netrunner · 2021-09-24 15:21
>>27624 just use godot https://godotengine.org has everything you need, claims to be able to deploy on several platforms including the web, all under a permissive MIT license
Zuse · 2021-09-25 01:24
>>27624 you can use emscripten & llvm to compile c & c++ to webassembly & javascript.
Agent Richard Gill · 2021-09-26 08:38
Is Codecademy good? Is there a better way to start as a total newbie?
Cat Mother · 2021-09-26 17:22
>>27680 I think for some people it can be. I never found it particularly thrilling. Personally I've learnt most of what I know through books, and practice. If you can find a nice big book with programming exercises, that'll help you learn quite fast. The language I'm most familiar with is C, so for me the book of choice was K&R's The C Programming Language.
Unspecified · 2021-09-27 22:14
>>26173 Is there a better site to learn programming when an eternal noob than the free code camp? They broke their login and now it won't save progress nor can I make an account I guess. I don't use google and have no skills so have no github so it just acts like my protonmail isn't there while letting me temporarily waste time on slowly doing tutorials that I'll have to just do over again when I get back into it earning no certificates as I go along.... People say to reach out but I think the sight is bad and I'd like to find a different way to finally learn something. In the past I gave up due to family drama but now I blare rain in my ears all day with earbuds so maybe I can succeed this time and stopped drinking and over eating and such so basically I waited too long and the Internet died too hard? Or is there another site like it? Like school? I can't teach myself and videos always have such small text and my Internet speed is low so other than just following books and random written tutorials of which I often fail at understanding what can I do? I just wanted to matter, to express myself, as a neet to have something to give back but can't even get started.
Donna Hawthorne · 2021-09-28 05:05
>>27708 the best way to learn is just to build literally anything. I mostly recommend tools for yourself. Build a command line calculator, or a web crawler, or a reminder, or anything small but useful.
Mentat · 2021-10-01 19:59
>>27708 (me) *site Was stressed making this post and later saw >>27680 mention that site of which is better due to no bullying over the login. Honestly I found it before seeing that comment due to a search query but still felt bad that it was right there recently in the thread I complained in. It's nice to have an alternative.
string · 2021-10-06 20:16
Where does the 4 come from in the explanation of this algorithm? It looks like there are two operations the first time (dotimes (j (array-dimension mat 1))) runs, and three operations the rest of the times (not "half" or "if the planets align"). lisp (defun mat-max (mat) (let (max) (dotimes (i (array-dimension mat 0)) (dotimes (j (array-dimension mat 1)) (when (or (null max) (> (aref mat i j) max)) (:= max (aref mat i j))))) max)) >This function finds the maximum element of a two-dimensional array (matrix): >CL-USER> (mat-max #2A((1 2 3) (4 5 6))) >6 >What’s its complexity? To answer, we can just count the number of operations performed: at each iteration of the inner loop, there are 2 comparisons involving 1 array access, and, sometimes, if the planets align we perform another access for assignment. The inner loop is executed (array-dimension mat 1) times (let’s call it m where m=3), and the outer one — (array-dimension mat 0) (n=2, in the example). If we sum this all up we’ll get: n * m * 4 as an upper limit, for the worst case when each sequent array element is larger than the previous. As a rule of thumb, each loop adds multiplication to the formula, and each sequential block adds a plus sign. >we can assume that approximately half of the iterations will require assignment (which results in 3,5 operations each inner loop), and, for the worst case, the number will be exactly 4.
Boole · 2021-10-07 02:02
>>27798 When analysing complexity you're (normally) looking to prove an upper bound on the runtime in relation to input so it's helpful to start by assuming the longest code path on each iteration. Don't get too caught up on counting the exact number of operations, if you keep reading the book'll more than likely go on to explain why constant factors (the 4 in n * m * 4) can be ignored in this kind of analysis. If I had to guess the author's probably counting the null check, array dereference, comparison, and assignment as the 4 basic operations, but even that relies on knowledge of some implementation details.
Pulse · 2021-10-08 18:19
>>27802 >go on to explain why constant factors (the 4 in n * m * 4) can be ignored in this kind of analysis It does, but I should be able to get the same number as the author for this very basic thing in the very first example. >null check, array dereference, comparison, and assignment as the 4 basic operations But then or should be counted, and there are two references, for 6 operations in total.
Cereal Killer · 2021-10-08 19:27
>>27825 It really doesn't matter, the choice to count one thing or another. As long as it's consistent you'll get decent results. It's like Statistics in the sense that we only care if the result is between some bounds.
Shogun · 2021-10-09 07:58
>>27825 >But then or should be counted, and there are two references, for 6 operations in total. Yeah, hence why I said it's not clear without knowing details of language implementation. Or is a built-in that will assume the value of its first true argument and setf is a macro that understands assignable `places' so it's appropriate to consider them single expressions. Really don't get too hung up on this though; all you have to know is that the number of operations executed within each iteration is bounded by some constant. It doesn't actually matter what that constant is.
Cowboy · 2021-10-09 12:33
My question is not really aimed at a particular language but, given a limited set of valid actions, how would you parse and interpret the user input? Similar to how SQL parses inputs such as "CREATE TABLE tablename;". How would one go about this in an OOP language?
Ivan Petrov · 2021-10-09 13:35
>>27851 Nigger could you rephrase the question bu tin english?
bit · 2021-10-09 14:01
>>27853 Given the following input: "MAKE TABLE new_table; INSERT THREE COLUMNS; DELETE ONE COLUMN;", I want to know what could be a good approach to extracting some keywords (the words in uppercase) and their parameters (the words in lowercase) from a string and appending them to a buffer in order to perform a series of tasks.
Boole · 2021-10-09 21:49
>>27856 You want a parser. Each character is looked at in a for loop. A letter denotes the start of a word, a space denotes the end of the word, then another letter means a new word is starting. A semicolon is just a symbol. You accumulate these tokens' types and value in a buffer. e.i. [{eWord, "MAKE"}, {eWord, "TABLE" }, {eWord, "new_table"}, {eSymb, ';'}, ...] Then you loop through your buffer and expect specific combinations of tokens. You'd make sure that if you run into the word MAKE, that the next token is TABLE, or PROC or other valid things to make. If the word isn't valid you return an error to the user, because they wrote nonsense... To finish the example, you'd then expect any word to name the Table, and then the next token is expected to be a semicolon. At any of these checks you return an error if the wrong token is met. Now that you've validated the input, you can issue the command you'd want to when a user inputs "MAKE TABLE new_table;".
Sabo Engle · 2021-10-14 10:06
How would you handle gpl2 license violation in the source code owned by a company I work in? I'm a solo developer on that project so if this goes public the company would know it was me but I don't want to leave it this way and say nothing.
DEBUG-CONTENTS · 2021-10-16 12:36
>>27993 This is obvious, but have you written to the FSF? Not to whistleblow right away, but to ask for advice - surely they must've met many people in your situation before. Otherwise, it sounds like the only way is to gently nudge the company into a situation where you'd be clear of suspicion, or where they'll get caught by someone else. Dumb example, suppose you talked your manager into having a public github repo for some unimportant code, so you can get some of that 'open source' cred that bosses seem to love (plus get some free patches maybe), and then, oops, someone tied the knots and found a license violation (that you, as a programmer, obviously had no idea about).
Koichiro · 2021-10-19 13:33
>>27993 just start distributing the source code along with the binary, no one will notice.
Lord Nikon · 2021-10-19 13:39
I know it is not the brightest question but I am having hard time to understanding executement of codes that uses EOF. Looked it up online and didn't satisfied with the answer. I have a code that I simply took from Kernigham and Ritchie's books which executes itself without an ending point. Trıed to solve it with my current knowledge but couldn't managed to find a way for it. TL;DR; Can you explain me how to exit EOF sequences? CTRL C quits the whole program, I just want to see the results T_T #include <stdio.h> int main () { int c, i, nwhite, nother; int ndigit[10]; nwhite = nother = 0; for (i = 0; i > 10; ++i) ndigit[i] = 0; while ((c = getchar ()) != EOF) if (c >= '0' && c <= '9') ++ndigit[c-'0']; else if (c == ' ' || c == '\n' || c == '\t') ++nwhite; else ++nother; printf("digits ="); for (i = 0; i <10; ++i) printf(" %d ", ndigit[i]); printf(", white space = %d, other = %d\n" , nwhite, nother); } /* thanks for examining it. */
Hiro Protagonist · 2021-10-19 16:48
>>28072 You have two options. ctrl+D "types" an EOF, in a terminal that terminal will exit, if the terminal is running a program the program will receive an EOF from its next getchar() call. The other thing you could do is take advantage of redirecting input. echo "0123456789" > in.txt; ./a.out < in.txt And that's the whole reason to use that style of EOF terminated loop, so that your program can run just as well with a file as with terminal input.
Special Agent Bob · 2021-10-21 17:16
I don't care to build anything and I need structure, is it dumb to just work through random programming booms until I get reasonably good at programming? I'm in school for it now and I feel insecure about my abilities and need to do it more because I need some way to make a living.....I'm currently working through the C Programming Language, I already know C++ though but I just read through and do the exercises my end goal is to just grind Leetcode but even easy is too hard for me, what would I have to do to get there?
Koos van der Merwe · 2021-10-21 21:37
>>28119 I'm normally an advocate for reading since people very frequently lack theory and breadth of knowledge, but you'll never be able to program well unless you do a lot of programming. It's like any other skill. You should read a book on algorithms, not how to program in a particular language, most easy leetcode problems can be solved with basic data structures, so you don't need to go too deep. Don't be afraid to spend an hour or two working through a problem on paper either; it's the best way to learn. However, what's your actual goal? I very much doubt it's just to grind leetcode since that's boring as fuarrrk and goes nowhere. Is it to get a job, measure your skills, or gain exposure to a wide range of problems? There might be better ways to go about these things.
Ender · 2021-10-22 09:03
>>28119 Leetcode (leetfree.com) and whiteboard questions are better done with a shorter, simpler language like Python. Since you're getting a degree, that gives you leeway in not having to actually know C++ for an entry-level job that uses it, they'll train you for it.
Lunch · 2021-10-22 17:03
>>26173 How bad is my code for K&R 1-13 exercise? Keep in mid this is my first time reading the book. #include <stdio.h> #define IN 1 #define OUT 0 int main(){ int c, i, wrd, state, count; int wrdlgth[11]; wrd = 0; state = OUT; for(i = 0; i < 11; ++i) wrdlgth[i] = 0; while ((c = getchar()) != EOF){ if(c == ' ' || c == '\n' || c == '\t') state = OUT; else if( c != ' ' && c != '\t' && c != '\n' ){ state = IN; ++wrd; } if (state == OUT && wrd < 11){ ++wrdlgth[wrd]; wrd = 0; } else if (state == OUT && wrd >= 11){ ++wrdlgth[10]; wrd = 0; } } printf("\nHistogram of occurencies of words of n characers of length\n\n"); for(i = 1; i < 11; ++i){ printf("\n length %d: %d ",i , wrdlgth[i]); for(count = 0; count <= wrdlgth[i]; ++count) printf("="); printf(">\n"); } printf("\n"); }
Cereal Killer · 2021-10-22 18:17
>>28152 You should be able to init wrlsgth's contents as zero without the for loop int wrdlgth[11] = { 0 }; I think a simpler condition could work here if(c != ' ' && c != '\n' && c != '\t') { state = IN; ++wrd; } else { state = OUT; } Final thing, just a personal preference but I'd write the second condition like this if (state == OUT) { if (wrd < 11) ++wrdlgth[wrd]; else ++wrdlgth[10]; wrd = 0; }
Neuromancer · 2021-10-22 19:20
>>28152 most important thing is it works. i prefer switch statement when checking just a single variable with more than two conditions: switch (c) { case ' ': case '\n': case '\t': state = OUT; break; default: state = IN; ++wrd; break; } you can factor out state == OUT, and wrd >= i is redundant after checking wrd < 11 if (state == OUT) { if (wrd < 11) { ++wrdlgth[wrd]; } else { ++wrdlgth[10]; } wrd = 0; } initialize with your array zero'd out like this instead, don't do that for loop int wrdlgth[11] = {0}; i prefer enums (if integer values) and consts over #defines, easier to debug. #define is hacky, should only be used for last resort. k&r is an outdated book. enum { OUT = 0, IN = 1 }; there are 4 places in my modified code and 5 places in your code where the number 11, referred for the same thing, is used. this is known as a "magic number", if you ever have to change it to a different number there are multiple places you would need to modify it in your code which is a debugging hassle, therefore it should be a constant instead so you only need to modify it one place in your source code. thus in my code it would be changed to: enum { OUT = 0, IN = 1, LEN = 11 }; ... int wrdlgth[LEN] = {0}; ... for (i = 0; i < LEN; ++i) ... if (wrd < LEN) { ... for (i = 1; i < LEN; ++i) { ... it is preferred by most in the c community that variable declarations are all separate lines, so your int c, i, wrd, state, count; is unacceptable. plz don't write code sloppily like this for(i = 1; i < 11; ++i){ write it like: for (i = 1; i < 11; ++i) { plz follow the linux kernel style guide especially for the conditional statements https://www.kernel.org/doc/html/v4.10/process/coding-style.html
Milner · 2021-10-23 12:14
>>28071 >just start distributing the source code along with the binary, no one will notice. He probably cannot distribute the code as it most probably it's the company that holds copyright. It's the company that can grant license to others and it's that company that is obligated to support their clients with source code. Even in companies where you work on 100 percent GPL covered code you as a programer have no rights to distribute code and/or binaries as you write code that is owned by a company and therefore have no right to grant anyone license to use that code and/or binary. Unless you get explicit clausules i contract that do not transfer ownership rights of code you write to the company or grant you explicitly rights to publish and distrubute code and/or binaries under GNU GPL.
Colmerauer · 2021-10-23 13:13
>>28152 Now that I look at it again, there is a bug where if you enter EOF right after the last char of the last word you've entered, that word won't be accounted for. >>28157 >it is preferred by most in the c community that variable declarations are all separate lines, so your int c, i, wrd, state, count; is unacceptable. Thought I'd share that the OpenBSD codebase style on the other hand encourages for variable initialization of the same type on the same line.
t · 2021-10-23 14:54
>>28174 Personally i only put related variables of the same type on one line.
string · 2021-10-24 04:12
>>28126 I literally just want a job. I enjoy programming to some degree when I'm doing it, enough that I don't think it would make me blow my brains out doing it for a living (also, taking assembly language this semester really impressed on me how rewarding it can be) but I'm not crazy enough about it to do just be like, "fuarrrk it, build a raytracer" I imagine being able to do a decent amount of leetcode problems would at least mean you have a decent grasp on fundamentals and general peoblem solving, no? I also just like the challenge.
vector · 2021-10-24 16:57
>>28190 >I imagine being able to do a decent amount of leetcode problems would at least mean you have a decent grasp on fundamentals and general peoblem solving, no? Leetcode problems given in job interviews especially in FAANG usually have to be solved within strict time limits. Take too long and the other applicant who "solved" it quicker by basically memorizing the solution gets the job over you.
The Phantom Phreak · 2021-10-24 23:42
>>28209 This reminded me how in my top University in whole country that I was attending many people were preparing to calculus exam by memorizing whole solutions to specific examples of integrals. Comedy gold, but true. As for algorithmic problems, well it's hard to deny memorizing them increases the speed of producing their implementation. Much worse is memorizing exact problems that exist only in job interviews world. Is this a valuable quality for a programmer to be able recreate such memorized solution? I doubt it. Is this my problem or a problem of recruiting company? Well, for sure not mine.
Frank Garza · 2021-10-25 03:18
What's a good starting point for learning haskell? I'm decent at python, and know some javascript, C++, and Java
Just another Random Lainon · 2021-10-25 23:06
>>28216 lambda calculus xD
word · 2021-10-26 10:43
>>28216 So, you're fluent in imperative programming and a form of OOP. Although I've only dipped my toes in it, my impression is that there isn't a whole lot to learn in Haskell, and the learning curve comes mostly from wrapping your head around individual abstractions in the stdlib or popular libraries. The previous answer is actually right, if you understand the rules of function definition and application (you do), you pretty much only have the type system left to learn. Therefore, rather than reading a comprehensive book, which would reinforce the idea that Haskell is big and scary, I think you should jump into some quick guide to functional programming and algebraic data types. Head over to https://wiki.haskell.org/Tutorials and pick. http://learnyouahaskell.com/chapters is technically a book but won't feel like one if you browse the web version at your leisure. Real World Haskell I don't recommend as a first resource, as it's big and slow.
Newbie McGee · 2021-10-27 07:57
I'm so new ;; I...I need help changing the directory in the console (or something like that) I am trying to get java working but I am a little bit stupid.
Erik Johansson · 2021-10-27 13:10
>>28276 javascript and java aren't the same language at all. Don't use their names interchangeably. To change directory use 'cd' followed by the directory name. You can do 'cd ..' to go up and out of the current directory.
William Holtzer · 2021-11-10 13:08
>>26173 I am making a terminal-based audio file player for Linux in C++. How do I go about actually playing the files? I can't seem to find any resources that aren't Windows specific.
Rick Deckard · 2021-11-10 13:26
>>28276 If you are on GNU/Linux, read https://linuxcommand.org/tlcl.php >>28498 >How do I go about actually playing the files? Grab a library: https://ffmpeg.org/developer.html or https://www.sfml-dev.org/tutorials/2.5/audio-sounds.php or https://xiph.org/vorbis/ or http://xine.sourceforge.net/
aliased · 2021-11-14 05:12
i need help with this, i dont know what is doing manjaro there, if i disconnect the 2 ssd (the only storage in the computer) it still there, the hard disk named ubuntu (llinux mint actually) dont have nothing to do because manjaro was in the boot sequence before, for some context i tried to install manjaro in my computer first but for work i had to come back to windows and i only have 1 ssd in that time so i format the disk and install windows, dont know if this question is stupid but i couldn't find anything online, by the way not english speaker so tell my if somethin is not clear
wiredtoworld · 2021-11-14 05:17
>>aliased This is a common problem on Gigabyte MB's, it should work again if you reset the bios.
Miho Iwakura · 2021-11-14 05:26
>>28545 thanks im going to look how to restart it
New guy · 2021-11-22 00:09
>>26173 If I wanted to become a computer scientist but knew barely anything about computers where would the best place to start be?
Drifter · 2021-11-22 10:25
>>28629 - Install GNU/Linux: https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current/amd64/iso-cd/firmware-11.1.0-amd64-netinst.iso - https://linuxcommand.org/tlcl.php - Learn to program. Start with https://htdp.org or The Little Schemer. - Read https://savannah.nongnu.org/projects/pgubook - Learn math. Read Precalculus Mathematics In A Nutshell: Geometry, Algebra, Trigonometry by George F. Simmons
Sipho Nkosi · 2021-11-22 22:30
I just started the lazyfoo sdl tutorial, and I am having trouble with VSC error squigglies. They keep on saying <SDL.h> can't be found, but I can compile just fine and I have all of my includes in order (the \bin folder and include\sdl2 folder), what can I do? It's not even letting me ignore that "error".
Anonymous · 2021-11-23 12:36
>>28651 If your using SDL2 then (At least in Linux) you should include <SDL2/SDL.h> and not <SDL.h> . Maybe that your problem.
Batou · 2021-11-29 15:27
Is it normal to feel like college is a waste of time, or is it just that my professors at my soykafty community college suck ass? I feel like I'm not learning anything. We've been wrestling through assembly language this semester and it's a disaster. Started with 34 students, 4 are left and of those four (including me) none of us have any fuarrrking idea what is going on and it seems like our professor is just leading us onto some weird clusterfuck roundabout way of understanding caching mechanisms. It's pretty frustrating. I want to get an internship already but I feel like I don't know anywhere near enough, and there's so much out there I don't even know what to work on
Yu-ichi · 2021-11-29 16:16
>>28707 You're not really there to learn, though if it does occur it's a nice bonus, you're there to obtain your credentials, to network as much as possible and attend all their job fairs. It doesn't matter how incompetent your professors are, if you can get them to like you by offering help or whatever then you have a prestiguous professional reference you can use in job applications or they might be able to offer you work through their connections.
Armitage · 2021-12-01 13:30
>>26173 How do you even start coding? I know this sounds stupid, but this gap from reading algorithms, language syntax, architecture to actual stuff is goddamn frustrating. Any piece of advice is welcome WHAT DO.
Crash Override · 2021-12-01 14:27
>>28707 Yeah, it does feel like a waste of time sometimes but it's pretty concerning if 30/34 students stopped going to class. Your teacher probably noticed it too and they're probably wondering what they're doing wrong too. If the class is not working out for everyone then you should talk to your teacher. Don't do it alone because then they could just blame you for not studying enough, go as a group. I had a similar situation recently (not as bad as yours though): we asked the teacher for an extra lesson to do guided exercises in class because we struggling to keep up with him. He agreed, learnt what we were struggling with during that day and adapted the course. Of course this depends on what kind of person your teacher is.
cdr · 2021-12-01 21:37
>>28736 >How do you even start coding? I know this sounds stupid, but this gap from reading algorithms, language syntax, architecture to actual stuff is goddamn frustrating. what do you define as actual stuff? you don't need to know any of that stuff except basic syntax to code.
quote · 2021-12-02 00:50
>>28736 Read a book or tutorials for beginners. Doing something (anything, really) is the key to progressing, not "doing it right the first time".
limited · 2021-12-07 20:48
I'm kind of split between what I want to do. I know I want to toy around with python and try things with it, but, would it also be 'smart' to try and look at other languages, like lisp?
Frank Garza · 2021-12-08 09:09
Hello, Lainons. How do you guys keep a constant pace of programming practice? I've been stuck with this for a while now. In college, I did the exercises because I needed to. But now, since I'm in an internship (web dev related, although I don't feel like I'm really learning new things, and it doesn't attract me that much) and studying Go with my spare time, I can't really start side projects. And when I do, I can't finish them. Does anyone have any advice?
Dr. X · 2021-12-10 00:48
I'm >>28707 What are the best ways to get a comprehensive self education? I'm obviously going to school so I more or less know how to kinda program but I want to learn more so I don't get shrekt if and when I transfer. I'm also just kind of upset at how irrelevant at what I've been learning feels, and even software engineers I've talked to outside of school are like "bro your teachers/curriculum sound like soykaf" >>28741 The professor is like kicking dead whales down the beach, he's been teaching for 25 fuarrrkING YEARS and he's had fail rates like this forever. His object oriented class only has 5 people in it left out of 36. The last two weeks he has not really bothered to teach and has just been kind of passive aggressive about the fact that there is no one left. I figure if complaining to the dean was worth a soykaf maybe he wouldn't be teach so I just kinda have to accept my crap GPA as the result of the guy who won't explain crucial aspects of the syntax until very late in the semester. He's never even walked us through how to do an if else in our spefic assembly environment and it took me hours of banging my head against the wall to learn how to do a loop in IA32 because there were some really subtle details that would break everything. I remember asking him about it and he seemed pretty disinterested, and I pester him constantly because otherwise there would be no way to figure out what is even going on. Even his TA doesn't know what he's doing most of the time. I regret taking these classes at this college because I took Data Structures with him (he is one of two teachers for the core CS classes and the other one fills up instantly due to how bad this professors reputation is) and it was just copying soykaf out of the book without ever really explaining WTF is going on so my knowledge of DS is really bad even for a community college student.
Ishikura "Tatsu" Tatsuhiko · 2021-12-11 12:38
I have finished programming a Space Invaders Clone without any game engine. I'm not sure If I should post a link to the github repository. The code is kind of soykaf since, my main motivation to program the space invaders games was to actually complete a project that was not overambitious and to get rid of bad programming mindsets (ones so bad that they might be an indicator of there mental issues) snd others like failing using OOP correctly, not following the YAGNI principle and not experimenting more with scripting languages. Actually I will post the repo, since I trust this image board more than the others. https://github.com/AntonyA3/SpaceInvadersClone Hopefully I can post another complete project soon that is both complete and has clean code along with implementing audio.
Zero Cool · 2021-12-11 14:57
>>28914 Are you using LuaJIT?
Random · 2021-12-12 00:08
>>28915 It just uses Lua5.4 not LuaJit
Nanashi No Gombe · 2021-12-15 02:42
What's lainchans opinion on this book for someone who have previously dabbled in Python and C but isn't very good at programing?
Lord Nikon · 2021-12-15 11:57
>>28980 I've heard it's an easier version of SICP.
lainon · 2021-12-26 14:58
AVX 512 - is it still considered as mostly sucking?
Lukasiewicz · 2021-12-27 08:05
Hi lains! I want to back up all threads of one imageboard which is based on our lainchan, I hope you guys give me some suggestions about how to start and which tools should I use etc. I am a newbie and know basic Python syntax. Thanks
Unnamed · 2021-12-27 08:37
What are some fun systems programming projects? I'm relearning operating systems concepts and would like something that can be done in, say, a week
Six · 2021-12-27 10:14
>>29190 a kernel or a shell
renames · 2021-12-27 10:39
>>28980 It's good. But if you don't like it, read The Little Schemer.
Zero Cool · 2021-12-27 13:41
>>29190 try implementing a file system like ext2 or fat32. create a disk image (on linux you can create an empty file with dd, mount it and then mkfs.ext2 on it to generate the filesystem image). you can write a program that simulates a hard disk interface by reading the file and you then implement stuff like reading&writing files. the osdev wiki has a few pages packed with info about this stuff.
HELIOS · 2021-12-28 10:03
When reading large source codes, do I need to read every file? I am trying to read Snort's source code, more for learning how an IDS works, but i get lost in the soykafton of files, and I always wonder if i should read a file before or after another. (e.g. reading main.cc lastly or firstly.)
Hououin Kyouma · 2021-12-28 10:05
>>29189 If it is urgent and/or you do not want to write your own tool, you can use httrack.
let · 2021-12-28 23:06
>>29211 Depends what are you going for. But in general it's helpful to at least find an entry point of the project. I mean the code where in case of programs main() function is located. Then you have to figure out architecture of code if there is any so you can tell more or less where is what located and how is it divided into smaller parts like modules and where to look for algorithms implementations etc. It's hard to be more precise than hand waving as every project is different and even projects of the same category can have drastically different structure of codebase. Many large projects are undocumented in many aspects related to the project structure - I remember what a pain was initial attempt on grasping many parts of FreeBSD kernel - it's big many parts are not documented and when they are many facts are omitted and you can end implementing stuff that is OK acording to documentation but is not working and after debugging you realize that you used some special case of some interface that is linked to totally different part of codebase than other interfaces from same group and that fact is not mentioned at all in documentation. So this is an adventure.
Lady 3Jane.. · 2022-01-02 11:53
I'm doing some basic HTML/CSS and in the process of trying to find out why some elements weren't being centered I realized that <body> was only taking up about half the page (and one of the elements I was trying to center was sliding downwards as I moved the browser's console since it apparently was outside of <body>'s scope, even though in the code it isn't). I've already spent some time looking for solutions but I didn't get anything that worked, the only answers that don't refer to the content (as opposed to the wrapping body) simply said to set height to 100%, which didn't change anything. I even came across a stackoverflow reply saying that can't be done with pure HTML/CSS unless you put everything inside tables. This is really getting on my nerves, it's something really basic and it shouldn't be this troublesome. Any tips?
John Rain · 2022-01-02 13:55
good books/sites on how to design a physics engine? not sure how you get from "implementation of a single equation" to "world"
Undisclosed · 2022-01-02 17:47
>>29306 https://css-tricks.com/centering-css-complete-guide/ https://www.w3.org/Style/Examples/007/center.en.html https://www.quora.com/Why-is-it-so-hard-to-center-things-in-CSS >This is really getting on my nerves, it's something really basic and it shouldn't be this troublesome. welcome to css >>29310 https://www.mathsisfun.com/algebra/distance-2-points.html https://www.mathsisfun.com/physics/index.html https://www.mathsisfun.com/algebra/vectors.html https://www.khanacademy.org/math/algebra-home/alg-vectors https://www.khanacademy.org/math/precalculus/x9e81a4f98389efdf:vectors https://www.khanacademy.org/science/physics http://programarcadegames.com/ https://www.petercollingridge.co.uk/tutorials/pygame-physics-simulation/ https://pet.timetocode.org https://www.youtube.com/c/DaFluffyPotato/search?query=physics https://www.youtube.com/results?search_query=pygame+physics
overriding · 2022-01-04 19:01
Do people audit the libraries that they are using? Am I doing something unnecessary by reading all the files in the library that I'm planing on using? Is this a waste of time?
Netrunner · 2022-01-04 23:55
>>29331 >Do people audit the libraries that they are using? Mostly not, judging from the recent supply chain attacks on Python and NPM.
Unnamed · 2022-01-07 21:43
Hi lain, I've been messing with low-level network stuff recently, I wrote something that's sort of a cross between reliable UDP and LEDBAT. I want to test it against various network situations (simulating dropped packets, severely delayed packets, see how it interacts with other streams on the same network, etc.). Is anybody aware of a tool for this? I'm not a beginner really but I didn't want to waste a thread on this.
Honore de Ballsack · 2022-01-08 08:35
Hello As you probably know audio file formats can store a bunch of other data aside from raw audio, one of those are timeline markers. Picrelated is how they look in audio editor. They can be placed arbitrarily and there's several types of them. The question is: are there any JS libraries to parse those markers from the playing audio file and use them as events. The use case is: once playback reaches one specific marker, some specific action should be automatically triggered. Thanks.
Undisclosed · 2022-01-10 10:49
When do I use exceptions vs conditional logic in Java? I've looked up answers to that but they mostly amount to "exceptions should be used in exceptional situations", but as a noobie I crave examples that are more concrete.
Tomohisa "Tom" Kanezaki · 2022-01-10 13:17
>>29410 Exceptions are for error handling, conditionals are for everything else.
dup · 2022-01-11 13:24
I'm currently learning C and I come from higher level programming langs (python & nodeJS). How do I find what header file is needed for a project? Is it okay to not know what every header file does? I was told to look at examples, but I always feels like a script kiddy when I do, and it's even worse because I don't know what the header files in the examples do either.
Colmerauer · 2022-01-11 13:33
>>29411 But suppose I don't know about the predefined errors. If I didn't know InputMismatchException existed, for example, why would it be wrong for me to simply check whether the input is correct with an if? A benefit that seems logical is separating the detection of an error (in the called method) from the handling of it (in the calling method), particularly if we're talking about a big source code where you can't really read through everything. Other than that it doesn't seem immediately useful, though.
Drano · 2022-01-11 13:38
Why is abstraction so hard for me? I'm trying to master Rust for almost a year now, and I can't really understand the abstract methods and data types present in most of the language, even though I think it's the most based thing in the world and would die to learn and master it properly. I'm mostly interested in theory and don't know where to start learning all of there is in abstract programming right now, can someone help me?
Hagbard Celine · 2022-01-11 13:53
>>29422 I found good points here >https://docs.oracle.com/javase/tutorial/essential/exceptions/advantages.html but if anyone has something to add I'd still appreciate it.
if · 2022-01-11 19:41
Are certs worth it? I was considering it as a way of fixing me going to a soykafty uni and starting late.
Zero Cool · 2022-01-12 05:06
Should I use opengl or xlib/win32 to render something to the screen? Is there any way to render something to the screen on 'modern' operating systems without needing to depend on a library (such as opengl or xlib) like in the dos days?
⍕ · 2022-01-12 11:58
>>29421 There are only about 15 libraries in the C89 standard, and only 3 of them you should really know (stdio.h, stdlib.h and string.h). https://www.tutorialspoint.com/c_standard_library/ Contrary to the name string.h be aware it contains lots of memory functions (see https://stackoverflow.com/questions/9782126/ ). Avoid using C when starting new projects for anything security-related (because of buffer overflow possibilities everywhere), string manipulation-related (it's very primitive compared to newer languages like Perl, Python, JS, Go, Rust) or higher maths-related (lack of libraries compared to Python, also see https://levelup.gitconnected.com/how-python-represents-integers-using-bignum-f8f0574d0d6b ). It's become more of a niche-purpose language than a general-purpose language. >>29422 Compile and run these programs and you'll understand the purpose of catching runtime exceptions aka unchecked exceptions. import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter any non-integer value: "); Integer input = sc.nextInt(); System.out.print("The program continues without terminating."); } } import java.util.Scanner; import java.util.InputMismatchException; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter any non-integer value: "); try { Integer input = sc.nextInt(); } catch (InputMismatchException e) { System.out.println(e + " has been handled."); } System.out.print("The program continues without terminating."); } } >>29423 >I'm trying to master Rust for almost a year now, and I can't really understand the abstract methods and data types present in most of the language, even though I think it's the most based thing in the world and would die to learn and master it properly. Maybe it's not so "based" if it takes that long just to become productive. >>29433 >Should I use opengl or xlib/win32 to render something to the screen? It depends what frame rate you need, if you need to render something 3D, if you need shaders, etc. >Is there any way to render something to the screen on 'modern' operating systems without needing to depend on a library (such as opengl or xlib) like in the dos days? No, read https://en.wikipedia.org/wiki/Hardware_abstraction
XERXES · 2022-01-12 15:57
>>29422 With "conditional logic" do you mean checking that the input is "good" before processing it so that you know there won't be errors? There is nothing bad about doing it. I've actually read a nice article about this idea taken further, it's completely unrelated to java though: https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ Back to Java though, many methods in the standard library do these checks internally because they want to take that problem from you. Now, if you decide to check your arguments won't cause a throw when you call a method, you have 3 problems: 1. Java will still force you to catch those exceptions, even though your checks SHOULD prevent them to be thrown. Your code will get filled with empty catch statements, which is ugly. 2. These sanity checks might be many and/or complicated. Consider a method call like `doPayment(creditCardNumber, amount)`: you now need to check that the credit card number is valid, that the amount is a positive number, that the credit card has enough money for the payment and probably a whole lot of checks. 3. You might also not be able to do these checks: what if that method does an internet request to the bank and throws an exception if the bank responds negatively? To check that such request would succeed you would need to do the request, but you basically have re-implemented the method at that point 4. Your program will end up doing these checks twice: it's probably not important in most cases, but it might be if you're doing stuff with files, internet or big data Your idea is not wrong, there are many other languages that don't have exceptions and instead prefer other methods of handling errors, but exceptions are Java's way and fighting it might be painful. By the way, you might already know this but InputMismatchException is an unchecked exception, which are a special kind of exceptions for which the compiler won't warn you if you forget to catch them. They are supposed to be thrown only for very special situations (I'll let you google this one) but IMO they have been a bit abused in some places of the standard library. You probably are using one of those places
list · 2022-01-12 19:00
Hey anons I wanna make 3d objects rotate with mouse movement, I dont know code soI was wondering whats the best language to tackle this? I study pure maths so ive got linear algebra under my belt what sort resources will this require? and what time frame am I looking at? pic unrel
stack · 2022-01-12 19:52
>>29446 You use the language with the libraries you need. Most languages have libraries for every specific purpose under the sun. So, python, because it's the most versatile language and similar to other babbylangs like Lua. So basically just research what libraries you'd want to use for your program and then learn the language that library is for, or just use that library with bindings to a language of your choosing. It doesn't matter which language you learn. You learn one you learn another in microseconds.
Jesus Christ · 2022-01-16 21:15
>>29422 >>2944 >Your code will get filled with empty catch statements to be fair, the check statements shouldn't actually be empty because the preemptive check might not exactly match the actual check, especially if the requirements change. >3. You might also not be able to do these checks Race conditions often cause this. E.g. someone withdraws money between the balance check and the actual transfer. >IMO [unchecked exceptions] have been a bit abused in some places imo, checked exceptions shouldn't be used since they are not genericizable and thus impede reusability. The danger with exceptions is that you can accidentally handle the wrong exception, e.g. catching an IndexOutOfBoundsException in a code block that has multiple places where such an exception could be thrown hidden within other functions.
Johnny · 2022-01-21 11:47
hello lainons, I finished my first book on C and after trying it for a while, I wanted to go a step up and learn OOP, so I thought I'd pick up C++ next, but I've found a lot of people talking about rust, so I looked it up, and it turns out that rust has a lot of tempting features that C++ doesn't, like borrow checker, package management, send & sync, and so on. But, to be honest, I'm more biased towards C++ because of tutorials and books, as well as the fact that it's been in use for decades. If there is a lainon who has tried both and is willing to share their thoughts, that would be a huge help.
J.C. Denton · 2022-01-21 13:20
>>29573 Rust is to C++ as Clojure is to Lisp. There's definite inspiration, and it's designed for roughly the same problem domain, but looking at the big picture, they're very different. C++ is a low-level procedural language with support for high-level object-oriented abstractions, whereas Rust is more like a high-level functional language that gives you access to low-level procedural features.
Debbie Charteris · 2022-01-21 15:38
>>29446 >I wanna make 3d objects rotate with mouse movement Plenty of JS frameworks and probably more than one doing exactly that. You'll likely want it to run in a browser to demonstrate it to others, and it's at your level of complexity (i.e. you're not interested in writing interrupt routines for graphics hardware etc)
Roy Batty · 2022-01-21 15:45
P.S >>29446 >what time frame am I looking at? You're a researcher now, so that's for you to decide - it depends on your skill level. My guess from your need to ask such a question: if you're good at programming, even if you don't code Javascript, it could be done in a day, or two at most. If you're a no coder, you've got a few weeks of fun to understand the concepts. Resources: Internet, web browser, computer, brain.
Mario Rossi · 2022-01-27 08:19
Hey lainons So i've heard of Wolfram and its programming language, yet I can't find any suitable sources to learn about the language. I've been really enjoying WolframAlpha and my curiosity for the language as been growing ever since. Does anyone have any resources that could introduce me to the language? I don't really want to make an account on their site (as much as I like their services) and I'm not ready to buy/pirate a book on a subject I don't know yet.
Trinity · 2022-01-27 19:37
>>29664 Wolfram is a turd and he believes in bullshit like publishing source code would make him lose control over project [dafaqwtflollmao?] so don't expect him to make documentation widely available.
Roger Pollack · 2022-01-31 00:39
I don't know if this is the right thread for this question, but If I were to write my own programming language which targets Windows and Linux computers, what would I need to do to also target android? Are there any guides/starting points on how to write compilers that target android?
Void · 2022-01-31 11:05
>>29839 From what I understand, Compiling an Android project requires you to go through the DEX compiler at some point, because Android works with ART / Dalvik Byte-code. In Java or Kotlin, you can compile your code into Java byte-code and then chuck it into the DEX compiler to get your dalvik byte code and, ultimately, your compiled project. (Pic related) So, your compiler will need to either: output Dalvik bytecode, or, output bytecode that the dex compiler will be able to understand.
XERXES · 2022-01-31 11:10
>>29846 I would like to add that it is also possible to use C / C++ in an Android project with something called an NDK. (Native Development Kit) Maybe that could hint you towards something else. I'm new to android stuff so I can't tell you how it works in depth.
Dox · 2022-02-09 08:17
just found out about this chan it's so unbelievably good thank you to everyone involved
Armitage · 2022-02-13 10:50
How would you safely parse and validate a string that contains a date in C? The date format is fixed (yyyy-mm-dd). I thought of using sscanf but I'm not sure if it's the right/safest approach.
Motoko Kusanagi · 2022-02-13 17:32
>>30109 https://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html https://man7.org/linux/man-pages/man3/strptime.3.html
東方算法騎士団 · 2022-02-14 04:55
Hi, guys. I'm a very new guy(new means everything zero), I wanna learn some programming things but I don't know where am I begin, I don't know what goal or area I go for, cuz I recently rebuild myself from a ten-year-long GAD&MDD : )I love these things, maybe I can do a job about these in the future. But I am 28 now, so maybe I will not have any possibility : ( I've searched some, and I decided to begin with Behrouz Forouzan's Foundations of Computer Science, but a have a little question, what type of language should I begin with? C, Python, or Java? I wanna lay a good foundation for the future. Maybe it doesn't matter which language to start with? Would you mind giving me advice? or a bit of learning source recommend? book is best, I love reading: ) THX! sry I'm a little rambling, I just haven't talked to anyone in a long time: )
Netrunner · 2022-02-14 06:21
>>30115 >GADMDD Generalized anxiety disorder (GAD) and major depressive disorder (MDD). thanks google. >Behrouz Forouzan's Foundations of Computer Science why? where did you find it? >what type of language should I begin with? depends on your level of interest, if you are discouraged easily, go with a language that gives instant results go with a high level language, if you aren't discouraged and understand you won't make anything interesting for a while then go with something low level. JavaScript is the most instant results you can get. >job about these in the future probably easiest to get a web dev job. if a job is primary goal do freecodecamp.org >proper foundation not that important, you will correct wrong foundations as you learn and figure stuff out.
Lady Jessica · 2022-02-14 13:29
I've set up my jellyfin server correctly, everything is working as it should. I'm a completely noob when it comes to self hosting, but I've managed to do it following pimylifeup's tutorial. However, I'd like to set up a reverse proxy, so I can listen to my songs outside my local network. Does anyone know where I can find a tutorial for this? I'm using apache 2.
東方算法騎士団 · 2022-02-14 20:42
>>30116 Thank you! You are so kind! my apologies I didn't realize these aren't common words. >Behrouz Forouzan's Foundations of Computer Science I searched the topic on Quora&Stackoverflow and found it. Thank you for your answer, I'll try C first, if it's too difficult for me, I'll change to Javascript. good luck, good health!
Demeere · 2022-02-14 20:49
Trying to learn computer security, cybersecurity, internet security and all that jazz. Though my only experience with computers are some silly personal programming projects. Most of which were just working on pre-existing APIs. How do I go about learning security?
dup · 2022-02-18 01:28
I remember seeing some project to retypeset either SICP or K&R in LaTeX with hyperlinks and so on. It was hosted on github, and since both github and any search engine that indexes it are useless, I can't find it -- does anyone know what I'm talking about?
Fred Nurk · 2022-02-18 07:55
>>30155 https://github.com/sarabander/sicp-pdf comes to mind, but I don't know if it's the one you thought of.
Bob Arctor · 2022-02-18 09:40
>>30155 There was a project hosted on github called “The C Programming Language Unauthorized Edition” but I could not find it anymore. I have downloaded an early version of the book, however. Here it is.
Yuki Nagato · 2022-02-18 16:44
>>30040 >just found out about this chan >it's so unbelievably good Not true, this imageboard has the same kind of liars, dishonest drama instigators and fakers who don't actually program as any other.
Motoko Kusanagi · 2022-02-18 17:08
>>30172 But more importantly it does have at least a few people that do actually program a bit.
Terzibashjian · 2022-02-22 01:07
I'm attempting the following task in sed: >search for "#.*egg=(something)" >search for "@(that_something)[^0-9]*(something_else)#" >replace the underscores in (something_else) with dots >print "(something)==(something_else_dotted)" the following command gets the job done, but makes my eyes bleed a bit:sed -i requirements.txt -e 'h;s/.*#.*egg=\([^&]*\).*/\1\n/;G;s/^\(.*\)\n\(.*\)\n\(.*@\1[^0-9]*\([^#]*\).*\)/\4\n\1\n\3/;:l;s/^\([^n]*\)_/\1./;tl;s/\(.*\)\n\(.*\)\n\(.*\)/\2==\1/' Is this something sed natively supports, or should I look into other tools? (This would be trivial if "egg=" occurred before the "@" symbol...)
x<->y · 2022-02-22 01:17
>>30209 For lines that aren't matched (i.e. don't contain any "#.*egg=(something)"), they do and should pass through unmodified
null · 2022-02-22 12:05
The following function reads a line from stdin and then it sets the value of buf to description and the length of the string. I don't understand why after setting the value, if I free the original string then description stores garbage. void read_line(FILE *fstream, char **description, int *length) { int default_size = 32; int index = 0; int i = 0; char c; char *buf = malloc(default_size); while (1) { if (index == default_size) { i++; char *tmpbuf = realloc(buf, default_size * i); if (tmpbuf) { buf = tmpbuf; free(tmpbuf); } } c = getc(fstream); if (c == '\n' || c == EOF) { buf[index++] = '\0'; break; } buf[index++] = c; } if ((c == '\n' || c == EOF) && index == 1) { free(buf); return; } *description = buf; // If I free the variable buf right here, after the asignment, why does description store garbage instead of the string? // free(buf); *length = index - 1; return; }
Turing · 2022-02-22 12:50
>>30214 Because it's pointing to a null pointer after free(). You should use strcpy() to copy the string. Or better yet just return buf instead of doing operations on function parameters. Change the function return type to char * and use strlen() whenever you need length of that string instead of altering another parameter.
Torvalds · 2022-02-22 12:51
>>30214 I would assume because when you free buf, it is getting over written so points to garbage. Or the virtual memory changes or something. I don't know enough to be honest, but accessing freed memory is generally considered bad.
DEBUG-CONTENTS · 2022-02-22 13:13
>>30216 >accessing freed memory is generally considered bad It's undefined behaviour, and can crash your system, or worse, allow someone to hack into it. >>30214 The issue is that you are using free on the buffer after reallocating it and assigning it to buf. The free is unnecessary, remove that and it should fix your problem.
Yet Another Lainon · 2022-02-23 05:39
>>30040 This place is full of hobbyists and or posers, don't take everything here so seriously, it will probably do more bad than good. Don't be deceived though, I'm sure that there's at least some professionals that lurk around here, and there's certainly SOME good advice, because frankly, even a broken clock is right twice a day isn't it?
Iverson · 2022-02-25 06:47
>>30115 >how to learn to program you should learn lua (read programming in lua), ruby (read the "pickaxe book") or scheme (read Simply Scheme) first. lua and scheme are simple languages. Don't learn javascript, java/C#, C++ or python as your first language. They are overly complicated languages. JavaScript is a clusterfuck, java/c# teach you OOP and they do it the bad way, C++ is a huge mess and python is a ghetto language (ruby is a better version of python with sensible OOP features).
Unnamed · 2022-02-27 23:21
>>30256 the cluster fuarrrk features of most languages can be avoided. I guess as a beginner it might be hard to know what is what though. like Object oriented features can be completely ignored as a beginner.
Y.T · 2022-02-28 18:53
What's one good book or course that can teach me the fundamentals of programming/comp sci from novice to a decent level? A resource that by the end of it will have given me the knowledge to know where to look next for anything I want to pursue. I've yet to come across a definitive answer to this request.
Naomi Nascimento · 2022-03-01 02:32
>>26849 >>26847 Retarded, just use int* x; x=&a; C is not stupid in any way, the people who misinterpret it are.
Tequila · 2022-03-01 04:51
I'm curious, not as a professional programmer, just someone who builds casual scrip>>26173 ts for fun and personal use using Python, is learning Flutter and Dart, the simplest and obvious way to make a cross-platform software? I own an iPad, some Android devices, some Linux and Windows boxes, a car with Android Auto, etc. Is it worth the time and effort, or does it lack a future?
word · 2022-03-01 20:32
>>26847 >>26875 >>26849 >>26871 >>30282 Also, the 2nd way of using it also makes sense, it defines a pointer x with the value being pointed to as int, or in other words an int pointer or int*. int *x Declares that the part of memory being pointed to by the pointer x is an int x is declared automatically as a side effect of that declaration
Elliot Alderson · 2022-03-02 17:02
How do I come up with a study schedule? I have some things in mind already but I'm wondering how to distribute them and how many hours a day to have as a goal (and how to scale it with time). For reference, currently I'm basically not studying, my habits are truly awful. I thought about starting with 2 to 3 dedicated hours each day and then distribute it among the subjects I need, maybe adding a day or two of random subjects so it doesn't feel too robotic, and after 2 or 3 weeks of hitting those 2 to 3 daily hours I'll increase it to 4, which I'll then stick to for a month before increasing further (to a maximum of 6, I'm thinking of only going beyond that if I can keep up 4 or 5 for a year). A major part of it is also dropping harmful hobbies, replacing it with stuff like the many books I have lying around waiting to be read, that would be outside the study hours but still something I need to put effort into.
Hiro Protagonist · 2022-03-03 11:08
>>30297 I've never set up a schedule as ambitious as that for myself, but here goes my input. The key to successful self-study, in my view, is managing motivation in the early stage. Once you've built up a habit of studying, it's a smooth ride, so all you have to do is avoid burning out before that. The two easiest ways to burn out are overstraining yourself and losing sight of your progress. About the first (overstraining yourself), I think you're on the right track with your plan to start out small and increase your studying time progressively, but you may want to consider a goal-based approach, rather than time-based. I would do this: for the first day, set as my goal to read the introductory chapter of my book of choice. I'm talking about that chapter that doesn't dive into the matter yet, but explains what sorts of skills the book's going to teach you and how it's arranged. At the end of it, I should be full of motivation to learn the subject, so I stop. If I dive in then, my motivation will clash against the size of the task and dissipate into nothing, so instead I take a quick overview of the first chapter I want to study and pick a portion of it to be my next day's goal. This for each of the 1-3 subjects I'm most interested in. The key, you see, is to set yourself up for success, so that every day is a victory. The second (losing sight of your progress) is related to the fact that we perceive things proportionally. The first few things you learn about any topic will feel massive to you, because you compare them to complete ignorance, but, as you progress, each new bit of knowledge will feel smaller than the last. To make matters worse, we don't accurately remember what we knew at any given time, so when looking back we tend to assume we knew about as much as now. Our very memories erase all record of our progress! I guess keeping around your answers to exercises (with date) can help, but the best is to frequently put your knowledge into practice by doing things that you damn sure couldn't do before.
null · 2022-03-03 17:20
>>30297 you're going to me miserable if your forcing yourself to do things you don't actually like. Why do you have so many books, why those books? For some it's because they are pretentious, they want to read the classics for street cred and know as the smart guy. That's a wrong reason to read a book. Language learning is another one, why do you want to learn French? So you can say you know another language? I see it as 2 ways, you either learn by pure passion, where it's just so interesting you don't find it hard to do, never bored, etc., or you are forced to by some life situation, school, threat of homelessness, job, etc. since you don't actually seem interested in lots of your things, try putting yourself in a situation where you suffer negative immediate consequences for not learning.
Lukasiewicz · 2022-03-07 13:04
>brooo why should i learn something HELP HELP IM HAVING A CRISIS >"passion" kek why do they always make this post?
Mentat · 2022-03-09 12:32
>>30305 With an attention span as bad as mine simply reading the introductory chapter can be a hassle, though. The first chapter can easily be at least 50 pages of superficial information, then I get bored fast and can't keep paying attention enough to see it through. Evidently that means I won't go ahead with the rest of the book since I didn't even finish the first step. That's a constant source of frustration for me. >The key, you see, is to set yourself up for success, so that every day is a victory. That makes sense, though I can't help but think it's not possible to keep that forever, you can't win everyday so it's best to learn how to deal with failure and having a healthy mindset to help you cope with not being as good as you wished. That's all theoretical though, I haven't put it into practice (as you can probably tell). > guess keeping around your answers to exercises (with date) can help, I've tried that in the past and since I ended up dropping the book or whatever else it just made me feel like soykaf when I stumbled across it in the future and thought about the wasted time :/ >>30307 >. Why do you have so many books, why those books? For some it's because they are pretentious, they want to read the classics for street cred and know as the smart guy. That's a wrong reason to read a book. lol what? I never said I don't want to read those books, I got them for a reason, and it's not like they're stored out on the street with an outdoor above them telling the world those are my books. I just have bad habits and a soykafty attention span, I want to read them but then I get tired or distracted. >inb4 that means you don't like them What is the sign that I do like something, then? Video games and movies bore me to death these days, for example, so I wonder if you think that liking something means you'll be pumped full of energy 24/7 and blaze through books. >Language learning is another one, why do you want to learn French? So you can say you know another language? I think you're puting too much effort into assuming things about me. >pure passion "Passion" doesn't last forever, it's like trying to base a long lasting marriage on being horny.
John Doe · 2022-03-12 05:02
Is there an expression for execute while once more if condition is true?
Clasp of Clarity · 2022-03-12 05:44
>>30389 https://www.lua.org/pil/4.3.2.html ?
Sipho Nkosi · 2022-03-13 23:57
>>26374 Lmao what bullshit, or USA is really nonsense, no wonder your young folks are in debt all because of bo-1mer validation, but you're joking, right?
XERXES · 2022-03-17 17:38
Any tricks for being more effective at reading books in digital formats? Getting an increased attention span and things like that. I've been thinking about getting a treadmill so I get off the chair and walk while using the computer as a way to stave off sleepiness.
Gyula Kovacs · 2022-03-17 17:53
>>30403 >Lmao what bullshit, No, it's not. It's hard t o get hired without a degree. >>30438 Take a lot of breaks and do many study sessions.
Faye Valentine · 2022-03-17 18:07
>>30439 If I take breaks as long as my attention slips I'll never get into a flow state (which is rare but great when it happens). Taking breaks every 15min or so seems too much, not to mention I risk spending too much time on what was only supposed to be an interval. By the way, what do you do on breaks? I try getting away from the computer but I've gotten tired of my guitar and books need larger time slots, not to mention it would be nice to do something other than reading when I'm taking a break from reading a textbook or something of the sort.
Church · 2022-03-17 18:44
>>30440 >By the way, what do you do on breaks? Walk around the house and brew more coffee/tea. Sometimes I also watch a video on YT (or listen to music), play 1-2 level(s) of Doom/Duke3D/Blood or quickly check imageboards. I usually take a break every time I can't concentrate fully (which means at least one break every 30-40 minutes).
setq · 2022-03-17 19:06
>>30441 And how much time do you spend on each break? Something like 15 minutes? >brew more coffee/tea Unfortunately I'm pretty sensitive to caffeine so I can't drink it much. And if I drank too much tea I would be using at least 5 bags a day and that can get costly.
Jim Hilger · 2022-03-17 20:31
>>30442 I buy bulk black tea. Pretty cheap, like 20usd/lb. More control if you want a bigger / smaller cup. Good stuff.
quote · 2022-03-19 20:48
How would you learn programming if you could start from scratch, lain? What's the most efficient route to understanding what the computer does and how to manipulate it through code?
cond · 2022-03-22 15:50
>>30442 >And how much time do you spend on each break? Something like 15 minutes? Around usually around 15-20 mins (but it can be 30 mins or even more if I get stuck). I recommend you experiment and see what works for you (use the Pomodoro Technique as a basis and modify it to suit your personal needs) >>30455 For maximum enjoyment, you want to install GNU/Linux if you don't use it already (I really wish I would have dual-booted windows and linux sooner). I recommend you install Debian. Visit >>>/Ω/52003 for other options. You also might want to visit the desktop threads: >>>/Ω/57666 & >>>/vis/2959 > https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current/amd64/iso-cd/ You can also use a distro called SystemRescueCD and a program called gparted to do the partitioning (shrink the windows partition): https://www.system-rescue.org/ If you are on windows, use Rufus for creating the installation media (= a flash drive that can be used to install GNU/Linux): https://rufus.ie/en/ Another option is to use a VM: https://www.virtualbox.org/ You can also use PowersHell to check the iso checksum: Get-FileHash distro.iso -Algorithm SHA256 If you are new to GNU/Linux, I recommend you read The Linux Command Line book: https://linuxcommand.org/tlcl.php and learn to use NeoVim or Gnu Emacs (they both have a build-in tutorial) but start with nano editor. >How would you learn programming if you could start from scratch, lain? Just start as soon as possible. Write & test all example programs and do all exercises. Then start modifying the examples and writing your own little programs. >What's the most efficient route to understanding what the computer does and how to manipulate it through code? If you want to understand how a computer operates, I suggest you read Programming from the Ground Up https://savannah.nongnu.org/projects/pgubook (it was designed for this purpose) You might want to visit the C thread after finishing the Programming from the Ground Up book: >>29649 There are also other options... Another options is to learn Scheme. Scheme is a high-level language that is simple and minimal. It has been designed for research and teaching purposes. >Simply Scheme (full text: https://people.eecs.berkeley.edu/~bh/ss-toc2.html) >The Little Schemer (https://mitpress.mit.edu/books/little-schemer-fourth-edition use libgen or buy it) >SICP (full text: https://mitpress.mit.edu/sites/default/files/sicp/index.html) (lectures: https://www.youtube.com/watch?v=-J_xL4IGhJA&list=PLE18841CABEA24090&index=1) Do not start with SICP! Instead, it's better to return to this at some point after you have learned how to program. SICP is pretty hard book. Simply Scheme and The Little Schemer are suitable for beginners. The Little Schemer is useful book even if you can program in another language. Also visit the Lisp thread >>27327 and use Guile or Chicken Scheme implementation. These both approaches work. You can actually pick both, if you want (highly recommended if you have the time). If don't know which to pick, let me ask: Do you want immediate results? If yes, then go with Scheme.
Ein · 2022-03-24 06:01
What is a good example of language you can create compiler using bison/flex combination that you cannot using ANTLR and vice versa?
cond · 2022-03-24 12:46
Is there anything other than usage of proprietary libraries and APIs like DirectX that impede portability between operating systems when compiling from source code?
if · 2022-03-24 13:52
>>30533 compiler support, macos making it difficult to avoid having to wrap code around objective-c, macos lagging behind in opengl version support or lacking vulkan support, should avoid using ambiguous data types like long as opposed to int32_t, windows c runtime library support across different windows versions being a pain so you should always either include these DLL files or statically link them (tdm-gcc as opposed to mingw statically links the runtime library into your program by default ensuring all the way down to winxp compatibility)
Crazy Jake · 2022-03-24 14:50
>>30499 >SICP is pretty hard book I think SICP assumes that you have a significant math background. I've been re-reading the first chapter for a few years now and there are still some things that I have questions about because I don't understand all the math yet. Only now have I felt secure enough to get into the second chapter, and I can do maybe 70% of the exercises unassisted so far. It does get easier, at least slightly, the more you get into it, but you're right in that it's a pretty bad place to start and I regret not trying more CS books or watching the lectures. **Hell, it's the ONLY CS book I've tried.**
Unknown · 2022-03-26 07:15
>>30537 It's better if you do, of course, but you don't need to fully understand the maths to appreciate the software development principles the authors are trying to convey.
Technician · 2022-03-27 13:08
>>30499 Thanks for all the resources on where to start. I've encountered all of them except PGU on my frantic search across the web to find the best place to start. I've looked at OSSU, teachyourselfcs and a thousand other books, courses and websites in each and every direction. I've read hackernews articles and quora questions on the best way to start programming. Dozens of hours just looking for a place to start, and still I'm not sure on anything. Something's always not right in my mind, a nagging feeling that the studies presented are missing something crucial, that it could always be better. I think it's because I'm not sure what I want out of CS, I just know that for some reason unbeknownst to me I'm drawn to it. It's funny, had I stuck with the first python tutorial on the youtube search results I would be miles ahead of where I am now, but I don't know if that would be better than spending weeks meticulously deciding the best place to start. Maybe cause I'm a dabbler, maybe I'm just lazy, maybe I'm anxious about the idea of studying a vastly complicated and relevant topic outside of an institution. Maybe I don't even like programs, I'd have no way of knowing. Guess I'll have to bite the bullet and start programming to find out.
HELIOS · 2022-03-30 15:57
Can I get a brief explanation of the mathematical justification for Hamming's (7,4) error correcting code? The reasoning is that if r is the number of data bits, n is r plus a quantity of parity bits to ensure error correction, and k = n - r, then 2^k > n. I sort of get it up to this point. What I don't understand is that the author multiplies each side by 2^r (which is the number of possible words) and divides by n + 1 (which I think is the number of single-bit errors plus the possibility there is no error,) arriving at the inequality 2^r < 2^n/n, which is supposedly the secret sauce even though the former seems to be enough. The transformation from inequality to inequality doesn't make sense to me either, I don't see how it can be simplified beyond (2^n)/(n+1)>(2^r)n/(n+1). Source: https://web.archive.org/web/20071030202435/http://www.cs.mcgill.ca/~smroso/hamming.html#ste
Junichi Fujiwara · 2022-03-30 17:03
>>30589 That n+1 may be a typo or possibly the author just took a longer route to reach the result than they needed to. Here is how I would do it Because `k = n - r` also means `r = n - k` and `n = k + r` you can rewrite the starting formula like by substituting n-r for k and using laws of exponents: `2^k > n` is `2^(n-r) > n` is `2^n * 2^(-r) > n` is `(2^n)/(2^r) > n` Multiply by 2^r to get `2^n > 2^r * n` then divide by n to get `(2^n)/n > 2^r`.
Hagbard Celine · 2022-03-30 17:09
>>30590 >Because `k = n - r` also means `r = n - k` and `n = k + r` Sorry didn't mean to include that whole line in the reply, just the `k = n - r` is enough. Had written that while I was working through it, forgot to delete.
Agent Smith · 2022-03-31 08:10
I have never worked but am really enjoying learning about operating systems and networks, which jobs dealing with that would you say can be held remotely? Dev positions or just programming-heavy jobs seem like a hamster wheel, as if you're always chasing trends (don't confuse that with a criticism for learning, it's just that I prefer learning concepts over spending 10 hours looking at an IDE). I was going to post this in the employment thread but it hit reply limit.
Lain Iwakura · 2022-03-31 08:26
>>30593 network engineer expand on what you mean by operating systems; writing them? installing them?
Hiro Protagonist · 2022-03-31 09:07
>>30594 I have enjoyed reading the books about it by Silberchatz and Tanenbaum as well as exploring (the little I did so far) Linux. Wouldn't network engineer have more to do with the infrastructure of a server or something like that? From my limited experience I get the impression I'm not so fond of the more "trade-y" part of dealing with cables and whatnot, instead preferring the stuff from the network layers above that (and "physical stuff" would make it impossible for the job to be remote anyway).
Random · 2022-03-31 14:07
Python as a first language seems to be very accepted among academic institutions but comes across as controversial in more "underground" tech-orientated forums on the Internet. What do you think about Python for complete beginners?
Terzibashjian · 2022-03-31 14:24
>>30597 You need to understand the perspective of each crowd: unis that opt for that (keep in mind it's not all unis) just want you to start coding right away and to simplify your life, while the reason it gets a somewhat bad rep in "underground tech-oriented forums" is because it abstracts so much stuff away that'll you end up learning very little compared to other languages, prominently C. The only thing that will be asked of you will be basic logic, the kind a high schooler could go through, so you won't have to learn about how computers, languages and other stuff work. The end result being that if you ever need that extra knowledge in the future it'll be harder on you since you'll likely be set on you ways, add to it that those who bother thinking critically about stuff like modern webdev realize there's a bunch of retarded soykaf being done because modern Indian tier devs don't care about performance or anything like that. Companies profit more if they can pay less since devs are less qualified and offer is higher, but software in general gets worse and worse (and if necessary companies will just charge more for it, kinda like Apple keeps finding excuses to charge for stupid soykaf).
Dox · 2022-04-02 00:27
I'm not a beginner, and that much less is a doubt, but I suggest that moderators format the themes by putting the following line of code for the catalog, and formatting it in a way that matches their respective themes, as they currently have an error where selected, the catalog threads have the Yotsuba-Blue theme background. Line in question: .theme-catalog div.grid-size-small:hover{
Jens Hansen · 2022-04-08 10:23
Hello, lainons. I've been approved for internship at a company for working on embedded software and secure software. They want me to learn openssh, yocto and the boot process (especially secure boot and the cryptography involved in it) for a project they want me to join in. I'm asking for resources and books about those two last topics (yocto and secure boot), I could find good resources on OpenSSH. Has anyone here worked with yocto? How is it? Any recommendations for a friend new to it? As far as I could understand, it is a system for building embedded Linux kernels on demand, or something like that. I use OpenBSD as daily driver, so I'll probably have to install a GNU/Linux distro in my computer for working with it. Btw, I'm posting it here rather than on the Programming Employment thread because it has reached 300 posts.
Bin Ary · 2022-04-10 09:47
I'm currently learning about binary representation of floating-point numbers and I have a question regarding the number of bits used fo the exponent and for the fraction. Suppose we have a 16-bit number (half-precision). According to IEEE 754-2008 standard we use 1 bit for the sign, 5 bits for the exponent and remaining 10 bits for the fraction. This gives us the following range of exponents: -15 ... 16. When the exponent becomes equal to the number of fraction bits we lose the ability to represent fractions at all. For example: 0 11001 0000000000 = 1024 0 11001 0000000001 = 1025 And when the exponent is greater than the number of fraction bits, some numbers can't be represented at all. For example: 0 11010 0000000000 = 2048 0 11010 0000000001 = 2050 I understand that as exponent grows, precision decreases. So why don't we use 4 bits for the exponent and 11 bits for the fraction? Is it because the maximum number we could represent would be approximately 511 in decimal and that is too low for 16 bits of information?
stack · 2022-04-10 18:36
Two things. First thing. I'm going to be switching from Windows 8.1 to Gentoo. Big step, maybe too big, but I'm absolutely committed. Only thing I'm really doing right now is reading the Gentoo handbook and The Linux Command Line. If there's anything else that's crucial to a new Linux user, I would very much like to know. Second thing. What are some good resources for computer science journals? I'm trying to be more of an academic now but I don't really know where to start and figured I could get my feet wet with a monthly release since that's topical. The Lain Zines are a nice start.
x<->y · 2022-04-10 19:04
>>30710 >Gentoo Don't use layman for managing overlays because layman is deprecated. Use eselect-repository instead. Other tips: https://pst.moe/paste/tffizn (a huge pasta that is under construction, again...)
Tomohisa "Tom" Kanezaki · 2022-04-11 14:44
I have a hard time concentrating on reading textbook pdfs but physical copies are too expensive, and of course I'm aware that concentrating on reading pdfs is an useful skill since I imagine I will be doing that all the time when I start working. Any attention span related tips?
Meddler · 2022-04-11 15:41
>>30720 Take notes into notebook - the paper one.
roll · 2022-04-11 15:47
>>30721 I tried that in the past but then there's a subtle balance to avoid taking too many notes and end up taking many times what it usually would to read the book.
t · 2022-04-11 16:11
>>30720 >Any attention span related tips? Read often but less at per a session. Have a lot of short breaks. If the material is hard, write your own notes after you have read the chapter/section.
overriding · 2022-04-12 19:09
>>30720 Go to the library. If they don't have a book, request it. While you're there, try out an e-reader, and if it works, buy one yourself and pirate all of the books.
Lady Jessica · 2022-04-13 00:02
Could any of you help me with a CSS question? I need to make the font of a theme like the related pic, but I can't. The most I could do was the code below, and it makes the letters too thin. From here on out, I'm stuck and don't know how to proceed. body{ font-family: "MS Pゴシック", "MS PGothic", "Mona", "IPA モナー Pゴシック", "IPAMonaPGothic", "Monapo",sans-serif!important; font-size: 12pt !important; }
Anonymous · 2022-04-13 21:17
Is there any way to make vim append only the new lines added to the end of a file instead of rewriting the whole file from scratch?
Sabo Engle · 2022-04-14 06:27
>>30759 Maybe not Vim, but you could type "[ur data] >> [ur destination file]" in the terminal. It'll append the data at the End of the file.
Pris · 2022-04-14 23:41
>>30749 Please, help-me...
Wirth · 2022-04-15 00:22
>>30779 >like picrel Too vague, not sure what you want. You might be looking for letter-spacing but I'm not sure.
Jane Doe · 2022-04-15 06:40
>>30749 >>30779 pls use code tags. try these links: https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts https://developer.mozilla.org/en-US/docs/Web/CSS/font >>30783 also this.
Agent Jones · 2022-04-15 06:53
>>30720 If you're at a desktop, physical unplug your ethernet cable, at least to start.
Jet Black · 2022-04-19 04:25
is it possible to buy/rent a website domain name without doxing yourself? whois shows the owner right? so doesn''t that mean everyone who registers a domain name doxes themselves?
t · 2022-04-19 06:57
>>30845 there are privacy protecting domain registrars. not my expertise but i believe gandi is one of them
Otto Normalverbraucher · 2022-04-19 08:23
>>30845 A lot of hosts provide a service where they'll register the dns but give you ownership, so when someone whoises the domain, they just see whoisguard info. njalla is another one that is more privacy focused and founded by former pirate bay alum, but I've never personally used it. Social engineering of these services can still allow people to dox you but it's more effort.
progn · 2022-04-20 07:08
>>30845 Even though namesilo for example gives WHOIS privacy I still gave a fake name and address and had no issue.
Y.T · 2022-04-21 18:23
>>30848 Plenty of registrars offer whois privacy, but it just hide the whois information from the public. The registrar still has that information and will disclose it when needed. That include people sending emails pretending to be law enforcement. >>30863 I don't have any experience doing this personally, but their terms of service typically say that if the registrar can't verify your information you'll lose the domain name.
DEBUG-CONTENTS · 2022-04-24 16:06
Anons, I use windows 7 x32 and just downloaded the corresponding version of Tor. The problem is that this soykaf doesn't want to open at all. I searched everything, even their website, and no answers. Could please enlighten me? It downloaded and installed correctly, but comes time to use it, it won't open. I click, the PC loads a little, and then acts as if nothing happened. Even running it as an administrator doesn't work. I'M MAD. Please, help me...
Dox · 2022-04-25 06:05
>>30936 Use linux No, seriously, you can't expect lainons to know about wondows
SHODAN · 2022-04-25 07:35
So I'm really interested in reverse engineering and explotation. I started reading about how I should start out, and from what I've read, learning about C and Assembly is the first thing I should do. I already have a little programming knowledge from the classes I've taken so far in college, so I decided to read K&R C as a primer. I also was looking into the Hacking: The Art of Exploitation, 2nd Edition once I finish learning the basics of C. Would you say this is a good start?
Roger Pollack · 2022-04-25 07:47
>>30946 >Would you say this is a good start? Yes. But note that K&R is written for programmers (the chapter 1 is harder than the rest of the book). Second, K&R is outdated because it won't teach you which stdlib functions are insecure. I recommend you read C Programming: a modern approach (http://knking.com/books/c2/) after reading K&R. You can find other good C resources at https://www.iso-9899.info/wiki/Main_Page For reverse engineering, I recommend you read Reversing: Secrets of Reverse Engineering after Hacking: The Art of Exploitation, 2nd Edition. Actually, you can read Hacking: The Art of Exploitation before you read C Programming: a modern approach if you want to. When you are learning/programming in C, make sure to enable errors: -Wall -Wextra -std=c99
Aristóteles Amadópulus · 2022-04-25 08:23
>>30948 Thanks for the information lainanon. If K&R has outdated concepts, do you think I should just reject it altogether? Why do people still recommend this book?
Nobody important · 2022-04-25 08:34
>>30950 >Why do people still recommend this book? Mainly because it's a classic and concise. It contains some interesting example programs. >do you think I should just reject it altogether? In my honest opinion, C Programming: a modern approach and C primer Plus are better than K&R.
Neo · 2022-04-25 09:14
>>30945 I plan to get a new PC soon and will use linux, but right now my current PC works absolutely nothing out of the ordinary. I think it's over for me with this machine.
Wirth · 2022-04-25 10:47
Hey bros, how do I make a 4 channel PNG file and fill it with alpha pixels in C with libpng?
Knuth · 2022-04-25 16:05
>>30953 libpng requires rocket science degree, just use a simpler library like https://lodev.org/lodepng/ / https://github.com/lvandeve/lodepng or https://www.nayuki.io/page/tiny-png-output , read the encoder usage/examples
Hitomi · 2022-04-28 07:14
I had an idea for a personal project, the first ever (way too late in my CS-career). Could someone please point me towards best practice as I don't want to ruin it from the getgo? How do I go about it well enough to actually finish it? It'll be written in pdf and involve pdfs.
Cutter · 2022-04-28 07:34
>>30982 Plan, keep a journal and record useful/interesting quotes and ideas there, start early and work on it often, use git/fossil so you can revert changes easily.
Undisclosed · 2022-04-28 08:01
>>30982 I meant to say that it'll be written in python. >>30984 going to buy a notebook now.
HELIOS · 2022-05-01 17:31
>>30985 You have a couple of options: a) use a python .pdf generation/editing library b) use another format that can be programmatically converted to pdf
Fred Nurk · 2022-05-02 13:36
What do you guys think of this guide? I'm finishing CS50 and I'm unsure if I should keep following the guide or try the Scheme path from this post >>30499. I've messed with Scheme before and found it quite comfortable to work with, but I also really liked C. What are your thoughts?
null · 2022-05-04 10:09
>>31033 what's your objective? did you read that disclaimer at the bottom left? >These books here should be read with a defined aim in mind, they are not books for casual reading and might require heavier math. Don't bother unless you have a reason to. >If you came this far, you are already a better programmer than a lot of people in the market. the "market" doesn't care if you read "The Pragmatic Programmer", they care about what's outlined in >>30974
Undisclosed · 2022-05-04 13:36
>>31056 >what's your objective? I want to have a solid programming foundation. >did you read that disclaimer at the bottom left? Yes, and it doesn't apply to me yet. Those disclaimers you quoted refer to the books at the fourth layer, I'm not even in the first one. I'm in the end of CS50, the course reccomended as a programming logic intro in the top-left corner.
array · 2022-05-05 10:20
I have a unique issue here i've never had to face before: I just installed artix on a laptop, this laptop has a dead battery so I have to keep it plugged into the wall for it to work. Problem being the power cord is likely to fall it very easily, so I'm going to tape it later and all that but it is going to fall out one way or another. QUESTION, what are some maybe fs options I can enable (ext4) or other things to minimize the loss of data?
nil · 2022-05-05 10:29
>>26830 Try the following in your terminal Think about what a tuple is Why does the following print two different things? What is %r? One last thing I think your book might be kind of old. I don't see print without parentheses very often, are you learning Python 2? There are also many ways to format strings in python. I normally only use f strings or template literals, not formatters. print (1, 2, 3, 4) print % (1, 2, 3, 4) # why are these printed differently? print (1, 2, 3, 4) print '%r %r' % (1, 2) # why is this printed differently than the following? formatter2 = '%r %r' % (1, 2)
Y.T · 2022-05-05 10:57
When can I start using AI and doing things like natural language processing? How much mathematics is required to do it with any amount of efficacy? Any book recommendations? Any recommendations for web scraping projects generally?
Six · 2022-05-05 11:51
>>31065 >When can I start using AI and doing things like natural language processing? Whenever you want. >How much mathematics is required to do it with any amount of efficacy? With any? Any!
Nobody special · 2022-05-06 09:05
>>31065 Read Artificial Intelligence: A Modern Approach by Norvig et al. Here is a book about deep learning: https://www.deeplearningbook.org/ If you want to learn classical AI in Common Lisp, read Paradigms of Artificial Intelligence Programming by Norvig. If you want to use a lisp for AI, visit the lisp thread >>27327 You can find good resources for learning Common Lisp and other lisp dialects there. Most importantly: https://gigamonkeys.com/book/ >https://github.com/norvig/paip-lisp >How much mathematics is required to do it with any amount of efficacy? I image you need to know at least high school math + linear algebra + probability/statistics. >Any recommendations for web scraping projects generally? https://automatetheboringstuff.com/
chadols · 2022-05-07 13:23
How are protocols, like HTTP, BitTorrent, FTP, created?
Apoc · 2022-05-07 13:49
>>31111 https://en.wikipedia.org/wiki/Communication_protocol Yes, wikipedia. It is like kicking dead whales down the beach, yeah, but it helps to give you a basic idea of something(as long as it's not anything political, to which you should avoid wikipedia).
Hououin Kyouma · 2022-05-07 13:57
>>31111 They are created to reach a goal. HTTP was created to support the World Wide Web, BitTorrent was created to allow the distribution of large amounts of data, and over 50 years ago FTP was created as a protocol to transfer files.
if · 2022-05-08 19:14
Trying to build an inverted index for very basic title full text search. Just need basic set operations, but I'm not really sure what datastructure makes sense. Basically for every document with the word, say "the": I need to store every document id that contains that word. If the search has other words, I'd just do the intersection of all these documents. I thought about a giant bitmap, but sparse ones could be really space wasteful? Like if I had a million documents... etc. Basic compression seems like it would overcomplicate it. If I did simple array of 64bit values, if I didn't prune common words like the, how do I handle millions of 64b numbers in the "the" index? I feel like every answer I come to is just going to overcomplicate the soykaf out of everything and its pissing me off.
Batou · 2022-05-09 13:08
how do softphones work? what technology do they use to call landline cell phone numbers over the internet? what are some good resources to read to learn up on this stuff? just curious, might be fun side project potential.
Lunch · 2022-05-09 15:15
>>31132 you don't have to use the same representation technique for every word. you could have, for every word, a single bit that tells you whether it's a sparse or common word and use the most appropriate representation try looking at your data and optimize for the common values example: if you have a list of values and they're all very close to each other, don't store each value as 64 bit. instead store the difference from the previous value in 7 bits. reserve the last bit to indicate "the value doesn't fit in 7 bits, the next 64 bits are a single value". in this case sorting the values first might be a good idea, so you avoid having negative values
Acid Burn · 2022-05-10 07:46
Hey lain. I got a C question. I have this function here. function(unsigned char ctrl_flag) and in the sample that i'm toying with, they pass this onto the parameter. C function(0x80 | 0x00 | 0x00 | 0x02 | 0x01); I'm not familiar with bit operations. Any idea what happens in this case? My guess is that they are probably added together.
Hououin Kyouma · 2022-05-10 08:01
>>31146 It's a bitwise or operator (https://en.wikipedia.org/wiki/Bitwise_operation#OR). 0x80 = 0b10000000 0x00 = 0b00000000 0x00 = 0b00000000 0x02 = 0b00000010 0x01 = 0b00000001 -------------------------- 0x83 = 0b10000011 a | b is 1 if any of a or b is a 1. That operation is applied for each bit position. You will have to learn it on your own to understand what's really happening. You can find more bit hacks at https://lainchan.org/%CE%BB/res/30870.html