[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: 1561322333117.jpg (117 KB, 500x500)
117 KB
117 KB JPG
Old thread: >>74760223
What are you working on, Anon?
>>
hasklel
>>
I'm a Zigger
>>
Anyone wants to cooperate in creating a hobby animu-themed OS?
>>
>>74767133
only if it's based on windows and antithetical to linux and unix generally
>>
>>74767140
>all oses must be based on either windows or unix
lol
>>
>>74767140
Nah, Windows just does not make any sense. I think it would rather be plan9-like.
>>
>>74767133
been there, done that. not worth the waste of time
>>
>>74767156
>and
>>
What is the least powerful programming language?
>>
>>74767221
python
>>
>>74767221
javascript
>>
>>74767228
>interfaces with c
try again
>>
>>74767241
C is even less powerful, so Python is still the least powerful
>>
Will Rust forever be just another toy llvm-frontend or will they eventually write their own compiler?
>>
>>74767221
JS and Haskell
>>
whenever I assigned the string from the .read() of a file into a variable using Python3, it places a blank line (\n) below the string for some odd reason. What's causing this? I've already checked the file and I didn't accidentally place an extra blank line anywhere.
>>
>>74767221
Java or Golang
>>
>>74767221
every turing-complete language
>>
>>74767221
If by powerful you mean expressive, probably Go or C.
>>
>>74767349

that's how the compiler works on the read() method.
>>
>>74767221
Visual Basic
>>
>>74767395
ahh, ok. thanks for clearing that up. is this a new addition or something? I could've sworn that there wasn't a blank line in the past.
>>
>>74767241
>mistaking language specification for implementation
I too remember being a freshman once.
>>
>>74767479
when someone goes up to you and talks about python, they aren't talking about ironpython or jython unless they tell you. cpython is default
get off your high horse
>>
What are the gayest programming languages?
>>
>>74767497
That's not a matter of "which implementation one is talking about"
Just because the most widespread implementation uses C does not mean a Python implementation *must* use C. And the existence of other implementations proves it.
*You* should get off your high horse. C is not a hard requirement for implementing other languages as you believe.
>>
>>74767252
lol
they cant
>>
>>74767221
Basic
>>
>>74767100
A randomly-generated 2D cave, but I've made little progress.
>>
>>74767522
Swift
>>
>>74767585
t. plato
>>
>>74767585
what language?
>>
let's say i have a list of directories and sub directories formatted like this:
a = ['one', 'one/two', 'one/three', 'one/two/four']


i wanna have a structure like this so i can know where i can go from a certain directory and represent it as a tree in my program.
c = [{
'name': 'one',
'children': [
{
'name': 'two',
'children': [{
'name': 'four',
'children': None
}]
},
{
'name': 'three',
'children': None
}
]
}]


am i a stupid faggot? does this kind of structure has a name? where do i dig and what do i read. i guess i can implement this myself but all my ideas and solution seem super slow and i wonder if there's a better way of doing this. thank you.

actually i just got a really good idea while writing this post.
>>
>>74767665
C
>>
>>74767678
U
>>
>>74767684
N
>>
>>74767687
N
>>
>>74767675
>does this kind of structure has a name?
It's called JSON
>>
>>74767694
Y
>>
>>74767694
Y
>>
>>74767100
A library to extract/manipulate data from the Pokemon Red ROM.
>>
>>74767696
funny
>>
>>74767675
something with recursion
>does this kind of structure has a name?
yes, it's a tree
>>
>>74767675
that's a tree
>solution seem super slow and i wonder if there's a better way of doing this
it's slow because you're dumb
post the fucking code, retard, so we can help you fix it
>>
>>74760022
>>74760035
you're using add() once before the if condition, then a second time in asientosReservados() by which time the value has already been added to it
>>
>>74767675
Why not just:

>
 
'one': {
'two':{'four': null}
'three': null
}
>>
>>74767739
because I want my tree to be ordered. dictionaries in python are unordered (you can use an OrderedDict but I feel like list is cleaner).

>>74767721
>>74767720
alright i think i've got it boys.
>>
>>74767780
They're defined to be ordered now.
>>
Static typing without a strong type inference mechanism is worthless.
>>
>>74767100
based mcarthy poster
>>
>>74767988
>i'm a lazy shitter
we know
>>
>>74768053
Yes, I am. That's why I prefer leaving what can be automated to implementations, so that I can focus on the actual business logic instead.
The entire point of computers is automation.
>>
File: file.png (897 KB, 971x758)
897 KB
897 KB PNG
>>
>>74768085
type inference is only useful in really basic code.
But when you bring C interop, graphics APIs, or complex user types, it gets messy and buggy.
Type inference also opens up for implicit casts which have historically produced catastrophic results. Automation is good, but explicitness is also good, and I'd rather type a little more in the short term, than a lot more in the long term.
>>
File: fuckprogramming.png (169 KB, 1920x1080)
169 KB
169 KB PNG
Is there a way to exclude the column X from my boxplot?
>>
>>74768145
I would not be smart enough for MIT.
It's so hard they can give it away for free with MIT opencourseware without going out of business.
>>
>>74768180
Pass an slice like x[:, 1:] ?
>>
while True:
print("fuck anonfags")
>>
would u rather worth with java or c#
>>
>>74768271
C, only C
everything else is a waste of time
>>
>>74768271
C#, it's not even a contest.
>>
>>74768271
java because id rather not be an ms cuck
>>
File: thanks.png (119 KB, 1920x1080)
119 KB
119 KB PNG
>>74768211
Thanks, that lead me in the right direction. I looked at this R reference sheet and it worked out. Now I don't know why my boxplot looks like this though. Shouldn't it be showing the like boxes?
>>
>>74768271
>>>74767977
>>
>>74768271
No, I wouldn't
>>
>>74768336
Yeah my example was python syntax, I've nver used R before.

It looks like you have extreme outliers that cause your boxes to be really squished, so they end up looking like lines at the bottom.
Look up literature about how to normalize and get rid of them.
>>
>>74768308
even if its .net and not .net core?
>>
>>74768423
yeah.
I don't like feeling like I'm constantly fighting the language to do what I want.
Writing Java feels more like appeasing arbitrary rules for the language than trying to solve a problem, and to me programming is all about solving problems.
Also I despise gradle.
>>
>>74768156
>Type inference also opens up for implicit casts which have historically produced catastrophic results.
You're free to point out examples where this happened.
>>
>>74768609
>Writing Java feels more like appeasing arbitrary rules for the language than trying to solve a problem
I absolutely can not relate
>>
>>74768609
>Writing Java feels more like appeasing arbitrary rules for the language than trying to solve a problem
I absolutely can relate.
Hundreds of books and "patterns" have been written to suggest ways to overcome its limitations.
That's how much manpower it wasted.
>>
>>74768085
>focus on the actual business logic instead.
>The entire point of computers is automation
Where I work code style does not allow using var in C# and instead we use full types for clarity.
>>
>>74768717
Mars Climate Orbiter is probably the most famous.
wouldn't have happened in a strongly typed language.
>>
>>74768725
>I absolutely can not relate
I can. Why can't you?
>>
>>74768609
>Writing Java feels more like appeasing arbitrary rules for the language than trying to solve a problem
>*writes C#*
man, the seventh circle of hell of awful, just awful.
you know what, I'm going to make an appeal to God, to relieve me of the horror of the seventh circle of hell
"Please, lord, give me the sixth circle of hell"
>>
>>74768761
That was not caused by type inference.
>wouldn't have happened in a strongly typed language.
Type inference doesn't rule out strong typing. The languages with the best type inference are in fact very strongly typed.
>>
>>74768785
>seventh circle of hell
>sixth circle of hell
Malbolge
>>
>>74768800
>That was not caused by type inference.
It was a type mismatch that wasn't a compile time error, so it might as well have been.
type inference just has no objective case, it's purely for lazy people to avoid some typing. but in the end it just causes bugs and more typing.
>>
>>74768869
not him but you're wrong
in a type system without implicit casting, it would be a type error
>>
>>74767221
Something like Brainfuck.
>>
>>74768905
>in a type system without implicit casting, it would be a type error
that's my point.
it's passive type inference, in that it's technically correct, but logically wrong and shouldn't have been let through.
>>
>>74768939
what the fuck are you bambling about
you can have 0 type inference and casting
// void myfloatfunc(float);
int x = 0;
myfloatfunc(x);
this has NOTHING to do with type inference. there is NO type inference in this.
>>
>>74768869
>It was a type mismatch that wasn't a compile time error, so it might as well have been.
No, it can't have been. The problem was mixing metric and imperial units, a purely arithmetic error.
Now, if you had encapsulated these values as types, it would have still been a type error with or without type inference.
>type inference just has no objective case
Type inference has many benefits. Apart from obviously saving some unnecessary typing, it makes your codebase more solid and easier to refactor, since you're no longer programming against *named* types, but rather, behavior. Changing type names doesn't require changing the entire codebase, and it doesn't require you to lie in advance to the compiler by specifying types that may or may not eventually be what you want.
>but in the end it just causes bugs
There is no concrete example of a bug directly caused by type inference. You tried once, but failed, blaming a completely unrelated issue on type inference.
>more typing
Objectively false.

>>74768939
>it's passive type inference, in that it's technically correct, but logically wrong and shouldn't have been let through.
You are making shit up at this point.
Assuming the measurement values didn't have an explicit type, but were merely numerical values, the error you mentioned would have happened with or without inference. If they did have dedicated types, it would not have happened, with or without inference.
You already showed you don't know what "strongly" or "weakly" typed means. Type inference has nothing to do with it. It cannot cause type errors the type system doesn't allow.
You are just afraid to recognize its merit because whatever favorite language you have doesn't have it or supports it poorly.
>>
>>74768952
>>74768992
>this has NOTHING to do with type inference. there is NO type inference in this.
that's why i said it's a form of type inference, not the typical compiler deducing the type, but the compiler naively deducing that two types are compatible.
I admit, it's a bit of a liberal use of the term though.
But getting back to my original argument:
There is no place for implicit casts in software.
>>
>>74769014
You are moving the goalposts now.
Implicit casts are not the same thing as type inference. I agree with your freshly moved goalposts, though.
>>
>>74769014
that is literally totally and completely unrelated to type inference, you are just really desperately trying to shoehorn the word inference in
not inference AT ALL
>>
>>74767100
Lisp is the most powerful programming language.
>>
Does Rust have as powerful template metaprogramming as C++?
>>
>>74769091
Yes
>>
>>74769071
Only if you're talking about Scheme.
>>
>>74769160
Shen*
>>
>>74767100
About a month ago Google started tampering with Youtube search results when the request isn't done by a modern web browser. Now you'll get three entirely different sets of search results from requests made with
>wget with no headers
>wget with proper user agent and headers
>proper browser with javascript enabled
I wonder how many thousands of web scrapers that change broke. Anyway, fuck those Google slugheads, now my scraper runs the request through Firefox.

I would post a Grishenko reaction pic but my IP has been range-banned from posting images.
>>
File: 1574265150187.jpg (156 KB, 1920x1080)
156 KB
156 KB JPG
I can go no further
>>
>>74769165
what did you post to get range-banned anonfag
>>
>>74769222
BE STRONGER ANON I BELIEVE IN YOU.
>>
Can someone help me with a basic question in C?

Let's say I have a struct mystruct with
int a;
int *x;

And I have a mystruct pointer. How do I acess the elements of the x array?
Is it something like

I was trying something like mystruct[i]->x[j], but gcc is crying about it.
>>
>>74769319
mystruct->x[i]
>>
>>74769326
>>74769319
Wait, if mystruct is supposed to be an array too:
mystruct[i].x[j]
>>
>>74769319
The mystruct pointer isn't an array. If you want to dereference it with square brackets you have to pass a 0 (ie. mystruct[0]). But the regular way to dereference a pointer is (*mystruct). Any number besides zero in the square brackets accesses some bytes of the structure directly giving you garbage data. And every pointer is 8 bytes so [1] would be 8 bytes into the struct [2] would be 16 etc.
>>
>>74769239
I dindu nuffin', I swear. I wuz a gud boi. Entire ISPs in Scandinavia are range-banned from posting pics on 4channel.
>>
>>74769338
Yes, sorry, forgot to mention that.
Thanks.

How weird that we switch back to '.' instead of '->' in this case.

>>74769362
I mean if it is an array.
>>
>>74769165
>IP has been range-banned from posting images
ocassionally my isp switches my ip to one that's rangebanned from images
i guess now they have $$passes$$ they're more lax about banning huge numbers of people
>>
>>74769387
>How weird that we switch back to '.' instead of '->' in this case.
[] also dereferences the pointer, so you're left with a non-pointer of whatever my struct is, so you use '.' instead of ->.
a[b] is defined to be the same as *(a + b), so working backwards may help.
mystruct[i],x[j]
(*(mystruct + i)).x[j]
(mystruct + i)->x[j]
>>
anyone got the roll for a programming challenge image?
>>
>>74769456
https://better-dpt-roll.github.io/
>>
>>74769423
That makes a lot of sense. I guess I was completely lost on the order of how things went.
>>
>>74769468
I'm in love with your feminine penis - thanks.
>>
>>74768770
not sure maybe im just capable of using more than one language
>>
challenge #1: alternately add and subtract numbers of a list of numbers.
challenge #2: alternately add and add the negative of a list of numbers
respective examples:
   0 + 1 - 2 + 3 - 4 + 5 - 6 + 7 - 8 + 9
9
0 + 1 + _2 + 3 + _4 + 5 + _6 + 7 + _8 + 9
5

but you should write a function to do it for a provided list.
>>
>>74769517
NB. in a language with more typical order of operations, these challenges are the same:
$ rdmd --eval 'writeln(0 + 1 - 2 + 3 - 4 + 5 - 6 + 7 - 8 + 9)'
5
>>
>>74769517
In JavaScript this is just
const sumWithAlternatingSigns = numbers => {
const fns = [(a, b) => a - b, (a, b) => a + b];
return numbers.reduce((a, b) => fns.reverse()[0](a, b));
};
>>
Man I've been wasting a lot of time when I should've been learning Scheme.
(define tup+
(lambda (tup1 tup2)
(cond
((null? tup1) tup2)
((null? tup2) tup1)
(else (cons (+ (car tup1)
(car tup2))
(tup+
(cdr tup1) (cdr tup2)))))))
>>
>>74769574
>const(antly) reversing a const array
gross. At least do something like
fns[i = 1 - i](a, b)
>>
>>74769643
Actually, that gave me an idea
const sumWithAlternatingSigns = numbers => {
const fns = [(a, b) => a - b, (a, b) => a + b];
return numbers.reduce((a, b, i) => fns[i & 1](a, b));
};
>>
File: FB_IMG_1581721837176.jpg (22 KB, 960x728)
22 KB
22 KB JPG
>>74767522
Ruby
>>
>>74769468
In C this is just
https://pastebin.com/zJgAHMgL
>>
>>74769779
>#define CHALLENGES 147
why the fuck use a mcro for defining a hardcoded length for a single array instead of making a length-of macro?
>>
>>74769579
Damn I'm so fucking lazy. I need to learn this shit ASAP so I can read SICP dammit.
>>
>>74769923
I just thought it was nice to let the programmer know there are around 147 challenges there, the programmer will have to bump the number for every challenge added, this wasn't well thought out.
>>
>>74769579

>(define blah (lambda ... ))
You know we have a syntactic sugar for this, right?
(define (foo arg1 arg2) body)
>>
>>74770079
I do actually
>>
>>74770101

Then why use lambdas with defines like that? It just makes the code more verbose.
>>
>>74770079
JS's terrible standards body has convinced a generation of webshits that only lame languages have a function-definition syntax. Even ReasonML imitated the wretched lack of syntax.
...
APL langs get a pass though.
>>
>>74770141

Except JS actually does have a function definition syntax. People just don't use it.
>>
>>74770141
JS can do both and JS also builds on ideas from Scheme according to Eich
Are you retarded?
>>
>>74770169
>is aware of JS prior to literally a year or two ago
>retarded
>>
>>74768761
Most inferred typed langs are strongly typed. It feels like /dpt/ posts are 90% the same seplet who doesn't know what strongly typed means.
>>
>>74770118
Cause I'm learning so I do everything the hard way. You only get to use shortcuts once you know how to do it the long way. That's my philosophy. Sometimes I forget what the shortcuts are though
>>
>>74770248
I fucking hate this site because zoomer anti-wisdom like this is grating at my mind from all directions.
>>
>>74770248

It's not so much a shortcut as it is the standard way to write functions in Scheme. A lambda should be used when passing a function as a parameter to another function, not when defining named functions.
>>
>>74770275
But it's true
>>
>>74770279
>a standard way
But not *the* standard way. As a rule of thumb, the official standard way to do anything is always longer, harder and more redundant but also better for whatever reason. At least when it comes to programming.
>>
>>74770310

>As a rule of thumb, the official standard way to do anything is always longer, harder and more redundant but also better for whatever reason
Stop taking drugs. First of all, your rule of thumb is flat wrong. Good code should take the least amount of time to read and understand, so verbosity and redundancy will never help you. And secondly, THE standard way to write functions in scheme is using the function define syntax. NOBODY likes typing extra lambdas over and over again if they don't have to.
>>
Have any of you tried started your own business?
>>
>>74770372
Well even the answers have lambdas in them. The book says to use lambda to specify function parameters. I initially was doing it without lambdas and it was working but I changed my coding style to be more "correct". I wanna be fucking correct bro.
>>
>>74770379

Starting your own business requires money. It also requires an idea to make money with. I can't think of many things that involve software that a reasonable person would want to pay money for.
>>
>>74770079
That's different from what he's doing.
(define foo (lambda ...) )

Returns the lambda. You are given back a function as a result of the evaluation, not the evaluation of the lambda.
(define (foo a b) bar)

Evaluates foo, and returns the result of bar.

Learn to lisp.
>>
>>74770394

What fucking book are you using? Have you tried looking at any actual Scheme projects? How about this one?

https://gitlab.com/NalaGinrut/artanis/-/blob/master/artanis
>>
>>74770424

The latter of the two snippets of code you have posted defines a function named foo, which takes arguments a and b, and which when called evaluates to bar. Fucking learn Scheme, idiot.
>>
>>74770431
The Little Schemer but even the answers to SICP have lambdas in them.
I think it might have to do with applicative order evaluation and recursion or some shit. I thought it might be that one way doesn't echo the results of the evaluation to the console but they both do.
>>
>>74770523
>I think
you're a brainlet. It doesn't have to do with anything. It's baby talk, like excess whitespace in J or K. Do you see, stupid reader? Do you see how assigning a lambda to a name is the same as defining a function with a name? That's because this is a Lisp-1 instead of a Lisp-2 like icky CL. Can you spell Lisp-1? Let's spell Lisp-1 with this hand puppet!
>>
how do Rust compile times compare to C++ compile times?
>>
>>74770710
You need terabytes of RAM to compile a basic hello world program in rust
>>
>>74770723
>terabytes of RAM
Oooh I wish I could get terabytes of RAM
>>
>>74770710
noticably worse, >20% slower
>>
>>74767100
Even if binaries compiled in Rust used as much memory as electron, I would still love Rust.
>>
tl;dr I want to automate the ripping of images from a website and compiling them into cbr/cbz files

Unfortunately, the website (readcomiconline.to) has some occasional checks against doing so. So what's the best way of automating the process? I assume it would have to be through a real browser, so I could solve the captcha for it and then let it go.
I've never done anything like this, so I don't even know what to use. I assume Python has some library for it?
>>
>>74770929
If you love a programming language, you're ill
>>
>>74771315
Maybe stop using languages that are 20+ years old and you'll learn to stop hating what you do.
>>
>>74771105
Nodejs and puppeteer for webscraping or the Python equivalent
>>
>>74771105
Just write it in Javascript. It's what I did when I was into that stuff. Write it as a user-script or browser extension. As shitty as Javascript is, it's best to simply BE natively in the DOM environment in which websites naturally exist rather than attempt to inject yourself in.

Or you could use something like selenium if you really wanted to.
>>
Which project is the netherite hoe of programming?
>>
>>74769579
yikes
(define tup+ (curry map +))
>>
>>74771386
glimpse, the gimp fork which is just a rename
>>
// boilerplate code

class Shape
{
// ...
};

class Triangle : public Shape
{
// ...
};

class Square : public Shape
{
// ...
};

#endif


Should Triangle and Square be separated into their own .h files when I am dealing with inheritance? What is the "proper" way? thnxbb
>>
>>74771713
proper is whatever you want it to be, honey
>>
>>74771742
Up to now I've just been using mousepad and compiling through gcc/g++, but I figure I should get a proper IDE if only so I could get a feel for how to better structure my projects.
What's a good lightweight IDE for c/c++ with autocompletion and highlighting? I've used emacs and didn't really enjoy it, and I don't think vim would be a good choice for me.
>>
>>74771742
>>74771745
I didn't mean to quote
>>
File: lookatheretics.jpg (68 KB, 658x1024)
68 KB
68 KB JPG
>ok let's try (#6) to stomach rust enough to learn it
>cargo install cargo-edit # a little tool to add dependencies to Cargo.toml files
>fan changes settings from 'quiet' to 'jet engine'
>five threads constantly compiling
>182 dependencies downloaded
>literally five minutes pass
>can now 'cargo add regex'
>instead of typing 'cargo search regex' and then 'regex = "1.2.3"' into the Cargo.toml file
this is the most impressive language ever.
it's so impressive how off-putting it is.
it's a fractal of offensiveness.
>>
>>74771745
HERETIC
>>
>>74771713
There is no "proper" way. For a simple set of derived classes that would have similar implementations (like your example), most people would say it's fine to group them together. If you had something like a base class DeviceInterface, it would probably make sense for KeybobardInterface and PrinterInterface to have their own header/implementation files. Where you draw the line is up to you.
>>
>>74771742
>>74771781
Thanks anons, I appreciate it
>>
Are you ever annoyed by how obtuse it is to integrate languages together? The only real major way is CFFI which is an absolute pain in the ass for anything larger than a toy library or object files. Why hasn't this become a solved problem yet for a system that's easier to integrate all languages without wasting hours on wrappers and other shit?
>>
>jsfag says lisp is trash because of metraprogramming and no oop
can't make this up
>>
>>74771761
>rust adding a tiny cli tool to add lines to a file after a web request
time (altogether, not concurrently): 25 minutes and 12 seconds
RSS (max at any time): 542 MB
>compiling dmd, phobos, and druntime
time: 39 seconds
RSS: 1.63GB
so with multiple jobs I could compile the entire D suite 38 times before Rust can build finishing cargo-edit. (38 times with enough memory)
>>
>>74771812
Sounds like a Python problem. JNI wasn't that difficult when I was working in Java once you got familiar with the data types. It's even easier in C#, though I've rarely even ever had to do it.

Or you could just use IPC rather than pretending that your interpreted Python code is running in the same context as a native process.
>>
Maybe more webdev/networking but how do people actually secure message queues/redis instances that need to be shared across multiple internet exposed nodes?
Say I'm developing two different services, one that needs to push messages to another, using Redis Pub/Sub. Surely putting a password on it isn't sufficient enough, do people use some sort of TCP proxy?
>>
>>74771812
it's not?
granted my only experiences were with lua and C#
lua <-> native was pisseasy
C# <-> native is also pisseasy
lua <-> C# is only hard if you want to do it in a platform independent way because then you need to use COM which is hell on earth
At that I'm not even sure if it is actually platform independent, what happens if you try to use .NET core COM interop on a non-windows platform?

i suppose some other form of IPC not tied to legacy windows garbage would work
>>
>>74771924
don't expose redis, or don't use redis.
>>
>>74771959
Then what's the point of pub sub with redis at all
>>
>>74771924
I just let AWS IAM handle it for me. What do I look like a systems engineer?
>>
>>74771761
What are you even trying to do? I've never installed or heard of cargo-edit before. I just put shit in my cargo.toml and let it compile when I build/check it next.
>>
File: file.png (151 KB, 1793x863)
151 KB
151 KB PNG
>What are you working on, Anon?
Writing an IRC daemon in Rust. You can now chat and do basic channel stuff.
>>
Is there an open source version of this "overpriced" book, or is this about as much, or as good, as you're going to get?

Yes, I'm in college for a CS degree.
>>
>>74772114
use lib.gen. Here, I already found it, pick the edition you want: gen.lib.rus.ec/search.php?req=Data+Abstraction+%26+Problem+Solving+&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def
>>
>>74772147
>gen.lib.rus.ec/search.php?req=Data+Abstraction+%26+Problem+Solving+&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def

Aw, no 7th edition, but thanks. I can't even seem to find an E-book copy of this damn thing anywhere. Amazon only has paperback.
>>
>>74771856
>>74771946
>/g/ - python, java, c#, and lua
not even surprised from a college thread.
>>
So are C/C++ just gonna run the show forever? Why even learn Rust or Go?
>>
I'm learning C++ by making games using SDL is fun, but I think it'd be more fun collaborating with another programmer, or even artist. I hate coming up with sprites to test ideas.
>>74772214
rust is promising, but too early adoption for me. I want an actual job at the end of all this.
>>
>>74767221
tex
>>
>>74772199
What other language would you be using to interface with C that isn't C? Something meme?
>>
>>74770379
yeah
>>
>>74772199
Languages that run in a VM are the only ones with this problem.
The Python VM, JVM, and .NET are the only programming language VMs that see major use.
If your language runs in a VM, has shit CFFI, and isn't one of the major ones, it's not worth mentioning.
lua was only mentioned because its nice
>>
>>74772221

>>74772221
I'm not even going to lie to you, anon. I think Game Maker Studio's image editor should really be its own separate program, because it really is that good, and comfy.

To bad you have to learn GML to do anything useful in that IDE.

I also don't use GM anymore, but just thought I'd let you know that you don't have to use photoshoop to make sprites. I know how cumbersome it is.

Placeholders all the way for me until I actually want to make real sprites.
>>
>>74772221
Rust isn’t backward compatible though, so it’s askin for a complete ship jump from C/C++. Same with Go. Computing has gone from Fortran, to C which was like somewhat compatible or something to C++, backward compatible with C. The world won’t blank slate everything and start over, imo, but who knows (not me). I’m hoping Rust or Go gain traction, or even Haskell.
>>
>>74772282
Asking for a functional programming language to gain traction is like asking for a lab experiment to make its way to the Oscars.
>>
>>74772312
Wait Parasite wasn't a lab experiment? Or was that the joke?
>>
>>74772282
>Rust isn’t backward compatible though
What do you mean? It has FFI so you can rewrite parts of existing programs that think of your Rust libs as C.
>>
>>74771812
>Are you ever annoyed by how obtuse it is to integrate languages together?
It's trivial for the easy cases. Calling a function that takes a couple of floats and returns a float, and doing it between languages? Child's play!
The problem is that things get much more difficult after that. Languages have very different interpretations of how complex arguments should work, what should happen with mutability, how memory should be managed, and what are the constraints and tradeoffs for callbacks of various kinds, and those are not things that it is easy to patch over in a generic way.

You could solve this by saying that every language has to solve these key problems the same way. That would slam the door on quite a few ways that languages have gone; it'd be like saying that the only human language allowed is Esperanto, and that would be a terrible shame.
>>
>>74767124
I'm a Zagger

http://www.cs.cmu.edu/~sleator/papers/Self-Adjusting.htm
>>
Question:
You are given a list of airports (three-letter codes like 'JFK'), a list of routes (one-way flights from one airport to another like ['JFK', 'SFO']), and a starting airport. Write a function that returns the minimum number of airport connections (one-way flights) that need to be added in order for someone to be able to reach any airport in the list, starting at the starting airport. Note that the connections don't have to be direct; it's okay if an airport can only be reached from the starting airport by stopping at other airports first.

Isn't this a traveling salesman problem (i.e. impossible to solve)?
>>
>>74772755
traveling salesman is solvable
it's just NP-hard or something which means it gets slow real fast
>>
>>74772755
>impossible to solve
impossible to solve in polynomial time.
http://mathworld.wolfram.com/PolynomialTime.html
just make a graph and search it exhaustively.
>>
File: 1581647933443.jpg (53 KB, 500x479)
53 KB
53 KB JPG
clang++ vs g++
>>
>>74772779
>traveling salesman
that is hard because it requires finding the shortest route with N stops
in this case you only have one start and one destination with no requirement to visit anywhere else in between, so it's a normal pathfinding question that you can solve with Djikstra or A* or similar
>>
>>74772816
on average, about the same these days
some specific shit gcc is better at optimizing, some shit clang's better at
clang's better for targeting windows
clang/LLVM has a better architecture from a library standpoint
you can bootstrap GCC from scratch in WSL multiple times in the time it takes to compile clang and llvm once without the overhead of WSL
>>
File: 1580759500458.gif (31 KB, 220x220)
31 KB
31 KB GIF
>>74772859
What about upholding ISO standards? Doesn't gxx do a lot of fuckery with extensions or is that only with the C compiler?
I just want to make sure my code is portable with compilers that uphold the standards.
>>
>>74772881
You just have to pass it flags to tell not to allow stuff that comes from extensions.
>>
>>74772881
it does, most of gcc's extensions target C iirc, and they can be disabled
clang supports most of the gcc extensions anyway, enough to build linux at least
>>
Who here can make a program/script that visits this website;
https://www.thispersondoesnotexist.com
and saves the picture. Then repeat that about 2000 times?
>>
>>74772924
isn't this literally just calling curl in a loop
that's a fucking 1 line bash script
>>
>>74772924
>https://www.thispersondoesnotexist.com
fuck you for reminding me of this creepy shit
>>
>>74772924
go to website
right-click inspect, network tab
refresh
right-click image link, copy as cURL
open terminal
for x in {1..2000}; do <paste> > $x.jpg; sleep 120; done
wait 40 minutes
done
>>
>>74767221
lisp
>>
>>74772924
Make a bash script using a loop and wget
>>
>>74772924
literally fucking anyone including you
the image is jfif which i just learned is a thing
>>
>>74767100
I'm working on a personal re-install script for Void Linux.
I'm looking for tips on how it could be more optimal, POSIX compliant, better formatted, etc.
https://wiki.voidlinux.org/Installation_on_UEFI,_via_chroot
https://pastebin.com/s27EhsAj
>>
>>74772930
>>74772940
>>74772941
>>74772947
>>74772952
Ok I thought it was gonna be harder.

Doing this in php
$file_contents = curl_get_contents('https://www.thispersondoesnotexist.com/image');
for ($i = 0; $i < 2000; $i++){
file_put_contents("./faces/$i.jpg", $file_contents);
}
>>
>>74772984
Can someone run it for me and then mail me the pictures? I'm on mobile data.
>>
>>74772984
we need a new thread.
this one has PHP in it.
>>
>>74772984
shit... curl_get_contents was supposed to be in the loop. Got 2000 of the same face.
>>
What's your reference project when learning a new language? Personally I write a (simple) irc server.
>>
i looked at my uni's student discord server and saw two different trans girls in the CS program advocating rust
should i learn it /g/?
>>
(define fib
(lambda (n)
(cond
((zero? n) 0)
((zero? (- n 1)) 1)
(else (+ (fib (- n 1)) (fib (- n 2)))))))
>>
>>74773054
i was wondering how often i saw this so i looked
https://archive.rebeccablacktech.com/g/search/text/%28define%20fib/page/7/
congrats on 7 pages of lisp posters defining fib
>>
>>74773046
if you're into balding men crossdressing then sure
>>
>>74773084
i'm very into myself if that's what you mean
>>
>>74773054
in J this is just
fib=:1:`1:`($:@<: + $:@<:@<:)@.(2&<.)

after only two (2) months of casual J'ing you'll be able to write that from scratch in seconds like I did just now, and you'll also have no problem reading it. Doesn't that sound like a better use of your time?
>>
>>74773076
Oh well I guess I should do something unique in scheme I just don't know it that well.
(define fun
(lambda (n)
(quote 1337)))
>>
>>74772221
>>74772279
Go get Aseprite, it is an editor specially designed for pixel art creation and animation. The official binaries are paid, but the source code is actually free, so you can pretty much grab the source code from their github and compile it. I just compiled it a few days ago and have gotten heavily into pixel art. Also if you are playing around SDL, you should check out SFML.
>>
>>74768869
>It was a type mismatch that wasn't a compile time error, so it might as well have been.
idiot. you are confusing type inference with dynamic typing.
>>
>>74773088
I love you J poster
>>
>>74769014
type inference reduces implicit casts, fucking retard.
>>
>>74773088
Well scheme unlocks SICP what does J get me?
>>
>>74770215
>seplet
hey, don't group me in with that fucking retard
>>
>>74773088
btw in lieu of explaining this, here's the same technique in D
T fib(T)(T n) {
immutable fns = [
function(T n) { return 1; },
function(T n) { return 1; },
function(T n) { return fib(n-1) + fib(n-1-1); },
];
return fns[min(n, 2)](n);
}
>>
File: BigBrain_Wojak.png (14 KB, 218x320)
14 KB
14 KB PNG
>>74773088
fib =: 3 : '(<1 1) { (+/ . *)^:(<:y)~ 2 2 $ 0 1 1 1'
>>
>>74773141
Absolutely nothing.
>>
>>74773200
Well there's definitely *some* benefit to J. Probably something mathy.
>>
>>74773193
Unfortunately this isn't as big brain as I thought at first, it won't optimize to log(n)
>>
>>74773153
That is verbose
>>
>>74773236
it's still about 2-3 thousand times faster than my naive fib in >>74773088
(but the naive fib still wins with just a M.)
>>74773227
1. "something mathy"
2. J's super interactive. All the shit people say about scripting languages that's not true any more because compiled languages have had decades of usability and tooling enhancements, is still true of J. take a look at the workflow on display at https://www.youtube.com/watch?v=CzK2SazvCxM
3. you get correctness through terseness. "Only small programs have any hope of being correct." If you're not pursuing this, you may as well be writing ATS or SPARK, because everything else is shit.
>>
>>74773236
>>74773193
>>74773153
>>74773088

>Not optimizing in assembly
>>
Any good resource to learn C++ for someone who only knows JS and PHP?
>>
File: 1551952961052.png (55 KB, 346x322)
55 KB
55 KB PNG
>programming in J
>>
>>74773306
if you actually know languages and have done more than toy programs in them, your best bet is to go out and make shit in c++, not following some beginner tutorial designed for people who haven't progrmamed before

just look at cppreference.com for standard library shit
>>
File: 1556850224971.jpg (222 KB, 2048x2048)
222 KB
222 KB JPG
what's a nice and simple instruction set architecture I can emulate? bonus points if 64bits.
>>
>>74773306
bjarne's book
scott meyer's essentials series
isocpp.org and the blogs it lists under basic/intermediate/advanced/experimental

>>74773317
both JS and php are massively different from C++ and objectively horribly designed
he should be starting from scratch
>>
>>74773342
>both JS and php are ... objectively horribly designed
this is like saying that boiling water and the core of the sun are both 'hot'.
JS has some warts, particularly with how it handles nonsensical (on its face) code, and ==. The biggest gotcha is people not reading the parseInt documentation.
PHP meanwhile is a reality-defying non-euclidean horror of bad design.
>>
This is the real way to do Fibonacci in Scheme.
(define sub1
(lambda (n)
(- n 1)))
(define add1
(lambda (n)
(+ n 1)))
(define o+
(lambda (n m)
(cond
((zero? m) n)
(else (add1 (o+ n (sub1 m)))))))
(define o-
(lambda (n m)
(cond
((zero? m) n)
(else (sub1 (o- n (sub1 m)))))))
(define nthfib
(lambda (n)
(cond
((zero? n) 0)
((zero? (o- n 1)) 1)
(else (o+ (fib (o- n 1)) (fib (o- n 2)))))))
>>
>>74773362
(define fib
(let ((fns (list
(lambda (n) 1)
(lambda (n) 1)
(lambda (n) (+ (fib (- n 1)) (fib (- n 2)))))))
(lambda (n)
((list-ref fns (min n 2)) n))))

(display (fib 28))
>>
>programming going well
>import a project I usually use (it just covers boilerplate code to access a package it nuget'd)
>add the reference
>use the code I normally use to access said project
>builds fine
>run it
>System.IO.FileNotFoundException :^) file/assembly/dependency not found
Fuck.
It says the wrong version number too, it says it's looking for version 12.0.0.0 when I have 12.0.3.
>>
>>74773533
Wait it's not expecting me to import every package the imported project has imported is it? Surely those packages would come with the imported project, right?
>>
File: dotnet.jpg (18 KB, 319x400)
18 KB
18 KB JPG
>>74767100
Reading pic related.
>>
>>74767100
i wanted to submit a 2-line PR to some software I use adding a command-line option to start minimized
but I want to actually build it before just blindly sending in a commit and I have to install like 10 dependencies before I can, so my motivation has disappeared
>>
>>74773781
based?
>>
#include <stdio.h>
int main(){
char c;
while (1)
if ((c = getchar()) != EOF)
printf("%c", c);
}

why does this work if I input a string followed by ctrl+d but stops printing back strings if I press ctrl+d at the start?
>>
wtf c++
I dont want to have to do this ternary hack whenever i use a templated function
template<bool b>
void foo() {}
int main()
{
int x = 1;
(x > 0) ? foo<true>() : foo<false>(); //fine
foo<(x > 0)>(); //compiler error
return 0;
}
>>
>>74774055
templates are compile-time constructs, you obviously cannot supply a runtime expression as a template argument.
If you mark the variable with constexpr then it should work though.
>>
>>74773839
could you explain yourself a bit better?
because it works as it should if I understand what you wanted.
>[Ctrl+D]String[Ctrl+D] -->String
>String[Ctrl+D] -->String
>[Ctrl+D]String[Enter] -->\nString
>String[Enter] -->\nString
>>
>>74774055
>x is -1
>anon expects it to be false
based
>>
>>74774077
>>74774156
in the example "x" doesnt change, but it does in my non-simplified code
>>
>>74774055
>using a template and complaining that instantiating a foo<bool> instead of a foo<bool> is annoying
>can't tell run time and compile time constraints apart
>oh lawd
>>
>>74774183
yes, and the template parameter is evaluated at compile-time
the compiler doesn't know what your value of x will be.


also you don't need """this ternary hack""", the keyword you're looking for is named if
>>
>>74774132
I'm not sure why but
>[Ctrl+D]String[Ctrl+D] -->String
and
>[Ctrl+D]String[Enter] -->\nString
don't work for me.

my test cases are being
>input: string+enter
on the screen:
string
string
>input: string+EOF+enter
on the screen:
stringstring
in both of these cases the program is waiting again for a new string, which gets printed regularly in the two manners above
however EOF+enter or EOF+string+enter not only don't print anything, but from the moment I try those whatever string I try to input after doesn't get printed back
if you're getting different behavior could the OS or the compiler flags be at fault? I'm using arch and compiling with gcc new new.c -std=c11 -Wall (it's also not working without optional flags)
>>
>>74774210
it could be that sending EOF from your shell is actually closing stdin or something
>>
>>74774184
>>74774192
i know template parameters need compile time values
but foo<bool>() had a lot of arguments and it would be nice if there was some way to avoid writing foo<bool>() twice or making a
void foo_split(bool b)
{
//just the same if or ternary thing
}
>>
>>74774210
tried with your compile arguments and it still works for me, dunno.
>>
>>74774226
yeah if you actually need to switch on that value at runtime the solution is to make it an argument and not a template parameter
>>
>>74774226
people already told you, turn your runtime variable into a compile time variable:

template<bool b>
void foo() {}
int main()
{
constexpr int x = 1;
(x > 0) ? foo<true>() : foo<false>(); //fine
foo<(x > 0)>();
return 0;
}
>>
>>74774225
>>74774235
I just tried with an online compiler and the behavior is different from what I'm getting on my machine yeah; I guess I should check my I/O portions of code online then, a similar problem was giving me an headache earlier
>>
>>74767100
is that guy programming up some fried chicken?
>>
File: 69365545221904230.jpg (497 KB, 2477x2480)
497 KB
497 KB JPG
>>74774286
ya
>>
>>74774250
slightly closer to actual code
#include "userinput.h"
template<bool b>
inline int foo(/*bunch of arguments*/)
{
while(/*fat code*/ (b) ? /*more fat code*/)
{
/*fat code*/
if(b)
/*do something else*/
}
return some int;
}

}
int main()//not actually in main
{
/*bunch of code*/
int x = getUserInputInt();
int y = (x > 0) ? foo<true>(/*bunch of arguments*/) : foo<false>(/*bunch of arguments*/); //compiles, but i dont want to have to copy and paste that stuff
int y = foo<(x > 0)>(/*bunch of arguments*/); //compiler error
sendToUser(y);
return 0;
}
>>
>>74774350
one thing you can do to save the repetition:
auto f = x > 0 ? foo<true> : foo<false>;
int y = f(/*args*/);
>>
I hate refactoring old stuff from my repo.
Do you know this feeling?
>>
>>74774430
I like refactoring
it means making code smaller and simpler
>>
I can't visualise recursion. why am I such a fucking brainlet? REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>74774385
i did not ask about the subtle design choices of some demo code i shat out in 40 seconds
i just want to know if theres some hidden keyword or #define trick or crazy stl thing that solves this problem i wouldn't think is too uncommon
>>74774392
thank you. looks like it won't help in my particular case, but i'll keep that in mind
>>
>>74774463
think of it like you're calling another copy of a function
>>
>>74774439
For me it depends on the project, refactoring something which I wrote not long ago its fine.
Now I am refactoring some stuff which I wrote 3 years ago and it has horrible code.

Yes I know thats my fault and I should not complain.

Btw are you guys removing old stuff from your repo when they are bad written or you are keeping everything refactorized and updated or something else?
>>
>>74774463
Imagine filling a stack 'til a condition is met. Then you start working on said stack, slowly accumulating the results. Ooooh baby.
>>
>>74774463
make a recursion chart. watch a youtube video on it that has visuals. trace the call stack. Do all this with the classic fibonacci sequence
>>
>>74774485
what's a repo?
>>
>>74774500
github repository.
>>
>>74774500
oh my god no
>>
>>74774485
Nah, it stays there. Why would I remove it and also why would I keep it updated if I'm not using it (or about to use it) when I could be working on other things.
>>
>>74774500
fuck off
>>
>>74774286
Kernel Sanders
>>
Went for second interview at IBM yesterday. Very strange company, they don't seem to do much technical stuff now. It's all "consulting", meaning selling preexisting software to large companies where clueless middle managers make buying decisions. Not sure whether I want to work there...
>>
>>74774875
IBM haven't been relevant since to 80s
>>
File: complex128array.jpg (51 KB, 584x492)
51 KB
51 KB JPG
I'm completely stumped. Does anyone know how I can convert this 1D complex128 numpy array, which has data from FFT's on a wav file, into a 3D numpy array which has the dimensions time, frequency and their coresponding amplitudes? If you plot this array in pic related, you get a spectrogram but I don't need a damn spectrogram, i need the 3d array with the data for it, but I don't know how to get it.
>>
>>74774879
I'm aware but they offered a pretty good salary of £48,000 which is much higher than anything else I'm getting. Curiously they didn't require any prior technical experience because they would "teach me Java" which is weird because I'm applying as a programmer. If they weren't a huge company I'd be thinking this was a scam.
>>
>>74774463
read the section on recursion of the sicp
watch the computerphile video on recursion, it has nice animations to explain
read the little schemer if you're really interested
>>
>>74774670
If this comment had been posted on reddit you just know it would have 5000 likes and a gold star next to it.
>>
>>74774944
instead it will get 5000 "underrated"/"based" replies
>>
>>74774989
>pun hater is a dumb frogposter
you've got to go back
>>>/r/eddit
>>
>>74775009
do you want your posts to get deleted again?
fuck off frogposter
>>
>>74775028
he must have frogotten
>>
>>74774875
yeah it's very weird
i have no idea what kind of value they even add to our society
>>
File: 1578527576662.gif (3.14 MB, 530x257)
3.14 MB
3.14 MB GIF
I was thinking, are there studies that research and list the reasons why dev teams switch from a programming languages to another? Either mid project, or even when the software is in maintenance phase.
>>
>>74775237
there is usually no rational reason for doing this
>>
>>74767100
the guy in that pic looks like he shits himself a few times a week
>>
just curious. someone worked with mpd library for python before?

>>> from musicpd import MPDClient
>>> mpd = MPDClient()
>>> mpd.connect()
>>> mpd.list('album')
[... list of my albums here]
>>> mpd.list('album', 'group albumartist')
[]
>>> mpd.list('album group albumartist')
Traceback (most recent call last):
...
musicpd.CommandError: [2@0] {list} Unknown tag type: album group albumartist
>>> mpd.list('album', 'group', 'albumartist')
Traceback (most recent call last):
...
musicpd.ProtocolError: Expected key 'AlbumArtist', got 'Album'


Is that a bug or am I retarded? Same thing happens when I'm trying to use the other one they recommend on their website.
list album group albumartist
is an example from the official mpd protocol documentation.
>>
>>74774875
IBM does a shitton of things, you probably applied for the wrong position inside IBM.
>>74774879
RedHat and VMWare is IBM
>>
>>74775341
Try this instead: https://hackage.haskell.org/package/libmpd
or
https://common-lisp.net/project/cl-mpd/
>>
>>74775436
>true or
it's a good thing the second never evaluates
>>
Writing a pornhub scraper to look for new videos containing certain keywords, then downloading the videos, and creating a compilation at the end of the week.
>>
>>74775472
that joke was too lazy for me
>>
>>74775507
a cringe coompilation
>>
>>74775436
I can't program in Haskell, anon. I've looked at the docs and tried to figure how to do the same thing in haskell but failed miserably.
>>
File: tomat.gif (1.13 MB, 320x213)
1.13 MB
1.13 MB GIF
Where do start if I want to understand artificial intelligence? Also why does everyone use python? Please reccomend me books
>>
>>74775534
what exactly are you attempting to do anyway?
>>
>>74775542
Python is easy quick-and-dirty code. Everyone wants instant gratification.
>>
>>74775542
everyone uses python because it's easy for laymen (aka non-programmer scientists)
books: -Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems
-Deep Learning with Python
>>
>>74775555
Very nice dubs quads.
>>
>>74775555
>instant gratification
imagine the cope when one equates abstraction with instant gratification
>>
>>74775544
desu I don't really understand how this command works exactly (because I've never managed to make it work).

