lainchan / λ
The Beginner's General
λx.x · 2020-11-23 23:36
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.
Trinity · 2020-11-25 15:08
Does learning more theoretical stuff like category theory impact your programming skills? Or is it simply a matter of having a deeper understanding of computing in general?
I ask because I'm curious about it but there's only so much time to do things, often some things need to take a back seat in favor of more practical ones that might be of use at a job, unfortunately.
Drifter · 2020-11-25 18:30
>>22528
When learning how to program, you should always try to learn the most general skill possible. After you get the big picture, the more specific stuff gets easier to grok.
renames · 2020-11-25 18:44
>>22528
>>22530
It depends. Learning more general theory tends to pay off in the longer term, when you're capable of drawing associations between things.
I'd say it's best to learn how to do basic things on your system, then to learn some theory while continuing to mess with things. Because learning things without being able to apply/practice them doesn't lend itself well to retention.
Anamika · 2020-11-25 20:13
>>22528
The first thing you want to learn as a programmer is to "make something that works". After that point you can learn how to "make it go fast". Sometimes if you have a very deep understanding of your runtime environment, you can know ahead of time how to make something go fast before making it work. The third skill which every programmer needs to know is how to "make something quickly". I don't know how to program more quickly; I think that is just something that will come to you eventually as you get more experience.
x<->y · 2020-11-26 00:45
>>22528
In any discipline there is a need to learn stuff that's just on the next level of abstraction than you're currently working. To draw an analogy: a chemist would do very well in learning some rudiments on the physics of particles, though he might never need more esoterics like QM. A biologist, otoh, needs to know some chemistry but not particle physics. And an ecologist needs less chemistry than the biologist does.
My point is that you would do better in learning something closer to your current skillset. Also need to consider: are you writing webdev, data science, AI, embedded, FP, graphics, crypto, or something else entirely? Depends greatly on your domain, whether or not CT is of much relevance.
Jane Doe · 2020-11-27 19:53
Does anyone have good resources for learning about p2p protocols and implementation?
Anonymous · 2020-11-28 15:18
What the fug is this nonsense... Is there an intuitive way to understand SQL Correlated Subqueries? I can't even...
Pris · 2020-11-28 15:23
>>22638
I can't fuarrrking visualize this in my head... what the...
queue · 2020-11-28 15:31
>>22639
It's just a nested query no?
So you run the query up to the second line, then run that query on the second one and only accept the results that overlap?
SQL is a fuarrrking mess either way.
Dox · 2020-11-28 17:13
>>22640
Okay, you seem like a smart person. Do you know how to solve the next one?
https://sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial#First_country_of_each_continent_.28alphabetically.29
St. IGNUcius · 2020-11-28 20:01
>>22643
I'm actually a fuarrrking idiot and misunderstood the original screenshot but I've attached a solution for 8.
I'll try to explain it below (it's not mine but still):
>SELECT continent, name
>FROM world x
I assume you get this part
>WHERE name <= ALL(
the 'WHERE name <= ALL(' means that the name must be less than or equal to the lowest value in the set returned by all
>(SELECT name FROM world y WHERE y.continent = x.continent)
this selects only the names from the same continent as the source of the name (so a name from asia is only compared to others from asia)
So overall:
-Select the name and continent from world x
-Select only the names where they are less than or equal to the lowest value in that continent, e.g. Nibia <= Algeria would be false so it fails to return, Algeria <= Algeria is true so it returns true.
From my understanding the reason its <= and not = is because of sql, if it's = to ALL(stuff) then sql takes it to mean equal to any value in stuff. For some reason the site produced an empty table for both = and <>, which could mean my understanding is completely wrong as I would expect = to return all name/continent combos but idk.
Sorry if this explanation doesn't help / is wrong, I'm rusty and soykaf at sql.
renames · 2020-11-28 20:10
>>22653
I've realized that I'm just retarded and had all wrong in my mind I think.
If all doesn't work how I thought (backwards checks operator and some dumb soykaf) but instead returns all results that match the criteria then the comparsion of = failing makes sense as it would compare the name to all other matching names and see if they're equal, which it obviously isn't. My bad if the explanation is a little fuarrrked because of my dumbassery.
Bob Arctor · 2020-11-29 07:38
>>22601
For networking you should read up on the fundamentals first, that would be the IEEE standards for 802.3 and 802.11. The process for getting your hands on recent versions of those standards is convoluted, but it's doable. Just tell the IEEE that you're a student, if they ask.
You're also going to want to read up on the TCP/IP stack. For that I recommend the TCP/IP Guide online. I hope someone here has the pdf for it:
http://www.tcpipguide.com/free/index.htm
Sipho Nkosi · 2020-11-29 07:41
>>22643
probably something like
SELECT * FROM COUNTRIES ORDER BY name DESC GROUP BY continent;
Or something
Case · 2020-11-29 08:18
>>22653
>>22654
>>22672
I've already solved it. It was actually pretty easy. The trick is to use the MIN( ) function. I didn't realize that if you apply the min( ) function to a list of names, it returns the first one alphabetically. Thank God for Indian tutorials on Youtube, lel
SELECT continent, MIN(name) FROM world GROUP BY continent;
Hououin Kyouma · 2020-11-29 11:20
>>22673
that's not a select within select like the task wants but hey it works lol
J.C. Denton · 2020-11-29 15:10
>>22675
I see. So maybe there are multiple ways to solve it? I really don't know how to solve it with select within select though.
But I did use select within select for the next one.
SELECT name, continent, population FROM world WHERE continent IN(SELECT continent FROM world GROUP BY continent HAVING MAX(population) <= 25000000);
Terzibashjian · 2020-11-29 16:03
>>22682
Yeah there are, it's just they're trying to teach you one method.
Good job on solving 9! It's cool that you managed to not use the table x table y syntax to solve it.
Unsigned · 2020-11-29 22:48
>>22684
> It's cool that you managed to not use the table x table y syntax to solve it
I'm still not sure if I understand that feature correctly, but I did use it a lot it in the next one, so I guess I can't be completely misunderstanding it.
SELECT name, continent FROM world x WHERE population > ALL(SELECT (population*3) FROM world y WHERE y.name <> x.name AND y.continent = x.continent ORDER BY population DESC);
Incognito · 2020-11-30 08:11
What is the difference between RAT (Remote Access Trojan) and Reverse Shell?
Is Reverse Shell just a type of RAT?
J.C. Denton · 2020-11-30 15:38
I've implemented a gRPC server, and now I want a thread pool to process the request it recieves.
I've done it in Java, and I know how to implement a basic thread pool, but I have doubts about the implementation in this case. For example, this is the class that implements the functions that get the request from the Unary call and send the response.
What happens here, is that the storage is a simple hashmap that has some functions for storing data, delet and get.
public class BaiacuServiceImpl extends BaiacuServiceGrpc.BaiacuServiceImplBase {
private BaiacuStorage storage;
public BaiacuServiceImpl(BaiacuStorage storage) {
this.storage = storage;
}
@Override
public void store(StoreRequest request, StreamObserver<StoreResponse> responseObserver) {...}
}
What I exactly want to do is execute the store method in one of the threads of the thread Pool. How could I do that?
The only way I know would be putting the code from these methods (which execute the methods from the storage to handle the data in the request) in a class that implenetes Runnable, which would execute the code of the "storage" object and then adding the thread pool in this BaiacuServiceImpl followed by creating the tasks and inserting them in the thread pool in it's methods. However, this wouldn't make the responses be in a thread, only the process of adding stuff to the storage.
I'm not that used to work with Java and gRPC. Maybe there is a way built-in gRPC to do this, but I searched in the docs and couldn't find. I will lurk more.
Wintermute · 2020-11-30 16:32
Where could I find what license some old pieces of software are licensed under, I've been trying to find what the license of the so-called "series 20" operating system for older nokia phones (3310 and up) was licensed under. and i can't find anything about it. Not even in the user guide's and manuals for the phone.
Emmanuel · 2020-11-30 18:24
>>22709
I mean I'd assume it's proprietary if the source isn't out there? There likely isn't a license
Project 2501 · 2020-11-30 21:11
how do i test hibernate code? i have trouble on test data insertion step, because my table has lot of joins with other tables, so i need to create multiple JPA objects and persist them in correct order
Splicer · 2020-11-30 21:24
Why should I learn programming? I don't get it why people like to program.
If you program something abstract (like moving files, a web browser, some back or front-end etc), this has no value in real life because it just affects people who use it - is it not like promoving good culture, making a house, planting trees, that are things that make difference in real life.
On the other hand, if you program something that are physic - like a robot, an artificial intelligence that manage to work, cellphone etc -, you are just creating something that no one needs, but keeps telling themselves that they do.
In the better hyphotesis you will be a billionare that makes you a program that do a little thing more than the rest and will invest all your money to do more thing, and more, and more, and more, until someone ask themselves "wait, is all of this really necessary?"
I started the MIT's CS course, I was in the middle of the SICP book, but then I realized that all of this programming-thing and computers are full of soykaf, that are just stupid people doing stupid things like "increasing the speed, creating new things, omg so cool!"
I really don't get it. Why do you people like to program? Serious question.
Yet Another Lainon · 2020-11-30 21:40
>>22735
>Why should I learn programming?
You shouldn't. I hate the idea that "everyone should learn to code". That is soykaf.
Apoc · 2020-11-30 21:40
>>22735
>Why do you people like to program?
Because it's something I enjoy doing. I realize that's a bit of a tautological answer, but for me it really doesn't go deeper than that. I just think it's fun.
>Why should I learn programming?
If you've tried it and found that it wasn't for you, then you shouldn't. Just find a different hobby instead.
push · 2020-11-30 21:47
>>22738
I hate it too.
>>22739
Thanks, anon.
pop · 2020-11-30 23:02
What is the equivalent of C programming language for Java and C#? I have programming experience.
queue · 2020-11-30 23:56
>>22748
i doubt you have, because it is nonsensical question
John Rain · 2020-12-01 00:00
>>22707
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html -> Usage Examples
Zhora · 2020-12-01 00:20
>>22748
Does by "C programming Language" you mean K&R's book? If so, why not just say K&R?
Hitomi · 2020-12-01 00:21
>>22748
the three have Indians
Linda Lee · 2020-12-01 00:33
Do I learn Linux (I am thinking of Arch) or continues using windows and learn PowerShell? I have a lot of free time.
Project 2501 · 2020-12-01 01:55
>>22709
It's definitely proprietary. I find it hard to believe there wasn't some kind of EULA for users to click through. If they licensed it to other manufacturers, those licenses were probably secret.
>>22755
Unless you want to learn Windows system administration, PowerShell is a waste of time. Even if you want to make Windows programs specifically, you have other, better alternatives. And yeah, in general, learn to use Linux.
Molly Millions · 2020-12-01 02:23
>>22735
It's interesting to note that for every single item you listed, other than promoting "good culture", you'll rapidly run into legislative/regulatory issues if you try to do it as a hobby on your own.
You also suggest that building houses for individuals you do not chose has value, but that value could very well be considered negative depending on what people it shelters.
Additionally, we don't need houses. Mass housing projects (хрущёвки) like in Russia work good-enough.
You do not need anything but water, food, and sufficient shelter to not die from exposure. Do you want more? You'd be weird if you didn't.
Your argument that abstract software is useless because it only benefits those who use it applies equally well to culture. It's useless to everyone who doesn't use it. In fact, it applies to every single example you gave. Everything is useless to everyone but those who use it, it's tautological.
Incidentally, surgical robots operated by humans are capable of greater precision than humans hands. I would rather someone who has practiced reliably working with robots build those, than someone with no prior experience whatsoever.
Void · 2020-12-01 10:53
>>22753
Yes I do. The name is just what popped up in my head first, but maybe it was too vague. Sorry,
Bobby Newmark · 2020-12-01 12:24
>>22716
>>22759
yeah, i assume it's proprietary, and there's certainly no access to the source, i was more concerned about whether they had some specific legal prohibition or defense against reverse engineering, or modifying software, something similar. my real hope is that they don't, and so far it seems like it, because i can't find any software licenses attached to these old phone applications, the only exception is the t9 system, the one old phones used for predictive text input. on 3x4 keyboards.
th3x · 2020-12-02 16:07
Can someone explain me in plain English what this text excerpt means in C++? I am not familiar with the -> notation
Meddler · 2020-12-02 16:52
>>22817
>>22817
I don't know C++, but I'm sure that -> notation is just a function notation:
f: A -> B is defined as a function from set A to set B.
So it probably means something like:
g: A -> B, f: C -> B and h:A -> D are three functions, where C c A(that is, C is a subset of A) and B c D(that is, B is a subset of D). Suppose you have something like this:
g: A -> B
and since you function f has the same output(set B) and the input(set C) is a subset of A, and all the elements you are using to call g are all in the subset A, you can put g in place of f and nothing bad happens.
For the other case, it's when you have something like this:
h:A->D
And since f has the same input(A) and the output(B) is a subset of D and you are always expecting outputs from the subset B, you can apply the function f there and nothing bad will happens.
In another words:
if you have two functions such that the output are the same, but the input set of one is a subset of the other, you can apply the one that the input set is a subset of the other and nothing bad happens. The same things happens for the output.
In the text, you had f: circle->shape and since circle is a subtype(subset of the set) of the type shape, you can instead use a function g: circle -> circle and there will be no problem.
Keep in mind that if you had something like this:
h:circle -> geometric_objects and shape is a subtype of geometric_objects, you couldn't apply this h in place of f, since h's output(geometric_objects) is not a subtype of f's output(shape).
th3x · 2020-12-02 19:34
>>22820
Thank you, it is clearer now
Boris Grishenko · 2020-12-02 21:10
>>22752
you said like you are looking for language similiar to C in Java/C# land that does not make sense. If you are simply looking for authorative book on Java, then checkout Effective Java by Bloch
Shogun · 2020-12-02 22:37
def xor(a,b)
c= (a and (not b)) or ((not a) and b)
#puts c
return c
end
def isValid2(line)
splits=line.split(" ")
lims = splits[0].split("-")
limmin = lims[0].to_i
limmax=lims[1].to_i
c=splits[1][0]
s1=splits[2][limmin-1]
s2=splits[2][limmax-1]
#puts s1,s2, c
if xor(s1==c , s2==c)
return 1
end
return 0
end
text=File.open('day2.txt').read
puts isValid2("1-3 a: abcde")
puts isValid2("1-3 b: cdefg")
puts isValid2("2-9 c: ccccccccc")
countAll=0
text.each_line do |line|
countAll+=isValid2(line)
end
puts countAll Whats wrong? answer is too low? Part 2
roll · 2020-12-03 06:00
How much does it take to finish CLRS? I've read that you would need around 4 months to tackle SICP, which turned out to be true for me 50% of exercises in the strict sense . What about the Introduction to Algorithms?
Would you choose this book to self-study algoritms, or some other?
Lectures very much related:
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/index.htm
Six · 2020-12-03 21:15
You guys see those neural networks (NN1, NN2, NN3, NN4)?
Their inputs are all either 0 or 1.
I want a way to make one of these result in A XOR B, changing only the weights, bias and activation function.
Is it possible?
I know how to find A OR B messing with these parameters. But XOR is kinda hard. Any idea?
Linda Lee · 2020-12-04 00:10
>>22841
If you could really finish SICP in 4 months; you could easily tackle CLRS in 6 months or max a year (considering you finish every single page of exercises in 60 minutes)
Technician · 2020-12-04 00:19
>>22877
You can also finish the book in one day, second one of the authors.
Morpheus · 2020-12-04 03:23
>>22878
Kind of a chicken-and-egg situation: I would need to program a spacecraft in order to get to Venus.
↑ · 2020-12-04 12:41
>>22871
Ordinarily you would notice that the XOR is true precisely when the OR is true and the AND is false, so you would use NN1, activate over zero, make an OR on one path and an AND on the other, then subtract the AND from the OR and you have your XOR. However if you are allowed any activation function at all then you can use NN4 directly by adding A and B, then activating within (0.5,1.5).
Spike Spiegel · 2020-12-09 23:46
I need to make a simple language, and make a compiler for it. I already made the lexical analyzer, and I need to turn my productions from the GFC into non-ambiguous. Since this language is simple, (only int, float, char, mathematical expressions, conditions, do-while, and I think that is all), Is there anywhere that I can check a proper GFC of a programming language that is similar in simplicity?
Checking for amibguity is boring, I don't want to do it by hand.
藤原純一 · 2020-12-10 01:55
do binaries really contain only binary values or are they really assembly code?
if so, why are they called binaries?
xchg · 2020-12-10 02:10
>>23107
It's a bit more complex than just black and white. A modern "binary" contains code ("text") and data, which are generally in the processor-specific binary representation that can be almost directly executed on the processor. This data is wrapped inside a format like Windows PE, or *nix ELF which organizes the data and provides useful metadata to do things like "relocate" code (this means allowing the data and code to exist in different/arbitrary locations in memory, which is essential when you have shared libraries which might overlap your desired offset in memory. Hardcoded offsets and addresses can be automatically changed at launch time in order to effectively change the address of the program), inline files (windows resources), document the target architecture (try running a linux ARM binary on x86 and watch what happens). declare dependencies (like non-dynamically-loaded shared objects), and so on. Technically this "wrapper" could be human-readable (and even the text could be human readable encoded), but it generally would introduce a pointless startup cost. As a general rule of thumb, you want code to start quickly, so it's easiest to map segments of the binary into memory, apply patches, and then jump into it directly.
Nobody important · 2020-12-12 01:24
I want to make a grammar that is LL(1), but I still have some ambiguity in it.
the 'expr1' rule is where I do math operations, and in order to make it non ambiguous, there should be a
precedence like this: first multiplication, then division, then sum, then subtraction.
I've tried doing it, but without success. The way I know how to do it, would end in left recursion.
this is the code in ANTLR4
cexpr: expr cexpr0
;
cexpr0: cexpr1
|OPIgual expr cexpr1
|OPMaior expr cexpr1
|OPMenor expr cexpr1
;
cexpr1: OPAnd cexpr0 cexpr1
|OPOr cexpr0 cexpr1
| //ε
;
expr: AbreParentese cexpr FechaParentese expr1
|ID expr1
|INT expr1
|CHAR expr1
|FLOAT expr1
;
expr1: OPMais expr expr1
|OPMenos expr expr1
|OPDiv expr expr1
|OPMult expr expr1
| //ε
;
INT: [0-9]+;
DIGIT: [0-9];
FLOAT: DIGIT+ DOT DIGIT*;
DOT: '.';
ID: [a-z][a-zA-Z0-9]*;
CHAR: '\''([0-9A-Za-z]|'\\'([a-f]|[0-9]|[1-9][0-9]|'1'[0-2][0-7]))'\'';
AbreParentese: '(';
FechaParentese: ')';
OPMais: '+';
OPDiv: '/';
OPMenos: '-';
OPMult: '*';
Wirth · 2020-12-12 01:48
am i the only one who wants to die when I realize that I cannot answer a single question asked in this thread?
Wirth · 2020-12-12 01:52
>>23175
Probably.
swap · 2020-12-12 04:23
>>23107
>do binaries really contain only binary values or are they really assembly code?
Machines manipulating grouped binary values are currently most popular; other machine types are decimal and trinay. Under current operating systems, plenty of files are really treated as nothing more than groups of eight bits, octets. Machines execute machine code, and one way to get machine code is to use an assembler, but there are other methods.
>if so, why are they called binaries?
I prefer to call such things numerical for precisely this reason. These files are actually collections of numbers, and the fact they're expressed in binary isn't usually much important.
Dujour · 2020-12-12 05:33
>>23181
Nice troll response.
quote · 2020-12-12 07:11
>>23182
I'm serious, and none of my response is incorrect.
Colmerauer · 2020-12-12 07:29
>>23188
Still a troll
Linda Lee · 2020-12-12 08:16
>>23107
Everything is binary, but when the word 'binary' is used to refer to an executable file it means that the file contains machine code and some metadata. See >>23108 Pic Related
>>23181
This all seems subtly wrong or at least irrelevant.
BloodCat · 2020-12-12 08:33
>>23192
It is outright wrong, and 100% irrelevant. Especially when he calls them "numerical" lmfao. Like, wtf even is that. Imagine working on actual code and somebody comes along and says this soykaf, they'd be laughed out of the room. The guy calling it a "troll" is right, especially since it was already answered with a pretty good response.
Switch · 2020-12-13 14:10
>>23193
I gotta play devil's advocate here. He's not wrong, but kinda irrelevant. He's over-generalizing in a world where ternary was but a research dead-end and decimal computer exists only as a didactic language in knuth's book.
Same about octets, anything other than 8-bytes (or multiples thereof) is something that you'll likely never ever see, so why confuse a beginner telling him about architectures he'll never ever see?
My own response would be every file is a binary of course, but we distinguish plaintext files as different for convenience. Ultimately the way to interpret an arbitrary file is to look at the magic numbers at the start of the file.
FILLER · 2020-12-13 14:53
>>23173
>expr: ID expr1
>expr1: OPMais expr expr1
The problem is that, while using expr1 to chain operators for expr, you are using expr itself on the RHS of the operators instead of expr's components. As a result expr1 is both erasable and can follow itself, and this combination automatically leads to a follow conflict. You need to put expr's components on the RHS of the operators. See the transformation in this example: https://en.wikipedia.org/wiki/LL(1)#Left_recursion_removal[12]
You'll also want to review your boolean/comparison expressions since you currently allow things like "INT OPAnd OPMaior INT".
cdr · 2020-12-14 15:12
How can I get a C++ reference manual on my computer for offline use? Preferably in info format so I can use it from Emacs.
I cannot believe such a widely used language has such poor documentation to the point where my best choices are a book or auto-generated man pages. Yet ever stackoverflow post seems to indicate that these are the facts.
Zero Cool · 2020-12-14 18:06
>>23310
https://en.cppreference.com/w/Cppreference:Archives
This looks like it might fit the bill?
Ivan Petrov · 2020-12-14 23:21
>>23181
Don't listen to them 23181, they don't know any better.
Shogun · 2020-12-15 00:46
Hello Lainons, if you could choose 1 book to buy what would it be and why?
Jane Doe · 2020-12-15 01:13
>>23327
Encyclopedia of Cardiovascular Research and Medicine
by Douglas B. Sawyer MD PhD and Ramachandran S. Vasan
Because I think you're going to buy whatever I recommend and it is the most expensive book I could find.
Eldon Tyrell · 2020-12-15 01:50
>>23329
Just ordered it!
Really Lainon, do you think I would trust random strangers on the internet like that? If you post a book in a subject that I like, it has good reviews, and I like the author I would consider getting it.
Hitomi · 2020-12-15 16:02
>>22528
maybe its because im a dumbass, but i'm a working programmer and dont have any idea what category theory is
Nameless · 2020-12-15 17:16
>>23351
Not being a dumbass doesn't imply that you would understand category theory (or have any desire to).
Being a working programmer implies literally nothing since most programmers just spend their days slinging web frameworks.
Point is, unless you have a use for it, it doesn't even matter.
Naomi Nascimento · 2020-12-19 06:08
I'd like to dive into Emacs for both notes (org-mode!) and programming (mainly Python and Rust), feel comfortable and then - possibly - move more and more of my workflow into Emacs.
Currently I use a combination of PyCharm+VSCodium+Vim.
I have basic Emacs experience (I know basic navigation, can use org-mode and export, enable evil-mode) but I'd like to extend it for programming.
Features I use often: jump to definition, peek function/method arguments or docstring, rename variable/method/class. I'd like to have also autoformatting (possibly using external tools like `black` for Python or `cargo fmt` for Rust) and linters (`flake8` and `clippy`, respectively).
Fellow Emacs users, what should I look at? What are some great tutorials/books, what are the best plugins?
Zero Cool · 2020-12-20 01:22
>>22485
Can someone recommend me a good way of learning OpenGL (or give a field report on what doesn't do a good job of teaching it)? Are pages like https://en.wikibooks.org/wiki/OpenGL_Programming or https://learnopengl.com/ any good, is there a "OpenGL bible" book I should buy? There was a post with some links on this board some time ago but I didn't save it :(
-intermediate C++ hobbyist programmer
Masami Eiri · 2020-12-22 01:51
Sometimes I wonder, is it better to know many programming languages or just a few(a scripting language, a general-purpose language and whatnot)?
I find the idea of learning a new programming language interesting, but then I look around and almost every language looks the same. I know SML, C, C++, Fortran, Python and Lua, but I wonder if I should learn any other language or if I should just know these language as good as I can.
Since programming is just a hobby, I don't feel forced to learn Java because I need a job, but sometimes I wonder, what if learning Java(as an example) would be a good idea? [Not necessarily Java, since it is like kicking dead whales down the beach]
I have read that "A language that doesn't affect the way you think about programming, is not worth knowing", but then, I wonder if I'm interested in learning a programming language or semantics of a programming language.
Also I feel like I know only old languages(C and SML) and I should learn a more modern language. I like the concept that "a programming language is just a tool, use the best one for the job", but that sounds like people should know a lot of languages. I have seen important programmers knowing only one or two languges.
Does Linus ever know any other language than C? I have read that Stroustrup only uses C++. Stallman used LISP and while he tried different languages, he still kept using LISP.
Shogun · 2020-12-22 02:21
>>23508
Based on my own experience over the years, you need to know a few languages of a few categories. Being a one-trick-pony isn't going to get you far in the real world. There are many reasons, such as automating tedious tasks quickly (try doing some basic text manipulations in C on a set of files based on common patterns, then do them again in shell script, you'll see what I mean). I'm not saying you need to be an expert in a bunch of languages. For expertise, focus on a few you really love working with (seriously). Many if not most skills are transferable between languages, but there is an undeniable benefit to leveraging the strengths of some languages over others in a given problem domain.
>"A language that doesn't affect the way you think about programming, is not worth knowing"
This is true and false. Going from BASIC to C++ taught me a lot about the underlying hardware, making it easier for me to conceptualize programs. However, going from C++ to Assembly (don't ask) didn't really have the same level of impact. Yes, it was insightful, but it wasn't revolutionary. Conversely, becoming proficient in BASH/ZSH was extremely beneficial even though it didn't improve my general programming knowledge (rather, my conception of things like modularization and interoperability through standard interfaces). These are all different concepts than "changing the way I think of programming" because they never altered my bottom rung problem solving, just the tools I had access to and the means of formulating solutions.
>Does Linus ever know any other language than C?
Does it matter? He's clearly capable and thinks clearly about the code he writes. We cannot measure his skill in either LOC or Languages Known.
>I have read that Stroustrup only uses C++
We all make mistakes.
>Stallman used LISP and while he tried different languages, he still kept using LISP.
Having a favorite language or a language that we acknowledge as best for our problem solving style is not the same as being tied down to that language. Remember that EMACS' base, GCC, most GNU utilities, etc. are written in C. I don't want to dissuade you from learning LISP in particular since I think it is an amazing language, but I want to point out that there is no such thing as a panacea when it comes to coding.
Hope this helps!
over · 2020-12-22 15:02
>>23509
>>Does Linus ever know any other language than C?
>Does it matter? He's clearly capable and thinks clearly about the code he writes. We cannot measure his skill in either LOC or Languages Known.
Even more importantly, Linus is clearly capable of understanding code that other people write, and also knowing that he needs to surround himself with other people with that same skill. I think those two factors are the real reason for Linux's success.
t · 2020-12-23 03:27
>>23514
Linux succeeded because of its license. Being free as in beer encouraged adoption, and being free as in freedom meant that any companies that patched it needed to make those patches public.
Wintermute · 2020-12-23 10:59
>>23525
>Linux succeeded because of its license. Being free as in beer encouraged adoption,
this has nothing to do with license and there are variants that you have to pay for
>being free as in freedom meant that any companies that patched it needed to make those patches public.
Nope. Not true at all. Only people who they distribute their changed version need to to have access to code. If they change code for own use they don't have to share code with anyone. Even workers of that company don't have to have access to code if all software is run on computers owned by that company. If some employee copies that software (modified version of Linux) on his own machine he breaks both terms of GNU GPL and most probably copyright laws of his country. In other words he commit's act of so called "piracy" on GNU GPL covered software a.k.a. getting unauthorized copy of free software.
setq · 2020-12-23 14:40
>>23525
>Linux succeeded because of its license. Being free as in beer encouraged adoption, and being free as in freedom meant that any companies that patched it needed to make those patches public.
If that were true, one of the BSDs would have been the kernel/OS of choice for all those companies rather than Linux. (Though of course Apple did make that choice with Darwin.)
Meddler · 2020-12-23 19:52
>>23508
Knowing many languages is better, and a language which doesn't change a man's thoughts about programming isn't worth knowing, yes. Don't bother with learning Java, but consider learning Smalltalk.
>I find the idea of learning a new programming language interesting, but then I look around and almost every language looks the same.
Look at Forth, Lisp, APL, et al. for examples of languages which aren't just ALGOL knock-offs.
>I know SML, C, C++, Fortran, Python and Lua, but I wonder if I should learn any other language or if I should just know these language as good as I can.
That explains it, since those are really only three kinds of languages. SML and Fortran are distinct, whereas C, C++, Python, and Lua are effectively the same language, just with different makeup on.
>I have seen important programmers knowing only one or two languges.
Be made aware that important and intelligent aren't synonyms. Computing is a field filled with charlatans.
>Does Linus ever know any other language than C?
Does Linus even really know the C language, considering how much he has complained about GCC actually following the standard over the years? Like most C language programmers, he uses the C language, but then he cries when the compiler carries it out, arguing it should be different. Here's a thread pointing out the many glaring flaws with the C language: >>19899
I've not written even one million lines of code in my life, and that's good. People want to pretend writing programs tens or hundreds of millions of lines of code long is good, but it's anything but. What's truly impressive is doing more with less, and writing increasingly smaller programs. It's shameful, to have such a large program, and especially one which does so little. Look at the Linux kernel objectively: it doesn't even provide file-locking, and when memory is exhausted its first strategy is to randomly kill a program while offering few or no strategies to otherwise cope with the issue; is that supposed to be impressive?
>I have read that Stroustrup only uses C++.
He's one of those charlatans I mention. Does the creator of the C++ language seem like someone worth emulating? He gets crowds, but it's obvious there are better languages, and that much of the nonsense he's inflicted upon the world is unnecessary. He'll tell people otherwise, but that's just in his self-interest.
>Stallman used LISP and while he tried different languages, he still kept using LISP.
Lisp is actually a good language. Lisp enables heavy metaprogramming, and also frees the programmer from thinking of irrelevant concerns. If the computer exists to automate work, why not have it automate the programming as well?
>>23509
Neither BASIC nor the C++ language teach anything about how hardware works. I do hardcore machine code programming, and there's no comparison. Sure, plenty of people in the demoscene use the C++ language, but the really impressive demos are usually written in extremely compact machine code.
Hiro Protagonist · 2020-12-23 21:05
>>23548
>Neither BASIC nor the C++ language teach anything about how hardware works. I do hardcore machine code programming, and there's no comparison.
I've literally designed a CPU and while it was pretty basic I have a hard time understanding how learning assembly is going to teach you much more than C++. Maybe asm will teach you some processor quirks but that's more "how x86 works" than "how computers work". I guess that you could probably learn C++ and never really get a grasp on addressing, interrupts, registers, you might not be aware of what the stack and heap are doing, how frames are built. But does the mere ability to write asm programs teach you that?
Hmmm but honestly you could build a turing complete CPU and still not know some of those until you made a compiler and a lot of those you should understand if you're writing c++ though it's not strictly necessary.
As someone who learned to program literally alongside learning to read and write English with no tutor and a few books well above my reading level, it could be said that you can do a ton with assembly and still have a similar sort of ignorance (I had batch, gw-basic, and debug.com at my disposal) I was able to write an asm starfield program while still being ignorant of things most people learn in the first few weeks of programming 101. I knew vga bios interrupts, was able to get memory working but didn't really understand it, I used mostly registers.
Much later I took computer architecture and I learned a ton.. I even learned a lot in my first Java class. I'd argue that it was being forced to read 'boring' parts of my textbooks and not so much the languages themselves.
J.C. Denton · 2020-12-23 22:49
>>23553
>I've literally designed a CPU and while it was pretty basic I have a hard time understanding how learning assembly is going to teach you much more than C++.
I've designed an architecture and implemented it in software, but I don't know if something more is meant by this.
The C and C++ languages are filled with anti-knowledge. There are so many bizarre repercussions of their haphazard growth that bites people who use the language. Even at the machine code level, it's generally specified what happens when registers aren't large enough to hold a result, whereas I know at least the C language will just happen to work or vomit everywhere at best, and have code silently optimized away no matter how important at worst.
>Maybe asm will teach you some processor quirks but that's more "how x86 works" than "how computers work".
It's very odd for me to be told this, when discussing the C++ language, out of all languages. I don't program in Intel or AMD machine code, but there are plenty of fun machines to pick from. To be explicit, it's laughable to be told machine code teaches mere quirks, and yet the C++ language somehow doesn't.
>I guess that you could probably learn C++ and never really get a grasp on addressing, interrupts, registers, you might not be aware of what the stack and heap are doing, how frames are built. But does the mere ability to write asm programs teach you that?
Yes. Better, a good programmer will find ways to avoid or properly take advantage of plenty of these things.
>Hmmm but honestly you could build a turing complete CPU and still not know some of those until you made a compiler and a lot of those you should understand if you're writing c++ though it's not strictly necessary.
So we're in complete agreement with me is all I'm getting from this. Writing programs that barely even touch memory, maintaining most or all state in registers, is fun, and fun which can't be had in these languages.
If we're discussing learning only aspects of a high-level language, than one such as Lisp should be chosen, not the C++ language.
Neo · 2020-12-23 23:10
>>23534
>If that were true, one of the BSDs would have been the kernel/OS of choice for all those companies rather than Linux. (Though of course Apple did make that choice with Darwin.)
Many Silicon Valley giants do use FreeBSD and sponsors work of porting it to new platforms.
Unidentified · 2020-12-23 23:17
>>23556
lol, debugging C codebase is many orders of magnitude easier than C++
t. I worked as kernel programmer on porting kernels to new platforms and also did C debugging later when worked as sysadmin
XERXES · 2020-12-24 07:57
>>23559
>I worked as kernel programmer on porting kernels to new platforms
doubt
J.C. Denton · 2020-12-24 12:33
>>23561
your right, but you are wrong
Turner · 2020-12-26 19:29
Hey lainons, how do I into teaching myself to code?
I'm currently in school but this last semester has taught me that I don't retain much of anything from online classes. I can stick info in the short term memory so I get decent grades, but as soon as exams end I forget just about everything thanks to the lack of any tangible payoff. On the flipside, e-learning has freed up my schedule significantly so I do have the option of putting that extra time into personal projects to (hopefully) help me out in the long run. With next semester fixing to be online again, I figure now is as good a time as any to kickstart something.
My only issue is I'm not sure what path to take. I have a C book I was considering working through while taking notes, but I wonder if maybe just diving right in to making a project might be a better option? I already have some exposure to C with basic knowledge of concurrency and how pointers work, which is more than enough to make a simple program, but I'm far from an expert. I've also heard good things about certain websites like leetcode but when I signed up it seemed more like some sort of pseudo social media than a learning platform.
So, tl;dr, what do you think is the best venue for improving your programming skills?
A book? A website? A personal project? Or something else entirely?
Jet Black · 2020-12-26 20:16
>>23584
>So, tl;dr, what do you think is the best venue for improving your programming skills?
Just keep programming. Do programming challenges , projects, whatever. You can then read books after you have more knowledge of how to build software and so on. Use the books to complement your knowledge, to show you better ways of doing what you know and so on. I don't like to read a book that tells me the right and wrong of doing something when I never did anything, I'll not have a background to compare with the way I did to see if I'm doing it write. Most of those books also assume that you have done a lot of stuff. So my recommendation is just to keep programming. A personal project is going because you can then have a better understanding of how to build something more complex than what the exercises in programming books expects you to do. Programming challenges are nice to get used to some programming language syntax(if it's any new language) and also to understand better data structures and algorithms, since you can easily focus on it given that the programming challenge is usually some small problem you want to solve. Then again, building a software is just breaking it in many small problems you want to solve.
Either way, no matter what path you decide, I hope you will keep programming, that is they only way to improve your programming skills.
Cowboy · 2020-12-27 23:04
What do you guys think about this paper?
aHR0cDovL3Jlc2VhcmNoYXJjaGl2ZS53aW50ZWMuYWMubnovNTQ1OS8xL1NVUEFfR0pFVFJfTW9uanVyLnBkZgo=
I just can't digest the whole paper? How do I even start implementing this? Can someone break this into smaller steps?
SHODAN · 2020-12-27 23:40
>>23588
I think you should upload the paper instead of sending a random sequence of characters.
Tomohisa "Tom" Kanezaki · 2020-12-28 19:29
I'm doing Tanenbaum's Architecture and it made me want to learn more about memory. I plan on reading Patterson/Hennessy next and then doing both Tanenbaum and Silberschatz's OSs, what can I get next to get deeper into memory? Or would this be necessarily grad level and I wouldn't be able to get into it before doing something else?
I also plan to get into Assembly after doing those books I mentioned, I recently came across Igor Zhirkov's Low-Level Programming, which seems like a nice intro to that universe.
藤原純一 · 2020-12-29 12:47
>>23605
>into memory
In what sense? Hardware? Software? Algorithms of allocations and management? Way's of partitioning memory and accessing it on different CPU architectures? Memory Management Units? How Floppy disk, HDD, SSD, Flashcard works? "Memory" is broad topic.
Meddler · 2020-12-29 13:16
And concerning question
>Or would this be necessarily grad level and I wouldn't be able to get into it before doing something else?
It depends what you want stud about memory. Some more advanced algorithms may require some level of typical math taught on bachelor level of computer science of univs. But you may learn them anyway without deeper understanding how to prove them to be correct in formal way. They may involve number theory or topology and other aspects of math. Subject of memory is broad as fuarrrk.
Boole · 2020-12-29 15:16
>>23620
All of those, although I admit in reality I'll only get so far when it comes to hardware since at some point it'll require setting aside time to really study circuits and such, and as much as I might want it time is limited and I can't let all of it be consumed by my curiosity.
pop · 2020-12-29 15:38
>>23622
Then there would be multitude of sources - starting from tech documentation for hardware like CPUs, motherboards, older 8 and 16 bit computer tech manuals, newer Open Hardware, books on algorithms, scientific articles from last few decades. You can also see a lot of videos on youtube on OS development, hardware, CPU architectures, algorithmics. There is also tone of source code on github and other public repos implementing different aproaches. There is learning material for many years both online and in ofline publications.
If you are looking for entry stuff just get access to multiple books on same topics written by different authors.
Then choose some real life implementations and decompose them into parts. Try find algoritms they use and then look for papers on them as a reference for further studies, check articles they cite. Look for more recent papers on them and alternative solutions (more recent algoritms doing same stuff). Get technical manuals for hardware.
Go to your local hackerspace and see if there are people with innterests similar to yours or work experience in these areas.
Peek into sourcode trying figure out wtf is happening. Etc. A lot of experimentation and asking questions and looking for answers.
Material is rich and you always have some new stuff to get familiar with even if you spent years working in that field.
Cutter · 2020-12-29 15:52
>>23623
I thought about looking at everything that makes a file system, like XFS or ext4, tick, and then find out everything necessary to understand its implementation. In my mind that meant going through a process similar to the one you described, and sticking to a goal like "learning system X" would ensure a more linear approach to my learning process, was I correct?
Colmerauer · 2020-12-29 17:28
>>23624
Yes. I would BTW suggest starting from Unix File System rather than these mentioned. It's implemented in any major UNIX or it's clone, Linux kernel also supports it. https://en.wikipedia.org/wiki/Unix_File_System
It has simpler structure. Most (semi)modern FS tend to be massive creatures. I would suggest being familiar with concepts like semaphores, mutex futex etc before digging there too.
If modern Linux would look too complicated at start - get some very early version of it like around/pre 1.0 and run it in QEMU. Or look into MINIX.
Lain Iwakura · 2020-12-29 18:00
>>23626
I already have a basic understanding of semaphores and mutex but I expect to start properly digging into it once I finish the previously mentioned architecture books and do OSs ones, like Silberschatz and Tanenbaum. It's hard to plan the learning path without some knowledge of it already, but I'm aware there's not much to it other than just doing the work.
>Most (semi)modern FS tend to be massive creatures.
Yeah, I read a bit about ZFS and new concepts just never stopped appearing, and that's considering I mostly looked for info in OS wikis, docs and tutorials, when I got some articles they went way over my head (it certainly didn't help that most of them weren't about the FS itself, but about some application of it instead).
>If modern Linux would look too complicated at start
Something I wish to do once I have a better grasp of architecture and OSs is fully transitioning to Linux, I've used it a bit in VMs in the past but I realized I'd never really understand it before truly depending on it (since it was in a VM, I'd barely use it) AND understanding all the knowledge needed regarding file systems, memory partition and whatever else might be needed to fully understand the installation process. Summing it up, I was planning to get into Linux as a way to practice all of this stuff. I know you were referring to FSs only, but I thought it was appropriate to bring it up.
Yamaoto Toshi · 2020-12-30 19:00
Can someone explain this image to me? What does Dennis Ritchie mean by "stacks"?
H.R. Giger · 2020-12-31 14:55
>>23652
Could be as well stacks in OS sense (overflows) as in tech stack (stuff you use to create software - like languages, frameworks etc) based on not as general purpose programming languages as LISP is - hence Fortran in the picture.
Donna Hawthorne · 2020-12-31 19:43
>Will graduate at 26 with cs degree
>will be in exactly two years
>will have a 3.4ish gpa
>no work exp in tech
>Will be looking for jobs till 27
Will I be too old for tech when I am done with my cs degree? I am 24 now. I am pretty good at math. How fuarrrked am I?
Motoko Kusanagi · 2020-12-31 21:25
std::cout << (1300 * 1300 * 1300 * 4) / pow(1000, 3) << std::endl;
Chani · 2020-12-31 22:21
>>23661 Anon you have an overflow. 1300*1300*1300 is 2197000000 and int32 max is 2147483647.
Tyrell Wellick · 2020-12-31 22:24
>>23662 This stackoverflow post might help, I've never actually run into the issue myself (at least not in this way) so I'd be interested to see what you do. Maybe there's some way to do it with a bigint library by assigning the output to a variable first.
overriding · 2020-12-31 22:29
>>23662
>>23663
I finally found it by trying something randomly.
std::cout << 1300.0 * 1300.0 * 1300.0 * 4.0 / pow(1000.0, 3.0) << std::endl;
Milner · 2020-12-31 22:37
>>23665 I assume this works because you could just store it as 2197 in the mantissa and have a big exponent (as in it would be 2197 in mantissa and exponent of 9). Glad you managed to get it working!
John Titor · 2020-12-31 22:38
>>23666 It works for me even in a variable? (using g++)
#include <iostream>
#include <cmath>
int main()
{
//float n = (1300 / pow(1000, 3)) * (1300 / pow(1000, 3)) * (1300/ pow(1000, 3)) * (4/ pow(1000, 3));
float n = (1300.0 * 1300.0 * 1300.0 * 4.0);
float k = pow(1000.0, 3.0);
std::cout << n/k << std::endl;
}
overriding · 2020-12-31 22:55
>>23668
Yep nevermind, I made wrong computation for variables, it does work indeed
Thank you for your help.
Otto Normalverbraucher · 2020-12-31 22:57
>>23670 Np, hope you have a good year!
Ender · 2020-12-31 22:59
>>23671
Happy new year :)
dup · 2021-01-01 03:02
fuarrrk why can't I print from sockets in C
Batou · 2021-01-01 03:14
>>23660
You're not old at all; that's the perfect age to begin. Of course, you won't have any experience, and you'll be slightly older than many other newly-graduated CS majors, but that's nearly inconsequential.
Yeah, "tech" companies are definitely looking for younger folks, but as long as you're in your 20's, you have nothing to worry about. They won't discriminate.
Guthrie · 2021-01-01 03:17
>>23673
Can you be more specific, please? Perhaps post a sample of your code, followed by a description of how it's not working. I'm sure we can work it out.
Nguoi La · 2021-01-01 12:30
>>23660
You're doing great, everything you have said is fine or better than fine.
Try to find an internship a couple of days a week, or some freelancing work. Otherwise see if you can contribute to an open source project for experience/resume padding.
I got a tech job when I was 24 and didn't have any experience, my previous job was as on the phones at an inbound call centre after I had just finished my EE degree. There isn't that much difference between someone who's 24 with no experience and someone who's 26 with no experience, except of course for life experience.
You'll be just fine anon.
lol · 2021-01-02 00:08
>>23660
>Will I be too old for tech when I am done with my cs degree?
Yes, CEOs don't sleep with code boys older than 19. You have literally no chance in IT because of that. Everyone knows that the lower age of lover is the better.
>I am 24 now. I am pretty good at math. How fuarrrked am I?
In what sense fuarrrked? In the head? Probably quiet seriously. Just stop asking retarded questions and start looking for internships for fuarrrk sake. If you have good math skills you are above good percentage of programmers. Most programmers in industry are medicore at best at what they do BTW and ever more absolutely suck at math.
>>23677
I get my 1st programmer job at age of 25. In company doing outsourcing for few known Silicon Valley companies.
Hiro Protagonist · 2021-01-03 03:02
If I want to make a betting game online using crpytocurrency, should I be concerned about legal reasons in my conutry about betting games?
I am brazilian and I have a good idea for a betting game that people around here would probably like. But betting games around here are illegal. If I host it in another country it shouldn't be a problem, right?
William Holtzer · 2021-01-03 07:45
>>23702
Unless you're subsequently identified.
Essentially, forget profiting from it and you might manage.
Davis · 2021-01-03 11:02
If I have a daemon with root privileges, and I need it to check if a given tty on the system has an X11 display running in it, how would I go about checking this?
Dujour · 2021-01-03 15:36
>>23707
X11 display and tty are two separate things. Displays can't run on tty. So direct answer to your question is - you can't as situation you described is impossible.
Unsigned · 2021-01-04 19:55
>>22485
How do I become a codemonkey? I am 24, have no education or knowledge whatsoever.
Where do I start and what language do I learn?
All I need is a quick direction in my life.
Zhora · 2021-01-04 19:56
>>23718
oh and where and how do I search for a job and create portfolio? Thank you
Ein · 2021-01-04 21:10
>>23718
Do you have a degree or anything? A lot of computer science jobs are quite faggy about education.
Depending on your time web soykaf (js, node etc.) may be good otherwise do Python and Java/C# (scout job prospects to choose between the two).
To learn depends how you learn, if you prefer to read then use books and written guides if you prefer to do then follow videos online and experiment around with the stuff you write to get a good feel.
If you take the Python->C#/Java path then make sure you get all the soykaf in depth. For C# it's worth once you've got all the main soykaf down learning about asp.net if that's listed a lot near your area (it's backend webshit)·
Lord Nikon · 2021-01-04 21:51
>>23720
> Do you have a degree or anything? A lot of computer science jobs are quite faggy about education. No, I am currently trying to get a useless degree like "English language and literature" but it will take five years, I don't have that much time. My situation is pretty desperate to be honest.
I am thinking of learning Java first as smart people said it's the best way to learnt how to code. I have the Oracle Java book and plan on taking an Udemy course. Though I have no idea whom to ask if I make mistakes or my code doesn't work.
In general, I am more of the theoretical kind of a person, I like reading and remembering laws, but am always shy on trying it on practice.
>If you take the Python->C#/Java path then make sure you get all the soykaf in depth. For C# it's worth once you've got all the main soykaf down learning about asp.net if that's listed a lot near your area (it's backend webshit)·
So do I just check the job offerings and learn what is most needed in my local market?
In any way thank you very much, kind anon. I will try to follow your advices.
JARGON · 2021-01-05 14:24
Hello lainons, I've been working with PHP (barebones, no framework) for some time. And now I work almost exclusively in React/React-Native for frontend with node+(mongo|mariadb) for backends using some docker to have a better time setting up envirorments, nothing fancy.
And that's all, I don't have proper formation but I enjoy JS for the better handling of functional approach.
Said that, I wanted to ask if you could advice me something to expand this or have better foundations for what I do. Like maybe a book with fundamentals, don't mind learning another language in the go.
In the other hand, to expand my understanding, and as a second question, I was wanting to go a little low level and was thinking on doing something like nand2tetris. What do you think?
John Doe · 2021-01-06 13:34
>>23707
>>23711
Maybe I was using the wrong terminology, or I'm just getting something else wrong, but my understanding is that most *nix systems nowadays will usually startup with multiple virtual terminals, and a user can run an instance of an X11 server in one of these, either using a display manager, or a shell command such as xinit, I'm not sure if one instance can run several displays on several virtual terminals, but that's besides the point.
Now, if I've got that somewhat right, my question is, is there a relatively simple and hopefully portable way for a daemon with root privileges to check if an instance of an X server is running on any given virtual terminal, and what is the number of the display opened there, say a function that given a VT device, say /dev/tty1, will either give me a display number like ":0", or nothing if none are there. If my assumption somewhere is wrong correct me.
I should also state some solutions I've found, but which don't really cut it.
First ones are in the response to this stack/exchange question: https://unix.stackexchange.com/questions/348161/get-display-number-for-a-given-tty
Of course they all rely on loads of external commands, some of which aren't guaranteed to be on my users system, plus I would in general prefer to not rely on bigger external commands using something like system(), these answers are of course written for the command user in his terminal, not necessarily for a programmer.
Another solution would be to use something like tcgetpgrp(), to get the foreground process group of a TTY. But in that case, I would need to change my daemon, which isn't really supposed to have a controlling terminal, so that it now has the terminal I'm checking as the controlling terminal, then I would need to do my checking for the leading process group, then loose the controlling terminal, so that my daemon can go back to acting normally. I would really want to avoid this, especially since I'm not even sure if the X server is guaranteed to be in the foreground process group or not.
If there is no solution that's simple enough, portable and not hacky, I guess I would have to go with the second, but I was wondering if anyone else might know a simpler way to check the existence, or the number of a display.
Ishikura "Tatsu" Tatsuhiko · 2021-01-06 21:41
>>23749
>i cannot google basic facts about how a modern UNIX system works
that's because nobody knows. they just LARP
Lord Nikon · 2021-01-06 23:53
>>23749
>Maybe I was using the wrong terminology, or I'm just getting something else wrong, but my understanding is that most *nix systems nowadays will usually startup with multiple virtual terminals, and a user can run an instance of an X11 server in one of these, either using a display manager, or a shell command such as xinit, I'm not sure if one instance can run several displays on several virtual terminals, but that's besides the point.
You clearly have no fuarrrking idea what you are working with. And therefore you approach the problem from the ass side (ass backwards).
*imprecise hand waving mode on*
x session controls display in graphic mode
display that is manipulated by x session is raster (bitmap) device - it's hardware form is for example LCD monitor
there are many other types of displays like vector display, character display to name most common alternatives o raster display
*imprecise hand waving mode off*
Terminal is text device which means it accepts characters and outputs characters. It may have hardware representation of teletype device (these funny old printers with keyboards), vt100 terminal (these funny green phosphor "TVs" with keyboard) or not have such representation at all - it means it's purely virtual.
yada yada yada blah blah blah
UNIX that runs on PC in so called text mode operates on character devices called virtual terminals. These virtual terminals have standard input and standard output attached to them (you can attach and deattach them in your programs).
Virtual terminals are means for programs to interact with streams of text. Content of these virtual terminals may or may not be displayed on displays. Input may be or not be attached to these virtual terminals. Input may have one side attached to keyboard and other side to virtual terminal. Some UNIX implementations may have inputs as parts of virtual terminals, other may have more abstract approaches. Does not matter a lot here.
Terminal and virtual terminal are different animals. Terminals are physical, virtual terminals are software.
Displays and virtual displays analogous situation.
Virtual display and virtual terminal are separate entities that may interact at given moment or may not.
Processes (programs) may interact with virtual terminals and virtual displays. Kernel interacts with hardware displays and hardware terminals.
Virtual terminal may be attached to virtual display. Virtual display may be at given moment displayed on real hardware display or may be not.
Programs don't "run on terminal" do you think any software would run on a primitive teletype as pictured in the picrel? It's terminals that INTERACT with programs and programs MAY INTERACT with them.
Programs don't run on terminals, they run on CPU.
Xsessions are not exceptions here. And their interaction with virtual displays are not the same as their interaction with virtual terminal.
Do you see now what you do wrong?
car · 2021-01-07 15:13
>>23765
While like any CS guy I appreciate your commitment to pedantic precision, just give the dude what he wants, you know what it is.
>>23749
first get the PID of your x session (what the command actually is varies depending on display manager. for me it's gdm-x-session) and then do ps $PID . the tty number associated with it (if any) will be in the TTY field, which you can retrieve with the usual tools like cut
Dujour · 2021-01-08 10:53
How can I wrap my head around bitwise operators? I get what they do but I never come up with them as a solution for a problem I encounter when programming.
J.C. Denton · 2021-01-08 15:20
>>23789
Well they're a pretty low-level operation, and much of programming today is concerned with bigger data structures than bit-strings, so it may be hard to come up with examples in a domain that would usually be solvable in, say, python, or lisp.
For an example, consider dealing with graphics. You might be rendering to a raster device, or manipulating bitmap file. Say your pixels are valued 0xRRGGBBAA:
uint32_t pix, redval, greenval, blueval;
pix = 0xRRGGBBAA; /*AA is alpha*/
redval = pix & 0x11000000;
greenval = pix & 0x00110000;
blueval = pix & 0x00001100; This was hastily done, always mind your emdianness!
As you can see, you can use this to extract arbitrary fields from a bitstring, for example, to parse the data in an IP packet.
Unix/C uses OR to set the flags in several places, for example, when opening a file:
int fd = open("foo.txt", O_RDONLY | O_CREAT); The second argument builds a bitstring from several individual flags that each has a specific bit turned on.
I recommend you check out Hacker's Delight, it's a fun little book about bitwise manipulation (however, the examples are not much motivated in real-world scenarios (as far as I know.))
Moore · 2021-01-08 15:33
>>23789
>Exercise 2-6. Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged.
>Exercise 2-7. Write a function invert(x,p,n) that returns x with the n bits that begin at position p inverted (i.e., 1 changed into 0 and vice versa), leaving the others unchanged.
>Exercise 2-8. Write a function rightrot(x,n) that returns the value of the integer x rotated
Try those if you want some practice. I also agree with >>23796 that you could look at Hackers Delight and similar ASM-tricks books as they will get you a little more used to this low level thinking.
Yet Another Lainon · 2021-01-08 15:37
>>23798
>Hackers Delight
Do people actually read that from front to back? It seems so dry.
Zuse · 2021-01-09 00:52
>>23799
>Do people actually read that from front to back?
Sometimes I do that with technical books, more often than not I have to reread and sometimes skip ahead for a while.
It seems so dry.
I'm sorry it is not Head First Bitwise Operators, or Guy's Poignant Guide to Bit Fiddling. I read it for the content, rather than the prose.
Sarcasm aside, you don't need to read it all, and while I do appreciate the pedagogical value of an engaging narrative, if you have an interest in the subject and some mathematical maturity it's a very entertaining read.
Iverson · 2021-01-09 02:45
>>22485
I know literally nothing about computers or programming, even the most basic terminology.
But I have always enjoyed "secret messages" -- ciphers, hidden messages, anagrams, etc.
Where should I get started if I want to make encryption/decryption software for personal use? What do I have to learn to do it well?
Project 2501 · 2021-01-09 08:36
>>23820
If you need structure, Stanford offers a free Cryptography course on Coursera. I found it to be a very solid foundation for both the mathematics and logic behind designing cryptosystems. I remember the optional assignments being quite involved, but especially the ones having to do with breaking an insecure encryption could be tackled by someone with little programming skill as a means to improve.
Spooky · 2021-01-10 01:09
hey anons the problem I have with programming is that there's just way too much soykaf to learn and way too many programming languages like.
Is there like some sort of guide or pathway to understand this soykaf?
Without a proper guide soykaf seems so crazy its like a guy offering you 100 roads and he then tells you to pick a few. And im like wtf do I pick bros.
bit · 2021-01-10 01:38
>>23843
If you're asking where to start, learn Lisp and C.
Miho Iwakura · 2021-01-10 11:51
>>23843
https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html
>We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.
>A computational process is indeed much like a sorcerer's idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer's spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform.
Lady Jessica · 2021-01-11 01:21
>>23843
You need to start with a goal in mind. Want to make games? Websites? Android/iOS apps? Chat programs/bots? Databases? Want to learn how to crack old ciphers? This is like trying to learn carpentry: what you need to make a deck, or a pretty box, are totally different.
Don't listen to this >>23844 LARPer though.
Jens Hansen · 2021-01-11 02:46
>>23843
Ignore the fact that there are hundreds of programming languages, most of them are for all intents and purposes exactly the same as far as a learner is concerned and after learning one most other languages will look immediately familiar. The mentality in >>23863 is an easy mistake to make, don't concern yourself with what you want to do after you've learned how to program. When learning computer science the first hurdle you should concern yourself with is learning how to instruct a computer.
What you should be concerned with as a learner is how quickly you can receive feedback and how high in quality that feedback is. Scheme/Racket as >>23848 suggests is very good for that. Python is another. If you want to do things on the web there's a Javascript console you can muck about with in every modern browser (inspect element -> console). Visual Basic 6 is what I started learning with and having a very fast turnaround between typing something and experiencing an error was invaluable.
Cutter · 2021-01-11 03:33
can someone please tell me what is wrong with my script.
#include "C:/Users/dalmo/Downloads/std_lib_facilities.h"
#include <math.h>
double a, b, c;
vector<double> v = {};
using namespace std;
double quadeq(double a , double b , double c)
{
cin >> a >> b >> c;
float root = ((b * b) - (4 * a * c));
double x_1 = (((-b) + (std::sqrt(root))) / (2 * a));
double x_2 = ((-b - std::sqrt(root)) / (2 * a));
v.push_back(x_1);
v.push_back(x_2);
if (root < 0) {
throw;
}
for (int i : v)
cout << i;
return 0;
}
int main()
{
try {
quadeq(a, b, c);
}
catch (runtime_error)
{
cerr << "error";
return 1;
}
return 0;
Colmerauer · 2021-01-11 05:31
>>23866
It's amazing that you remembered to check for negative root, but only after taking the square root of it, which makes the check completely useless. You should take the square root only after confirming that root >= 0, not before it.
Jens Hansen · 2021-01-11 07:18
>>23864
>don't concern yourself with what you want to do after you've learned how to program
>don't concern yourself with what you want to build after you've learned how to use powertools
jesus christ fuarrrk off, retard
Ishikura "Tatsu" Tatsuhiko · 2021-01-11 10:51
>>23868
You haven't thought this through. Did you buy your first language a wedding ring? Was it really that hard to transition to a new language after learning the first? Your primary concern when choosing a first language should be to learn what programming even is in the first place not which specialization you're going to pursue; that would be making a choice well ahead of a time when you have any information on how to make it. No matter what you end up programming in the end you need the same foundation.
Unknown · 2021-01-11 11:45
>>23866
>for (int i : v)
Sabo Engle · 2021-01-11 16:17
Not sure if this is the right thread but I'll give it a shot:
Are there any easy to use tools that I feed some data and they give me a function that ouputs that data? I can produce a huge CSV with inputvalues b,c for the function a(b, c) as well as the result a, the program should then help me find a function a(b,c).
I could solve it myself but it would be way easier and quicker if there was some tool that would do it for me, it shouldn't be too complex I guess.
Terzibashjian · 2021-01-12 06:05
I'm making a Beat 'em Up game from scratch in JavaScript. It's still kinda barebones and buggy, but already playable:
The game:
https://qrayz.itch.io/robman-game
The source code:
view-source:https://v6p9d9t4.ssl.hwcdn.net/html/3204691/BeatEmUp/index.html
Ivan Petrov · 2021-01-12 06:12
>>23888
whoops, a little mistake
An updated source code
https://v6p9d9t4.ssl.hwcdn.net/html/3204725/BeatEmUp/index.html
Knuth · 2021-01-12 06:21
>>23888
>>23889
I also provide the source code as a text file
Meddler · 2021-01-13 19:03
>>23869
>our primary concern when choosing a first language should be to learn what programming even is in the first place not which specialization you're going to pursue; that would be making a choice well ahead of a time when you have any information on how to make it.
Pretty much this. Self-taught beginners spend way too much time worrying about which language to start. This is silly because they'll eventually learn at least half a dozen languages, they lack the experience to judge programming languages, and they live in a world filled with successful old people who started with BASIC, a vilified programming language. There's no reason for anyone to think their *first* language is a serious commitment.
>>23863
>You need to start with a goal in mind.
This has not been my experience. I spent a lot of time reading programming language manuals and creating projects to solidify what I've learned.
null · 2021-01-13 19:06
>>23868
Did you consider that maybe you've misunderstood someone?
>(don't concern yourself with what you want to build) after (you've learned how to use powertools)
>don't concern yourself with (what you want to build after you've learned how to use powertools)
Zhora · 2021-01-14 01:13
How can I work with diagrams of fluids?
Pulse · 2021-01-14 03:27
>>23871
Unless you already know how to make primitive machine learning constructs I don't think there's an easy tool for you.
This sounds suspiciously like a machine learning problem. You want to map out what the inputs do to effect the output and basically reconstruct the function based on that analysis. The jargonese way of saying that is that you're trying to find the topology of the function. If you want to figure out machine learning this might be a good excuse to look at something like pytorch and watch a couple of videos on back propagation neural networks.
Anonymous · 2021-01-14 14:52
Is it a known interview tactic to act bored as hell like you don't give a soykaf about what the candidate says anymore? Yawn and roll your eyes, etc. Am I just stupid?
Agent Smith · 2021-01-14 17:36
>>23932
>Is it a known interview tactic to act bored as hell like you don't give a soykaf about what the candidate says anymore? Yawn and roll your eyes, etc.
No, that is not a popular interview tactic.
Yu-ichi · 2021-01-14 17:38
>>23888
>>23889
>>23890
This is cool. Good luck smoothing out the controls.
dictionary · 2021-01-15 07:48
>>23935
What should I do when this happens? Play along diligently for the next few hours, or find an excuse to cut the interaction short and avoid wasting the rest of my day in a psychological abuse session?
Hagbard Celine · 2021-01-16 03:53
>>23949
maybe they have no intention of actually hiring anyone and are just pretending to try to hire people before getting a bunch of h1b1 slaves.
Iverson · 2021-01-16 14:12
How can I come up with good variable/function names?
Joey · 2021-01-16 18:19
>>23977
Read sum code.
Preferably similar things, but just in general it's good too, to get an idea of conventions.
It gets easy pretty quickly.
Turing · 2021-01-17 18:20
>>23970
I'm pretty sure I'm just stupid.
Judge Fang · 2021-01-22 02:29
What's the best way to compare data between an SQL database and Mongo?
Nobody special · 2021-01-23 19:00
I want to test how good my text captcha implementation is, I am guessing that the most effective attack is using AI, but I know nothing about AI so what is the quickest way to implement a neural network that attempts to break it? Pic related.
null · 2021-01-24 02:12
Do people actually use specific software to edit .json files?
I thought you'd at most install some plugin in vim/emacs/vscode to improve searching.
Crazy Jake · 2021-01-24 08:20
>>22755
If you have so much free time you might as well do it. It sounds like you are interested since you mentioned Arch.
Terzibashjian · 2021-01-24 16:53
Where else can I check jobs aside from Glassdoor? I'm interested in security and I've been wanting to find out if I could get something in the area locally, but so far it seems I can't, plus most of what I've found regarding security in a nearby multinational is intertwined with US security, i.e. intelligence agencies and army, requiring extensive background checks, American citizenship, and so forth. I don't really want to live in America but I get the impression that's not really an option if I want to get into security and be more than some clerk analyst.
Mind you, this is all me trying to find out more about the area, I'm still very much a noob.
Demeere · 2021-01-27 22:11
Anyone uses mocking for unit testing?
How do you handle file uploads/downloads?
Koichiro · 2021-01-28 00:27
Hey Lainons.
Currently, I'm programming in C++, and I have some questions
>what's the best style to write in C++?
>how can I use correctly chars and strings?
>some tip to write in C++?
>some good book for learn C/C++?
Lain Iwakura · 2021-01-28 01:42
>>24172
There is no best style. Find anything online and stick to it. Just having a singular style will help.
Based off your questions, I think the more important thing is understanding the language at all.
Read C++ early objects if you’re new to programming as a whole. (Which I assume you are)
if · 2021-01-29 11:36
Sup lambda I got a question, is the following course a good way to learn Java? I haven't programmed in like years and am about to finish up my CS degree. https://www.youtube.com/watch?v=KkMDCCdjyW8&list=PL84A56BC7F4A1F852&ab_channel=Stanford
Also, when I tried to check for hw from his video series I only found stuff in python does anyone have an archive or something for the old homework?
Just another Random Lainon · 2021-01-29 12:12
>>24172
handmade hero really helped me.
also keep it mind that you can statically allocate most things. (declare variable outside of functions and structs/classes)
and static allocation is performant, simple, and removes the hassle of messing around with allocating memory and tracking pointers.
heap allocation is still necesssary sometimes but a lot of things can be statically allocated.
William Holtzer · 2021-01-29 13:19
>>24172
>some good book for learn C?
The C Programming Language 2nd edition (aka K&R) and 21st Century C by Klemens
>some good book for learn C++?
For a complete beginner who hasn't programmed much before, I recommend Programming: Principles and Practice Using C++ (aka PPP2) by Stroustrup. If you already know how to program in some other language, I suggest reading C++ Primer by Lippman et. al.
Use https://en.cppreference.com/w/ as your reference. Read https://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html
Use valgrind and use lint/static analyzer to check your code. Learn to write and use makefiles: https://makefiletutorial.com or https://www.cs.swarthmore.edu/~newhall/unixhelp/howto_makefiles.html
Follow a coding style, for example the OpenBSD style: https://man.openbsd.org/amd64/style.9
For other resources, check https://github.com/fffaraz/awesome-cpp (C++) and https://github.com/oz123/awesome-c (C)
/* See https://suckless.org/coding_style/ for explanation why this is the best way to write function definitions */
static void
usage(void)
{
eprintf("usage: %s [file ...]\n", argv0);
}
Also, some useful gcc/g++ flags (obviously you shouldn't enable multiple optimization -O flags or set the standard -std= multiple times):
-Wall -Wextra -std=c99 -std=c++17 -pedantic -O2 -Os -Og -fno-omit-frame-pointer -fverbose-asm -fsanitize=address -fsanitize=undefined -g3
>>24200
I never was able to learn programming from videos alone. For me, reading books and starting to program ASAP are better choice. It has been some time since I read the book that introduced me to Java and it's probably out of date now. Head First Java is one of most popular Java books for beginners and Learning Java: An Introduction to Real-World Programming with Java seems fine, too. Read either one of them and modify the examples and do the exercises in the book. After that I recommend reading Java: The Good Parts and Head First Design Patterns (even though design patterns are mostly just brain damage, you need to be familiar with them)
Using Apache Ant is fine if you don't add any external 3rd party libraries to your project but once you need to use them, learn to use Gradle or Maven.
P.S. check out https://github.com/akullpp/awesome-java for helpful links.
William Holtzer · 2021-01-29 13:54
>>23843
>hey anons the problem I have with programming is that there's just way too much soykaf to learn and way too many programming languages like.
As >>23844 said, start with something simple like Scheme (a very simple lisp. See >>>/r/23678 and read Little Schemer) or C (the language of UNIX/Linux. slightly harder than Scheme or Ruby or Lua. read K&R). Alternatively, learn Ruby (basically better version of Python) (See >>>/λ/24109 ) or Lua (a simple language that's meant for embedding it into programs) ( https://www.lua.org/pil/contents.html )
If you don't know which to pick, just learn Ruby.
>>24205
>I never was able to learn programming from videos alone. For me, reading books and starting to program ASAP are better choice.
I was trying to say that, for me, reading a book and then supplementing it with watching videos was the best way to learn (i.e. I focus on the book not the videos)
I know you didn't ask this, but if you are interested in C#, I recommend Microsoft Visual C# Step by Step by Sharp (and using .Net Core and VScodium instead of Visual Studio), but Java/JVM is actually the better choice and the better "ecosystem" (libraries and tools), even though C# is actually a Java clone and thus pretty much the same language.
Apoc · 2021-01-29 17:53
At what point when learning to program do you begin to be able to build non-trivial programs? I've been trying to learn C++ for almost 5 months and the most complicated program I've made is a letter generator that uses vectors and wordlists. I know it's a grind, but I'd hoped that I would be a bit further by now.
I should probably put more effort into studying.
The Oracle · 2021-01-29 17:55
>>24214
Makes me feel like I'm not creative enough because I can't think of any good projects to work on
Nanashi No Gombe · 2021-01-30 23:05
How do I effectively get started with contributing to open source projects? I'm always lost trying to learn the codebase and often confused about what people actually want in terms of contributions.
Tank · 2021-02-01 19:20
>>24233
Most opensource projects have a discord/irc/mailing list that can help you out.
Other than that, look at other people's commits that get merged into the mainline, and try pull requests of your own that follow similarly.
Random · 2021-02-02 23:14
>>24233
Fix things you find annoying, failing that, look for some low hanging fruit on the bugtracker as an excuse to get to know maintainers and contributors.
Tyrell Wellick · 2021-02-03 17:14
What is the best way to learn PHP right now if I'm starting from scratch? There is a book called Learn PHP 8 by Steve Prettyman, but it really needs another pass had at it by the editorial team.
progn · 2021-02-04 20:29
>>22485
How come the intuitive definition most people have of open source software is "the source code is publically available" but this is something that's not enforced or even defended by either the FSF or the OSI?
XERXES · 2021-02-05 09:06
>>24315
>How come the intuitive definition most people have of open source software is "the source code is publically available" but this is something that's not enforced or even defended by either the FSF or the OSI?
1. Most projects these people see is when code is public
2. Most code that is not public these people don't see and don't hear about. Many people are not ware about amount of code that is being developed with preservation of all freedoms of end client. Also many programmers are not aware that technically speaking they are developing Free Software for their clients in situations where client has all freedoms preserved after product is released to them. Good portion of webdev and custom business systems development works that way.
3. Many programmers with years long experience in programming business never even bothered to understand GNU GPL - I even saw examples of professional programmers working on GNU GPL only projects for living (under NDA, occasionally after some time agreed with client code was being published to the masses) for years not understanding many aspects of GNU GPL
4. There was FUD campaign from corpos (at least Microsoft was involved) around year 2000 more or less that was all about spreading various bullshit and lies about Free Software.
let · 2021-02-05 11:20
>>24324
Thanks for the explanation.
>Also many programmers are not aware that technically speaking they are developing Free Software for their clients in situations where client has all freedoms preserved after product is released to them. Good portion of webdev and custom business systems development works that way.
Doesn't that technically not count because, even if the end client is the sole user and retains all four freedoms, he's not legally obligated to pass those freedoms on to any new users he chooses?
>There was FUD campaign from corpos (at least Microsoft was involved) around year 2000 more or less that was all about spreading various bullshit and lies about Free Software.
Amazing how you can trick people into misunderstanding a three pages document.
Terzibashjian · 2021-02-05 12:07
>>24330
>Doesn't that technically not count because, even if the end client is the sole user and retains all four freedoms, he's not legally obligated to pass those freedoms on to any new users he chooses?
Ownership of software and using a software are 2 separate topics and the licensing is 3rd separate topic. You are most probably confusing these three terms with each other.
Owning software is separate from owning license. Owning a copy of software is separate from owning software or owning license. Using is also totally separate.
You can own a copy of GNU GPL covered software but you may not own license to it. By using such copy you would violate copyright law.
Imagine you work for corpo on corpo owned PC with software installed by corpo that corpo has GNU GPL license for. For sake of clarity let's say that soft is a custom modification of some spreadshirt that implements some magic making calculations for your division easier. Corpo as owner has all freedoms preserved. You are just merely using that software on not your computer. You has no license for that software. You have no rights to study or modify source code. If you copy that software - you get into possession of copy of that software but not into possession of license to that software. You have no license to it because license was not granted to you by owner of a copy. You were only granted the right to use it on computer owned by corpo. Getting granted right to use it on not your computer is not the same as getting license. Therefore you have no right to copy that software. Therefore you broke the law by copying it. You may face prosecution. Also passing copies of that software to others is violation of law.
As to having to distribute sources to all users using that software on not their machines while interacting with software run on that machine- only free software license known to me that forces such action is Affero GNU GPL. Regular GNU GPL does not force that. This is for example your univ don't distribute you copy of their mailing server demon if they use for example Exim that is GNU GPL covered. You are simply using/interacting with exim on not your machine when you connect to server.GNU GPL don't force distribution of code to you in such cases. Affero GPL on the other hand does force them to distribute code to you. So if they were using some other mail server demon licensed under Affero GNU GPL - you have right to get code distributed to you.
Drano · 2021-02-05 12:20
>>24331
Owner (of the copyright) of the software on the other hand can distribute software to anyone owner wants under any license owner wants.
Owners of licensed free software copy who distribute software to others grant them license to do so.
dup · 2021-02-05 12:38
>>24332
>>24331
https://www.gnu.org/licenses/gpl-faq.html#StolenCopy
https://www.gnu.org/licenses/gpl-faq.html#NoDistributionRequirements
https://www.gnu.org/licenses/gpl-faq.html#v3CoworkerConveying
https://www.gnu.org/licenses/gpl-faq.html#v3VotingMachine
https://www.gnu.org/licenses/gpl-faq.html#HeardOtherLicense
https://www.gnu.org/licenses/gpl-faq.html#DeveloperViolate
plus also interesting section
https://www.gnu.org/licenses/gpl-faq.html#DevelopChangesUnderNDA
Honore de Ballsack · 2021-02-05 20:39
What is the ultimate technology stack for making cross-platform desktop GUI apps?
the criteria are the following:
- cross-platform-ness (bigger the scope - the better, Linux/macOS/Windows is the minimum);
- relatively good performance;
- no dual licensing/freemium model;
bonus point:
- UI customisability (relative ease to make fancy effects and animations if needed);
- relatively new toolchains, that won't get obsolete in 5 years.
additional info:
1. QT is under consideration, but dual-license model scares me. Is it possible to sell compiled binaries of QT-based apps?
2. GTK+ is another story. Is it actually customisable? I've only seen GTK apps which looked like it was ripped from GNOME.
3. Is Electron even worth attention?
4. I don't know any programming languages yet, so i'm starting fresh. Right now i started reading introductory book to C as a means of familiarising myself with the basic programming concepts
Agent Richard Gill · 2021-02-05 20:39
>>24331
>>24332
>>24333
I get it now, thanks a bunch.
Undisclosed · 2021-02-05 20:44
>>24340
>1. QT is under consideration, but dual-license model scares me. Is it possible to sell compiled binaries of QT-based apps?
Yes. Either license allows you to sell copies of the program, just make sure to properly study the GPL beforehand to make sure you know what you're doing.
>3. Is Electron even worth attention?
It's comfy.
Honore de Ballsack · 2021-02-09 17:55
what is the Lainon's opinion on these two pieces of very similar technology to the point of completely inter-changable codebase between the two in some cases:
https://platform.uno/
https://avaloniaui.net/
?
the former is more focused towards desktop (with mobile support announced to come some time later),
the latter was more focused towards mobile, and could also compile to web (XAML > HTML/CSS, C# > Wasm)
Nguoi La · 2021-02-10 09:12
Hey guys, I got this idea but I don't know if it's possible so please give me feedback.
Javascript is hated due to its security weaknesses.
I found a website where a guy figured out how to get Pong running in-browser purely with HTML5.
What if one could use HTML5 in a way such that you could create a webpage that has the Javascript functionality but without actually using Javascript? Like, you could use HTML5 to make some kind of VM that runs the webpage with what looks like JS. Do you think such a thing is feasible?
cond · 2021-02-10 10:15
>>24409
The issue isn't unique to javascript, the issue is having random websites being able to execute arbitrary code on your system. If you have HTML, CSS or anything else take on that full featured code execution role then you've just shifted the problem.
Turing · 2021-02-17 19:25
>>24409
People are working around their disdain for Javascript as a language with WebAssembly. This lets people do web development with languages that aren't Javascript.
https://webassembly.org/getting-started/developers-guide/
https://webassembly.org/
> WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.
Dox · 2021-02-19 16:46
what is considered the orthodox python library for handling GET and POST requests and their parameters for a normal web API?
Hong, Guil Dong · 2021-02-19 18:06
>>24539
https://pypi.org/project/requests/
https://realpython.com/python-requests/
>The requests library is the de facto standard for making HTTP requests in Python. It abstracts the complexities of making requests behind a beautiful, simple API so that you can focus on interacting with services and consuming data in your application.
Pris · 2021-02-19 19:02
Is it worth learning a bit of x86 assembly along with C for debugging purposes?
Roger Pollack · 2021-02-20 23:39
>>24542
Not knowing C and at least theoretical concepts of assembly is a mark of illiteracy among programmers.
() · 2021-02-22 06:15
>>24542
As someone who learned x86 assembly a long time ago, this is how I benefited from it later in life.
- I'm more careful, because with assembly programming, the smallest mistake could lead to a crash. Carefulness was instilled in me by my desire to avoid frequent crashes.
- My grasp of pointer arithmetic is good, because it's less ambiguous in assembly than it is in C, and you see what's really happening.
- I'm very comfortable with bit manipulation, and I was even able to use it once to collapse many thousands of boolean values into a much smaller bitmap that made some client-side Javascript much more efficient.
Beyond that, assembly programming is not as hard as it's made out to be. It's imperative programming with very very small pieces, so that's what most people find difficult, but it's not. Just think of your CPU as a calculator that can do basic math like add and subtract and move values in and out of memory. If you can use a calculator, you can program in assembly.
Lady 3Jane.. · 2021-02-26 01:27
What are the best niches to look for in CS if I don't want to work with the "modern IT crowd"? The first thing that comes to mind is low level stuff like microprocessors, but I have a major disadvantage in that for being in CS instead of CE or EE. On the other hand, I love stuff like operating systems but there aren't many jobs for it unless you're some savant doing research.
Unsigned · 2021-02-26 09:32
>>24639
>What are the best niches to look for in CS if I don't want to work with the "modern IT crowd"?
avoid code monkey jobs and avoid being "mr. install drivers for my printer" type (pseudo)administrator in offices
being good at mathematics helps
>The first thing that comes to mind is low level stuff like microprocessors, but I have a major disadvantage in that for being in CS instead of CE or EE. On the other hand, I love stuff like operating systems but there aren't many jobs for it unless you're some savant doing research.
there is truckload operating system related jobs outside research
no, you don't need CE or EE to work in microprocessor related jobs
you just know soykaf about market
but so did I when I entered market
i cant write any more specific stuff as it all depends on which country you are located in
Chan Siu Ming · 2021-02-26 09:44
>>24639
If I were young again, I'd take a serious look into algorithmic trading. Automate the money making process, and minimize wageslavery.
Miho Iwakura · 2021-02-26 09:58
>>24648
>>24648
>If I were young again, I'd take a serious look into algorithmic trading.
Are you 85 and on verge of deathbed to not look at it now?
Erik Johansson · 2021-02-26 20:43
>>24649
I'm working on automated trading too, but I wanted to imagine the question from his perspective. If he asked the same question 20 years ago when the dotcom bust happened, before bitcoin was invented, before exchanges exposed their functionality with APIs, before an impending "Great Reset", ...my answer would have been different. Perhaps it would have been more mundane. Perhaps I wouldn't be so against working for another man 20 years ago. Unfortunately, these are luxuries he doesn't have anymore. For the sake of his dignity, I think it's more important now than ever before to seek financial independence.
Bad people have always used money as a weapon of control, but 20 years ago, it was used more as a bribe to lure you to the devil. That's still bad, but the power dynamic has changed dramatically. Nowadays, if feels like if you don't BOW DOWN, you're going to get cancelled and deplatformed. They'd kill you if they could, so I'm saying don't let them.
Mario Rossi · 2021-02-27 01:21
>>24645
Do you think it's possible to understand the market before being in it? I've looked for more information many, many times but I always stumble only onto superficial stuff. But what I do hear from people working in the area all the time is that there's a huge push for front end stuff in my country. Although it has always been what interests me most, I get a bit scared away from more complex stuff, mathy or not, because the people doing well in it always seem to have started pretty early and that's not my case, it seems like I won't be able to catch up.
Well, I did try doing some stuff when I was 12 or something but I fuarrrked my computer by following advice from tor forums, which made me stay away from it for years.
Lord Nikon · 2021-02-27 01:50
>>24667
what you wrote here it's an incoherent mumbling without making the point
wait until drugs you are on wear off before posting
>>24683
you can get some points by doing a proper "intel" beforehand
recruitment fairs, talking with employees, reading texts from the field
>here's a huge push for front end stuff in my country.
this is among the most monkey style job imaginable and a bubble with tons of competitors per single position
if you become front end "programmer" you literally scream "I wasted my college/univ years" to the world as that monkey job barely requires any higher education
>Although it has always been what interests me most, I get a bit scared away from more complex stuff, mathy or not, because the people doing well in it always seem to have started pretty early and that's not my case, it seems like I won't be able to catch up. Well, I did try doing some stuff when I was 12 or something but I fuarrrked my computer by following advice from tor forums, which made me stay away from it for years.
LOL, I sarted early in my field and I know guys who started much later (univ) and they literally toured the world with internship in top companies. You may dude need a psychotherapy in my opinion as you have very low self esteem. Even in you front end monkey job you most probably are going to be very low paid with such attitude. If you are really slow or started something late it just means you need more work. Not that it's impossible.
Shogun · 2021-02-28 18:47
>>24684
> toured the world with internship in top companies
I didn't even know that was a thing for anyone but superstar programmers who could already hack a bank at 15yo, wtf.
swap · 2021-03-01 00:29
>>24720
people who started early are often overqualified at end of univ/collage
people who started at univ/collage are starting early enough to be valuable enough for most companies if they work hard enough
Hiro Protagonist · 2021-03-01 01:25
>>24720
>>24725
Not to mention lots of unis do industrial placements for students, which naturally means they're more valuable once they finish their degree. I don't see how anyone could do this and still have trouble looking for a job (after all it basically means you take a year out of uni to do a real job™) so it makes sense to look into that if you're worried about jobs and have the means to get involved.
Hacker · 2021-03-01 15:45
What's the best platform to start learning how to develop drivers on? I don't really like Linux's approach of "use a module or recompile" but at the same time Windows (NT) doesn't have much documentation available for just a hobbyist. Is BSD an option?
Random · 2021-03-02 14:59
Minimal set up for developing in C++?
I used to use VSCode for challenges and Visual Studio for larger projects, but now since I'm on arch I want something minimal yet practical.
Pulse · 2021-03-04 21:15
>>24737
>What's the best platform to start learning how to develop drivers on? I don't really like Linux's approach of "use a module or recompile" but at the same time Windows (NT) doesn't have much documentation available for just a hobbyist. Is BSD an option?
Why would be not?
FreeBSD is used by many companies that need maximum performance possible from it's TCP/IP stack. Netflix uses it, some telecoms here and there use it etc.
Tequila · 2021-03-04 21:17
>>24741
for example this trio: g++, rtags, vim
synchronized · 2021-03-05 23:33
>>24741
Neovim from git, g++ and clangd for a language server.
And for some reason my message has to be longer to be submitted.
Nobody important · 2021-03-10 17:44
What was the C book that had a fish on the cover? I think it might have looked something similar to pic related, but not sure. I feel like the fish might have had it's mouth open more, and be in different spatial orientation.
Incognito · 2021-03-10 17:46
>>24808
Nevermind, found it. It was Expert C Programming: Deep C Secrets.
Agent Richard Gill · 2021-03-11 18:20
>>24809
>Deep C Secrets
>Not Deep C-crets
What a waste of potential.
Lukasiewicz · 2021-03-11 20:08
So I've been rereading K&R but this time making notes and such, and this section is confusing me. Aren't all of these actually definitions? They certainly allocate storage to these variables right? I mean, I know definitions are also declarations of sorts, but isn't all of this literally definitions? What am I missing here?
Lady Jessica · 2021-03-11 20:39
>>24823
Yes, all of these examples are allocating space. A declaration is when space is allocated for a variable. Definition is when it is assigned a value. Before a variable is defined, it is marked as null to prevent accidentally using garbage data.
Random · 2021-03-11 21:16
>>24827
Doesn't that clash with the ANSI C standard?
>A declaration specifies the interpretation and attributes of a set of identifiers. A declaration that also causes storage to be reserved for an object or function named by an identifier is a definition ./47/
https://web.archive.org/web/20161223125339/http://flash-gordon.me.uk/ansi.c.txt section 3.5
>Before a variable is defined, it is marked as null to prevent accidentally using garbage data.
By null do you mean 0? Doesn't that apply only for extern and static variables?
Not trying to pick a fight, just trying to understand.
P.S. Screw the guy who's spamming and getting nodes derezzed. What a piece of trash.
Nameless · 2021-03-13 16:51
Do I need some sort of prerequisite when learning how to code? I've tried on and off to learn programming and I can't seem to make it past the first step. I know that the main principle of it is make something that works, then make it faster, then make it quickly. Yet I am unsure how to go about this.
Switch · 2021-03-13 17:02
>>24864
I don't understand what do you mean by the first step. Programming is about making fun and (less) useful things, not the soykaf you listed. If you think your program is not fast enough, rewrite it in a faster language (very cumbersome), rewrite parts of it in faster language (better), benchmark it and rewrite the problematic code (the easiest). You seem to be treating programming like some kind of a chore, a job. If you don't enjoy the thrill of making things happen by typing commands into a text editor, then maybe try looking for a different hobby?
The prerequisites would be a working search engine, time, average IQ and most importantly actual interest in programming. I don't really know what to tell you beyond this, maybe if you elaborated I could do better.
Sabo Engle · 2021-03-13 19:01
>>24864
I think you're focusing on the wrong thing, or at least I don't identify the core struggles new programmers are likely to have in what you cite as a core principle.
The first and most important hurdle is to understand how a computer thinks. Depending on what language you're working with you might find it instructive to code entirely in a terminal interacting with something like Python or Scheme, not writing full source files but line by line sequentially working with the system.
Roger Pollack · 2021-03-13 20:02
>>24867
I could try to do it in a terminal. Usually I just use Mousepad to do it.
Molly Millions · 2021-03-13 20:07
>>24865
No, you, said everything you needed to.
Lain Iwakura · 2021-03-13 20:44
>>24864
https://www.python.org/ --> Download
http://www.composingprograms.com/
Honore de Ballsack · 2021-03-13 21:57
>>22485
what approach for writing UI is better? (easier to develop, more modular, easier to maintain)
- the one where the UI is coded directly with the programming language
- the one where UI is rendered from markup file (XML / XAML / whatever)
?
katy · 2021-03-13 22:07
>>24874
The one where your UI is a browser.
Webshits do a long wrong, but one of the few things they do right is the single pane of glass concept. Normal GUIs are pretty ass. Applications that are clis + web interfaces should have caught on a long time ago.
Cereal Killer · 2021-03-14 03:39
I'm writing a small webserver in C and I want to accept -> fork but I would like to do so without blocking. Every example I've seen online uses select and a list of sockets... isn't there an easier way? I only want to be able to wait for the accept, I don't need to wait and see if the client sockets are ready for reading/writing.
Wintermute · 2021-03-14 04:28
>>24879
accept can be nonblocking. just set the SOCK_NONBLOCK bit. https://man7.org/linux/man-pages/man2/accept.2.html
Turner · 2021-03-14 22:31
Background: I am a fledgling data scientist who just got a masters degree in the topic. I know some C, python, and R.
So far my entire programming experience has simply been using black box functions to build statistical models from data. I also have some experience making GUIs that utilize said models. All this work has seemed to be very surface level programming and I want to dive deeper into the discipline. I'd like to start out by writing my own libraries to automate some basic tasks, like checking when my most recent anime I'm following has been posted on some database.
Is there a good pipeline out there to follow for people who have some general experience with coding but wants a deeper dive into the discipline?
Otto Normalverbraucher · 2021-03-15 10:34
Hello, guys. I've been learning Python for about 4 months and I can't write anything with it. Ofc, I can solve any mathematical problem, or something with strings, lists etc, but something visual, for example a snake game or a Minesweeper or some parcer, bot, script...it is impossible for me and I don't understand how to begin writing something valuable.. maybe you know some books, or advice - please, let me know. Maybe I should change programming language?
P.s sorry for my bad English, I am from Russia
And sorry for this, maybe stupid, question
shotaro · 2021-03-15 14:18
Sorry if this is a soykaf forehead slap question (and additionally I know Tsuki can be a sore subject on these chans occasionally)...
Could any expeirenced web devs give me an idea on how difficult it would be to design a website similiar to the original Tsuki project website? religious bullshit aside, it and a few of the other similiar websites I found through the old arisuchan were some of the most intriguing soykaf. I've got a class on web design, which will inherently come with a web site design assignment and I'd like to do something similar. Would it be biting off more than I can chew for a second year with only a bit of previous HTML / CSS exp? I'm not an autistic wunderkind either. Inspected the code on the hosted mirror and nothing in it seems tooooo crazy but at the same time that also makes me think I'm under analysing it. Any feedback apprecaited.
Guthrie · 2021-03-17 14:13
Why is the ternary operator crippled in Java?
Consider these two code snippets
>C
#include <stdio.h>
int main (void) {
int i = 5;
(i <= 5) ? (i = 10) : (i = 0);
printf("%d\n", i);
} Produces 10 as expected.
>java
public class niggy {
public static void main(String args[]) {
int i = 5;
(i <= 5) ? (i = 10) : (i = 0);
System.out.println(i);
}
} Produces
niggy.java:5: error: not a statement
(i <= 5) ? (i = 10) : (i = 0);
^
1 error Why? I assume it has to do with the retardation of Java glitterboys who thought it was a good idea to throw a compiler error when you ignore the value of an expression, but I don't know. If you put a dummy variable b = expr it works, which is fuarrrking stupid.
() · 2021-03-17 21:02
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.8
"""14.8. Expression Statements
Certain kinds of expressions may be used as statements by following them with semicolons.
ExpressionStatement:
StatementExpression ;
StatementExpression:
Assignment
PreIncrementExpression
PreDecrementExpression
PostIncrementExpression
PostDecrementExpression
MethodInvocation
ClassInstanceCreationExpression
An expression statement is executed by evaluating the expression; if the expression has a value, the value is discarded.
Execution of the expression statement completes normally if and only if evaluation of the expression completes normally.
Unlike C and C++, the Java programming language allows only certain forms of expressions to be used as expression statements. For example, it is legal to use a method invocation expression (§15.12):
System.out.println("Hello world"); // OK
but it is not legal to use a parenthesized expression (§15.8.5):
(System.out.println("Hello world")); // illegal
Note that the Java programming language does not allow a "cast to void" - void is not a type - so the traditional C trick of writing an expression statement such as:
(void)... ; // incorrect!
does not work. On the other hand, the Java programming language allows all the most useful kinds of expressions in expression statements, and it does not require a method invocation used as an expression statement to invoke a void method, so such a trick is almost never needed. If a trick is needed, either an assignment statement (§15.26) or a local variable declaration statement (§14.4) can be used instead."""
sage for racism and "The mods [...] are trying to ensure the quality of lainchan"
Pris · 2021-03-18 12:57
>>24923
>sage for racism and "The mods [...] are trying to ensure the quality of lainchan"
lol
nil · 2021-03-21 17:04
Is it even possible to modify Djikstra's two stacks expression evaluation algorithm to work without parentheses, or should i just use a binary expression tree instead?
push · 2021-03-23 13:31
if i want to become a jack of all trades in thre programming field what would be the best route to do so?
Dozer · 2021-03-24 21:09
>>22485
What should I do if I want to teach myself computer science without going to an university? What prerequisites should I have, specifically math prerequisites, and what subjects should I study and in what order? I don't really like to use those free online classes from universities since they tend to be on a timer and try to get you to pay for certificates and stuff. I prefer to learn from books most of the time since I have a hard time paying attention to lectures.
Special Agent Bob · 2021-03-25 14:07
>>25002
Answering my own question - yes.
Trinity · 2021-03-26 22:40
>>24872
Thank you, I will definitely use this.
BloodCat · 2021-03-30 07:48
lainons where to start learning CS?
word · 2021-03-30 18:49
>>25159
Find what you want to do. I started in like 2007 because I wanted to make a ron paul website lol. But it made me more interested in computers as a whole so I started getting in Linux and languages like C++ and C I learned and now I have a job doing it. Find something you want to do and do it. Assuming you want a job I would recommend learning about the different fields and what they do and learn things from there. I know that sounds like I'm avoiding the question but thats what I did and it worked.
over · 2021-03-31 07:58
I keep starting and then failing to continue the sort of projects I've wanted to do, and I'm starting to realize it comes down to one specific problem I keep having.
How do I design a system? I know it should generally come first, since understanding how all your code will work together is important, but any system beyond "the terminal communicates with the code" seems to make my brain crash. Am I just stupid? Is there some specific rule of thumb I should be using? I can work on forked projects all the time, but never make my own because it requires doing this.
For example: my current project I want to do is a forum that's written on modern languages but is more of a homage to those PHP bulletin boards, but trying to comprehend the scale of such a thing makes me end up not even laying down the bare bones because I don't know what a skeleton looks like.
Void · 2021-03-31 07:59
>>25165
I want to programming for me but with that i want to find sysadmin job
BloodCat · 2021-04-05 18:36
I'm trying to into Forth a bit, something that keeps popping up but never gets explained in the material I've been reading are words wrapped in parenthesis like so,
: (word) ( stack-effects ) definition ; What does it mean? Most likely to me seems that they're internal helper words not meant to be used directly, but I'd rather be sure and googling returns no relevant results.
sizeof · 2021-04-05 21:29
>>25257
I have never written much Forth, but I think that the parentheses are comments.
https://forth-standard.org/standard/core/p seems to imply that they are only used for execution semantics, but http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm#stk_com says they are stack comments.
Pulse · 2021-04-06 02:41
>>25258
No the comments I'm aware of, as far as I can tell at least the initial opening parenthesis needs to be totally separated from anything else by spaces. These are directly surrounding the word being defined without any spaces between, and occuring separate from the stack comment.
Pic related is an example case (that the word has a sibling word without the parenthesis is just a coincidence, none of the others had such).
renames · 2021-04-17 11:21
Just wanted to patch my post >>25263 with a clearer rephrasing, rather than "These are directly surrounding the word being defined without any spaces between", the parenthesis are part of the word being defined, not separate tokens apart from it.
Tequila · 2021-04-20 11:54
I feel like I spend 99% of my time coding not actually coding or figuring out some algo or how to reduce code smells and make better code, but instead:
-messing with configuration files
-trying to find WHERE files even are
-dependency hunting (usually in the form of "X will let me do A, and Y will let me do B, but X and Y conflict, so what can I do?")
-getting permissions set correctly
-placing files in the right places
-trying to figure out how to fix my system after a necessary update (usually to get another library to even work)
-etc.
Even when I DO do that, then 80% of what I code is just getting the most bare-bones UI to show up and figuring out how to set up the I/O streams.
What am I doing wrong? How can I spend more time coding instead of doing all this monkey setup?
Special Agent Bob · 2021-04-21 02:13
>>25540
What kind of projects (GUI? web? CLI? web APIs? CLI? library?)? How large (thousands of lines of code? larger? smaller?)? What technology stack?
Anamika · 2021-04-21 02:17
I've been programming for years but mostly in high level languages (Python, Perl etc., sometimes C or C++).
I want to learn modern assembly.
Should I start with x86 or x64? Or go with an easier ISA (8080? 6502? some RISC?) and than jump into modern stuff?
Recommended resources are welcome.
Crash Override · 2021-04-21 22:15
>>25554
My uni taught MIPS first. It's a RISC, but still good for getting a handle on working with assembly. If you want to work with x86/64, learn x86 first: x86 concepts transfer over to x64.
Chani · 2021-04-22 00:44
>>25571
And how did you like learning MIPS? Did anything surprise you?
As of learning x86 before x64, yeah, that totally makes sense.
Technician · 2021-04-25 14:51
>>25553
I don't know a good way to answer this. The question assumes that the projects I work on are almost always of a similar flavor. There is no one technology stack, there is no uniform codebase size, there is no uniform case basis of it being a GUI, web, or CLI project. And I guess your questions are making me wonder how can you even manage keeping your projects into singular kinds of projects of technology stacks? There are times where I have to switch to--say--Python because only it has a library I need (e.g., OpenCV), and then I have to figure out the string of actions to get it to connect to the GUI I want (e.g., usually a website). I guess your questions help point out what my issues are, but I know even less about how to approach them now.
Turner · 2021-04-29 01:09
I am learning C# and have made a Console Application using Visual Studio 2019. Now I need to create a regular .exe so it can be run on other computers. A lot of searching and trying all answers I find takes me nowhere. I have made several .exe files but none of them works outside of Visual Studio even on my own computer.
Donna Hawthorne · 2021-04-29 18:11
I'm tired of not being able to get deep into anything thanks to being busy with uni, I was thinking about only doing one or two classes next semester so I can finally feel like I'm actually learning things. I have many books to get through but I would prioritize SICP, Tanenbaum's OS, networks and architecture and CLRS. Would that be a dumb move?
Disclaimer: I'm not one of those people who's used to being hyperproductive on their own, but just following the motions like I'm currently doing has killed my passion for CS and I feel like I'm not progressing at all.
Aristóteles Amadópulus · 2021-04-29 19:19
>>25635
>Would that be a dumb move?
In an abstract sense, no, but I think this question has more to do with practical concerns than anything else. Is this going to delay your graduation? Is it going to cost you money because you have to pay extra tuition? If so, I'd probably not do it.
I do understand where you're coming from. If you're after knowledge rather than a just degree, it can feel pointless to rush through classes too quickly to really absorb the information. You may want to see if you can take a semester-long leave of absence instead. This is usually a better idea than cutting back on classes, due to the way university policy typically works (although this is based on American universities... I suspect you aren't in America so things might be different for you).
>prioritize SICP, Tanenbaum's OS, networks and architecture and CLRS
I think your time would be better spent studying the codebase of an open source project that interests you, with an eye towards making contributions. Not only will this help your career prospects, it will also teach you skills that aren't already covered by your coursework. If you are hoping to go into the more academic side of CS, then reading contemporary papers is also a good idea.
Dozer · 2021-04-29 20:23
>>25638
> Is this going to delay your graduation?
Yes, and that's a concern, but like I said, doing things the current way is killing me inside and it's very likely I won't have the willpower to be productive at all if I don't finally set aside some time to properly study those things, not to mention it'll be harder to make the time for it after I start working and that increases my chances of being stuck in some codemonkey position.
>pay extra tuition?
No.
>American unis
Yeah, I'm not in America. The major obstacle against doing that would be my parents' pressure to graduate as soon as possible, since I wasted some time with other stuff in the past and have to make up for that time.
> studying the codebase of an open source project that interests you
Well, I don't have my eye on anything so I wouldn't even know where to start, plus when I looked at it in the past I could tell I had obvious shortcomings, some of which I hoped to fix by reading books like those I listed. And if it helps to mention it: I highly prefer studying stuff systematically through books instead of looking for them separately online, the only instance where this doesn't make much of a difference would be documentation or web stuff since so much of it is trying things out on the fly or straight away snatching stuff from somewhere else. I hope that after covering some ground I'll finally be able to keep up with projects and maybe contribute something, but as of now I have a lot of catching up to do.
XERXES · 2021-05-02 18:22
After finishing a CS degree. I still feel out of the loop, despite know how to program, but up until recently all my extra projects seemed to fail. Does anyone have any book recommendations to get me on the same wavelength as other professional programmers.
Jim Hilger · 2021-05-02 22:02
>>25673
What do you mean by "extra projects"? Personal side projects or something else?
In my experience, there are two main things when it comes to professional programming:
1) moving around a large codebase;
2) dealing with people.
If you are interested more in a technical side of things, you can check out some existing, possibly open source, project and contribute to it.
But the best way to, as you called in:
> get (...) on the same wavelength as other professional programmers
is to get a programming job.
Spike Spiegel · 2021-05-02 22:03
>>25610
In short: pick a technology you know well and create a project with it.
If you know both the technology, and the domain, you spend much less time with configuration files, looking stuff up etc.
Splicer · 2021-05-02 23:06
>>25682 Sounds like a good idea, but where would you recommend, I start when it comes to finding projects to contribute to. I'm probably missing something important when I find a large project on github, but feel too intimidated to contribute to it.
I should probably try to find the developer's irc or discord channel.
I do have personal projects that are either incomplete and some older failed projects that is filled with OOP spaghetti code, bit I'm not sure if I can pass it off to a potential employer.
array · 2021-05-02 23:22
>>25684
First of all, finish a personal project or two, however tiny. If you don't feel embarrassed about how small it is, it is too large. Define a scope, implement it, test it, write some unit tests, write a README file, open source it, link it in your resume.
Finishing a project will motivate you for further work. Also, when looking for a job, it will be a great signal for a potential employer, especially when you're looking for an entry level job.
Above step is very important. Finish a project.
Later, there are multiple possibilities. One of them is to look for existing open source projects you could contribute to (and joining project's IRC channel or whatever they use). Another possibility is to work on personal projects. Or doing some courses. Or finding a job.
> I do have personal projects that are either incomplete and some older failed projects that is filled with OOP spaghetti code, bit I'm not sure if I can pass it off to a potential employer.
You can post a snippet of your code here to review. I've seen a lot of entry-level candidates' code. I know what technical recruiters are looking at. If interested, I can elaborate on this topic.
Also, what topics are you interested in? Any specific domain or technology? Finding a mentor would be beneficial, consider it.
Meddler · 2021-05-03 00:11
>>25685 This is the most recent project I have been working on. I think one of my problems might be to do with a lack of planning and other soykaf practices.
Even though I know other languages, I decided to do it in javascript, to potentially leverage the potential of knowing webgl, if there is ever going to be a trend for 3D web pages. I wasn't sure whether to post a link to the github page, so I will send a zip file, but, overall there are about 1k lines of code.
pop · 2021-05-03 12:30
>>25686
Review
Hardcoded database credentials: while it is okay-ish for local development, you shouldn't publish your code with database credentials. It's basically a security issue. There are better and still simple options. My favorite one is using environmental variables but some people prefer config files (which you don't commit to the repository).
SQL injection: for example in create_thread.php you take x/y/z values from the (untrusted) client and craft a SQL query using those. The way you do this is a serious security issue. A bad actor can provide malicious input and use your database anyway they want. Search for "sql injection" for more information.
Repeated code/values: for example style in lines 37-39 of file index.html are exactly the same and they probably should always be the same. You can eliminate repetition using a CSS class. It's cleaner and easier for you if you want to modify it in the future. Search for "dry principle" for more information.
Style: 1) sometimes you close PHP tags, sometimes you don't. Keep it consistent and always close tags. 2) Commented out code 99% of the time has no place outside of local development. Either keep it (if it works and does what you want) or just delete it. 3) Formatting is inconsistent. Sometimes you have two spaces in a row; sometimes you have a space before a paren, sometimes not. Use an autoformatted.
It is by no means a complete review. Just a few remarks after a quick glance. Hope it helps.
Tyrell Wellick · 2021-05-03 14:27
>>25698
I sort of knew some of these things, but I probably should overall take myself more seriously, rather than cut corners. I will probably actually decide to follow a methodology, even if it's the water fall method, rather than using the big bang method, which is basically just programming with no planning.
Jane Doe · 2021-05-12 07:28
I'm having trouble programming the algorithm for constructing a Voronoi Diagram of 4+ points. I want to get the vertices of every polygon but not draw them, I'm pretty fuarrrking lost here.
Ishikura "Tatsu" Tatsuhiko · 2021-05-18 16:08
>>25778
"Here's a problem related to yours and solved before, could you use it?" - G. Polya
push · 2021-05-19 11:47
Would it be a good idea to use a random number generator with a seed to generate a password? The idea being you would only have to remember the seed number as a sort of pin number. The intention being to make it easier to remember complex passwords.
Terzibashjian · 2021-05-19 17:43
>>25881
I see two problems with that.
The first is purely theoretical: the entropy of your password is only as high as the entropy of your seed, which won't be very high if it's short and easy to remember. Attackers can only exploit this fact if they happen to know that you're generating your passwords and exactly how, so unless you go around boasting about it in places where it can be linked to your account that's not really a threat to worry about.
The second is practical: in order to retrieve your password, you need access to your RNG so you can type your seed into it, correct? On one hand, if you don't have access to the machine that's running it at some point, you're out of luck. On the other hand, if you do have access to a machine you trust sufficiently, why not use a password manager or encrypted file instead? One of the advantages is that a single master password can unlock all your passwords, so there's less to remember.
In general, I think the established solutions are more practical, but I do see some corner cases where your idea has an edge. If you sometimes need to retrieve your password while you don't have access to your computers, and your RNG is a web service somewhere that has high availability, it should work, and the alternative (some web-based password management service or file host) is worse for privacy.
This being the board and thread it is, I imagine you were thinking of implementing this as a short program you would run locally, and in that case my answer is that a password manager is probably more practical but by all means go right ahead.
Wintermute · 2021-05-20 17:52
I wasn't sure where to ask this but I guess it's more or less on the topic: I have a 12yo cousin who lives in another country and seems to like stem subjects, I don't want to push him towards anything but I think it would be nice to expose him to computing/programming early on, if he likes it he'll have a headstart and if he doesn't at least he'll be more knowledgeable of what's out there. My question is: how can I guide him towards that without being able to be there with him? It's likely that if I simply recommend him to play with something like Scratch he'll get bored pretty soon, I'm thinking of coming up with some sort of project he could get excited about. For example, back when he played Fortnite I thought about how back in the day some people would get into programming to learn how to hack the games they played, but these days a game like that probably has a robust cheat engine and, even if it didn't, it would require more advanced programming, a level he'd take years to arrive at. And since everything's made to be user friendly these days it's not like he needs to program an interface to make his life easier or something, everything he needs is already done, I can't recommend something whose required skill would take years of dedication.
Neo · 2021-05-20 23:36
>>25894
12 years? Let him learn proper programming language.
For sure he can try Python, JavaScript or even a language considered more difficult, like C++.
sizeof · 2021-05-20 23:43
>>25894
Well, youmare in luck, today there's a great deal of resources that c n allow one to make all sorts of things with minimum effort (and one can progressively do more complicated stuff, if one is so inclined.) Idk if he likes minecraft, you can look up some tutorials on making mods for the game (many many other games support this kind of thing, honestly, go look it up for your game of choice.) Usually, making mods relies on very basic programming skills on a relatively simple language, without undue complication. I've never done such a thing myself, however, go look it up and see if it fits the skill of your kiddo. Usually you can find cookbook-style tutorials which any kid that spends time on his computer should be able to manage and it really instills a sense of excitement and accomplishment.
Otherwise, look into something called Unity, which is a full-fledged engine for making games altogether. This one requires more energy to be invested, but that is how I myself got into the topic.
Jens Hansen · 2021-05-21 00:07
>>25881
Don't go telling people but I do generate my passwords from a seed and simple algebraic rules, which I usually do in my head. Of course, there's a limit to how much arithmetic I can do in my mind, but they're rather simple, can generate an arbitrarily long string, and I do try to commit the actual password to memory and just do the math if I forget parts of it or forget altogether what exact password I set. Or I can use a calculator or some other device.
Here's an example:
Take the set of residues of 11^x (MOD 13) (for best results make it two primes), as follows:
(dolist (i '(1 2 3 4 5 6 7 8 9 10 11)) (format t "~s~%" (mod (expt 11 i) 13))) Which yields: 11 4 5 3 7 12 2 9 8 10 6. Translate the numbers >10 to letters of the alphabet, and you have a nice sufficiently jumbled password: B4537C298A6.
Yuki Nagato · 2021-05-21 22:23
>>25900
Simpler still than unity would be game maker studio. It's scripting language is also probably easier to grasp than C#.
Neuromancer · 2021-05-22 15:05
Hhow do i on computer get good at lisp? i aam competent enough now bbut i want to be ok-on computer even more. i only know python 'well', ffor me lisp is most fundamentals, i ddo not know many package or hhave any way to apply. aalso how do i inferior-shell use?
sshoudl i just learning algoritm
hhelping me stranger?
Undisclosed · 2021-05-22 15:24
>>21193
>>22485
Lurk moar Cirrus
Zuse · 2021-05-22 17:03
>>25899
It's not about difficulty but about engagement. I need to make him excited about it, saying "here's a list of projects bro, make sure to look up the documentation" will backfire. Also, I tried to teach myself programming at his age and failed miserably because I didn't have a plan nor discipline, but that might've been counterbalanced by getting involved with a project I cared about.
>>25900
>>25915
I'll take a look into it, thanks.
Mario Rossi · 2021-05-22 18:46
Last year someone talked about a pdf of the TCP/IP guide, no one posted it yet so here it is.
x<->y · 2021-05-22 19:31
>>25927
>It's not about difficulty but about engagement. I need to make him excited about it, saying "here's a list of projects bro, make sure to look up the documentation" will backfire. Also, I tried to teach myself programming at his age and failed miserably because I didn't have a plan nor discipline, but that might've been counterbalanced by getting involved with a project I cared about.
So use a proper language with fun environment, e.g. Java + Minecraft. Instead of linking to the docs, be a mentor. I know you mentioned he lived in another country but for sure – if he has internet access - you can help remotely.
I think that automating math homework (simple CLI apps) might be at the same time approachable, fun and useful.
setq · 2021-05-22 19:32
>>25930
It's massive, thanks for sharing! (Remember, sharing is caring.)
Did you read (fragments of) it? What did you like? Why do you consider it to be worthwhile to read?
synchronized · 2021-05-22 21:38
>>25926
bbut im not begginers
Lady 3Jane.. · 2021-05-22 22:39
>>25925
Hi Cirrus! I recommend just doing some projects. An IRC-bot perhaps?
Dujour · 2021-05-22 23:42
The usual advise is to read SICP. As for apply, think of a pet project you've always wanted to do.
Gyula Kovacs · 2021-05-22 23:48
>>25925
Is english your 3rd or 4th language?
Anamika · 2021-05-23 02:05
>>25930
Thanks lain. SHA256 checks out. I've been meaning to read this for a while but forgot about it.
d35d703269b454f6ece62a3d17fb8b829bf2581257bdfe6596c310e208d8ef1c
Colmerauer · 2021-05-23 15:50
How do you guys keep up with news in FOSS, programming or the tech sphere in general?
Do you know of any real quality news sites or perhaps mailing lists that are explicitly about showcasing those kinds of developments, either generally, or even better, for some niche topics?
Case · 2021-05-23 16:06
>>25949
just hit up invidious front page and look at the linuxtubers doing linux news.
protip, use x2 speed since most of the time videos are needlessly extended to 10 mins to be able to be monetized or otherwise not if they have backers. there is a ton of them so they compete and keep it fairly up to date.
roll · 2021-05-23 17:52
>>25934
I went/I'm going in as almost a total noob, so I decided to read it left-to-right, safe to say I'm still doing it. I can say that at least the "Networking Fundamentals" part is so far very good, the author doesn't spare details and present the information as a whole, so I don't feel like it's incomplete and get the need to open a browser and look up things. I'd say he did a great job with the formatting as well.
>>25930
Always glad to help.
Unspecified · 2021-05-23 21:07
>>25949
I use the rss feeds on osnews and lobsters
The Fin · 2021-05-25 22:09
>>22485
Is it possible to become competent at academic math and programming (I'm mainly interested in low-level programming and AI) if I have almost zero knowledge and already in my 20s?
Jens Hansen · 2021-05-25 23:46
>>25970
Yes certainly idk why you would think otherwise. I'm 30 and I'm starting to get the ropes on analysis, classical mechanics, and probability.
But you need to study effectively, otherwise no matter what's your age you won't be getting anywhere.
Guthrie · 2021-05-26 10:42
>>25971
Idk, my classmates (which are younger than me) from university already knew topics like commutative algebra and topology in high school, so sometimes it bothers me if I can keep up with their pace (and they have much more chances of becoming mathematicians I think). I'm not going to stop regardless, just curious.
bit · 2021-05-26 13:54
Best book/resource for SQL? Preferably either without implementation specific extensions, or one that touches on several at once (for example maybe Oracle, MariaDB, Postgres, stuff like that).
aliased · 2021-05-29 01:25
>>25977
depends how much you want to know and for what purpose. if you know sql standard syntax, 1NF, 2NF, 3NF (and strictly follow these) and some other best practices (ex. all columns besides primary key should have NOT NULL constraint, avoid unlimited data types like varchar or text, name your primary keys tablename_id instead of simply "id") then you're pretty much good to go in the industry.
Joe Bloggs · 2021-05-30 21:56
What is the best way of knowing what data structure to use for what I'm doing?
cond · 2021-05-31 01:20
>>26026
>What's the best way of knowing what bowl to use for mixing my ingredients?
Ask yourself what you're trying to achieve, and if you're optimizing for speed or space (it's hard to optimize both, so prioritize one).
What kind of project are you working on?
Morpheus · 2021-05-31 05:37
>>26026
The answer is in describing the solution to whatever problem you're trying to solve. Solving problems with programming requires you to structure how you access data into some hierarchy, simply choose a data structure which closely models that hierarchy for whatever problem you're tackling.
BloodCat · 2021-06-01 00:00
I want to make a little program that plots a graph of BTC prices over time on top of a picture and then sets the result as the wallpaper on GNU/Linux. It should update every 3-5 minutes.
I tought about using Lua at first but I guess Rust is a better language for this. Now, about how to actually do it:
>is it better to collect the data points over the execution of the program and store them locally or try to find a API that feeds me a range of data points (like from 12 hours from now)?
>is it better to try and build the entire image (background and graph) in one go or create the graph first and then composite into the background?
sage · 2021-06-03 10:44
>>26049
What I would do is write a program to fetch the data over the time period you want and export it as a graph with a transparent background. I'd include that in a script that takes the output and composes it onto a background with imagemagick and sets the wallpaper. You can make a cronjob to run it every 5 minutes.
I doubt speed will be a problem unless you need it to update on the second, but you could easily extend this to keep a cache file if necessary.
Shogun · 2021-06-08 05:28
I'm a dumb 25 year old poor person halfway through my CS degree and I want to get my soykaf together and finally graduate as I have been really slow about it.
What the fuarrrk do I have to do to become competent as a programmer? My school teaches C++ and I'm not entirely sure how to get to the level where I'm not a retard compared to the other students. I have other interests (I am a musician) so I tend to lag behind the tech bros who do this for a living but these days its no longer becoming a question of whether or not I even like CS (I don't think I do) but I'm rapidly getting old and it's like soykaf dude, I need to fuarrrking eat without my dad supporting me cuz he won't be around forever lol.
How do I gitgud so I can get a job/internship? I'm just fuarrrking sick of retail/service industry soykaf and I want to get out before tech wages go to soykaf