But for the past few days I've been trying to build a simple music player that would show all my library in a tree-like structure. Basically a browser on the left and a playlist on the right. It's VERY fucking simple if you're trying to list directories and files like that from a file system. But the problem is that I wanna use mpd protocol for listing artists, albums, and songs and it's giving me a headache.
>>
>>74775568
Can anyone explain the difference between deep learning, machine learning and Ai?
>>
>>74775594
and this command should (probably) list all albums and group them by albumartist tag.
>>
>>74775622
AI is a superset of ML
ML is a superset of deep learning
>>
>>74767675
You overcomplicated this fucker.
>>
>>74775622
Deep learning is a subset of machine learning which is a subset of AI.

AI is the general field.
Machine learning uses data to build models used to make predictions. Some techniques are neural networks, but there are others, like support vector machines.
Deep learning is the field that specialises in neural networks.

What are you interested in actually doing?
>>
>>74775661
I am not 100% sure right now, I was interested in things like Algorithmic Trading. Think of Quants, I am currently studying investing. Though I now google and some people don't use ai, etc necessarily for algo trading.
>>
>>74771713
For visibility and readability it is better to separate classes. However do whatever the fuck you want. You can create an abstract in one file and each file for classes inheriting the abstract. Usually it is read easier than everything in one file.
>>
>>74775678
Quantitative analysis and derivative trading is 90% mathematics. I'm not saying this to put you off, but to prove a point: you're competing with mathematics PhD's, not programmers, so if you want to get into that, first learn mathematics, then start programming. Furthermore, machine learning is just a buzzword these days. Sure, quants use some ML algorithms in practice but they also do a lot more. C++ is a must in trading as well, at least the basics (some firms use functional languages, for instance, as their main).

My knowledge might be out of date since I have worked in IB for a few years, but I'm pretty sure a strong mathematics foundation and knowing C++ or something similar is more important than being able to use Tensorflow or whatever is popular these days.
>>
>>74775737
Interesting, anyways I have very little money so I can practice programming for years. I will probably quit if it is too unrealistic, but I feel enthusiastic.
>>
>>74775246
One text that I ran into recently was this discord blog post, but finding other tech blogs or studies seems to be difficult.

https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f
>>
>>74775237
1. grass is greener
2. language has feature that is needed for project but wasn't needed at the beginning
>>
>>74775341
>>74767675
>>74775652
>You overcomplicated this fucker.
true

I was trying to solve this problem for 2 days and it boils to down to this:
def main():
client = MPDClient()
client.connect('localhost', 6600)
files = client.listall()
files = [file.get('file') or file.get('directory') for file in files]

for file in files:
depth = file.count('/')
_, file = os.path.split(file)
indent = ' ' * depth
print(indent, file)

 ...
Mineral
1994 - 1998_ The Complete Collection
1-01 Five, Eight and Ten.flac
1-02 Gloria.flac
1-03 Slower.flac
1-04 Dolorosa.flac
....
toe
The Book About My Idle Plot on a Vague Anxiety
01 Hangyaku Suru Fuukei.flac
02 Kodoku no Hatsumei.flac
03 Tremolo + Delay.flac
04 Mukougishi ga Shiru Yume.flac
...
...


Now I just have to put it into a dictionary.
>>
>>74774500
Furry porn collection. Every programmer has one. Just ask your coworkers if they have a repo.
>>
>>74775341
>worked with mpd library
ye-
>for python
nevermind fuck off
>>
>>74774885
please help.. i'm very new to programming in general and i have no dea what to use for this problem. At least tell me what thing to use, no need for a written solution.
>>
>>74775856
do it on paper first with pure math then program it
>>
>>74774875
That's because you interviewed at GBS. GBS is a consulting division.
what were you expecting?
>>
>>74774885
>>74775856
A spectrogram is literally what you're asking to make
you do not have a spectrogram.
you have something else.
you don't know what a spectrogram is.
>>
>>74775912
Mate I have the spectrogram made. The data that you saw in the picture is the dataset I used to MAKE the spectrogram, but the data in this form is useless for me and I need it in another form, namely into a 3D array which has the amplitudes of every frequency in every frame.
>>
>>74775936
>3D array
this is what I mean when I say you don't know what a spectrogram is
music is 2-dimensional, the amplitude is the values of the matrix
>>
>>74775951
hell if you even bothered to look at the wikipedia article for a spectrogram they literally tell you how to do it
>>
>>74775951
>he doesn't listen to 3d music
>>
>>74775974
This is what happens when people don't take acid regularly
>>
>>74775951
Holy shit this has to be bait. A person cannot be this retarded. Ok smartass, you have time in X axis, Frequency on Y axis. Now tell me, on which axis do you have the AMPLITUDE of every frequncy? That's right, on the Z axis. This is what a spectrogram is.
>>
>>74776004
Says the retard gorilla nigger that doesn't even know how a fucking array works or how an image works

Go read a fucking book.
Guess what a 2D array is
THAT"S RIGHT A DISCRETE REPRESENTATION OF VALUES AT EVERY X AND Y COORDINATE
>>
>>74776004
>>74776047
My friends, please calm down. Give each other a hug.
>>
>>74776057
gay
>>
>>74776004
holy shit you're retarded
>>
>>74776047
you obviously have severe mental issues. I suggest you go take your meds, kiddo.
>>
>>74776065
hot
>>
I want a new thread that only contains friendship-posts and discussion about lisp
>>
>>74776081
enjoy never solving your problem because your head is too far up your own ass to read about what an array is
protip: numpy is clearly too advanced for you
>>
File: 3dspectrogram.jpg (8 KB, 223x275)
8 KB
8 KB JPG
>>74776078
what is this ? still think you're going to argue?
>>
What are some signs your not using a good language for your project? How do you find the right one?

>inb4 'it's not language x/y/z
>>
>>74776113
a 3D visualization of a 2D array.
>>
>>74776113
Are you an idiot? They just represented the value as height instead of color. There's nothing 3D about that graph besides the rendering.
>>
>>74776107
ok, what is an array then? humour me
>>
>>74776122
if your languages name is "python" that's usually a really good sign.
>>
>>74776130
I already told you.
If a scalar value is 1 dimensional
an array is 2 dimensional
a 2d array is 3 dimensional
pull your head out of your ass and read a fucking book.
jumping into problems isn't something anyone recommends without a basic understanding of the tools they have
>>
>>74776150
>>74776150
>>74776150
>>
>>74776122
I don't know what signs you can look out for, but when it comes to choosing language for projects I work on (mostly uni-stuff, so nothing massive) I look at:

Requires a specific library: Python probably has the most good libraries, I don't like the language but I have several times been saved by some good library it has.

If I can choose freely, I go Clojure.

High performance I do Rust.
>>
>>74776154
fuck off.
>>
>>74776127
you're 1000000% braindead. What part of X-time,Y-frequency, Z-amplitude (THREE(3) DIMENSIONS) don't you understand?
>>
>>74776203
fuck off idiot
>>
>>74776240
confirmed troll. enjoy your ban
>>
>>74776271
you're the fucking idiot who didn't know what 127.0.0.1 was. fuck off underage. even 12 year olds are more intelligent and knowledgeable than you.
>>
>>74776295
127.0.0.1 is a meme. Anyone that pretends not to know what that is is trolling for gullible anons. Disengage and forget about this stupid thread.



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.