[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 195 KB, 1280x720, Hidamari Sketch x SP - ED (BD 720p) [Kirakira] [C1EE34EA]-00:00:01.jpg [View same] [iqdb] [saucenao] [google] [report]
69513891 No.69513891 [Reply] [Original] [archived.moe] [rbt]

Old thread: >>69507076

What are you working on, /g/?

>> No.69513917

any recommendations for books about kernel development and linux?

>> No.69513933

Gochiusa manga

>> No.69513945

i just realized i dont know shit about programming. I just had to look up the difference between asp.net and c#

but im employed as a developer

>> No.69513947

Ok so I started learning python, i know the basic operands and data types but i dont really like the tutorial im doing, its just so boring. does anyone have a good guide to it? is the MIT one good?

>> No.69513949

I wrote a floppy in Linux and compiled it with my bootloader but the jit is acting up so I might have to print the Haskell scripts again.

>> No.69514004

Lisp is the most powerful programming language.

>> No.69514010

So Say you had a list of people in a room at a certain time
your data looks like this:
12:00 bob, sally, joe
1:00 sally, joe
2:00 sally, bob
how would you estimate the chance of who is talking to each other based on the timestamps?
I'd love to find a way to do this, I could probably also get goes online/offline messages, I'm still trying to think of the best format for the database, but I'm collecting the data which is the first step, any thoughts would be awesome /g/ents

>> No.69514097
File: 114 KB, 1534x672, Screen Shot 2019-01-25 at 2.06.36 AM.png [View same] [iqdb] [saucenao] [google] [report]

am i doin it right

for a todo list app

>> No.69514128

What tutorial?
And why it makes you boring?

>> No.69514140

Just read the official documentation

>> No.69514221

Yeah no shit, getting a job is all about faking it.

>> No.69514310

Overlapped time for other user / total time during that interval. It's be a sequence of adding up the proportion of times spent online, and I suppose you still have to keep track of _each_ interval, because you'd want the overall overlap. You might be able to short-cut it and add up the total overlapped time for each user first. Drawing a diagram would be the best way to visualize what's going on. You'd also need some values to predict or explicitly state someone is talking to someone else at all. If Person A is online alone, they can't talk to anyone, but if B and C are, they can talk to B, C, or B and C, or nobody.

>> No.69514382

Not a Python programmer but I wouldn't do Status(status) in __init__, I'd expect the argument to already be a Status.

>> No.69514483

Should i quit my job to study code? work wallmart and live in a rental with GF, whos a hairdresser.

I probably have enough saved to live for a few months by which time id need to get a new job, is it possible to get a coding job that quickly?

>> No.69514534


>> No.69514649


>> No.69514655

No reason you can’t learn code while working anon

>> No.69514686

Can anyone who knows java explain to a brainlet how I can solve the issue with netbeans and an “already existing” file error? I can’t seem to find an answer that works.
Link: https://stackoverflow.com/questions/17902591/netbeans-says-newly-created-file-already-exists-file-is-blank

>> No.69514795

i work 9 to 6 man, 40 minutes commute, they dont want us doing anything thats not job related, and they make new jobs to do if you finish your work fast

>> No.69514854

I have 3 dictionaries
{'bitrate': 1}
{'bitrate': 2}
{'bitrate': 3}

In python, how can I check which dictionary's bitrate key has the highest value?

>> No.69514894
File: 104 KB, 270x400, 1542844397259.jpg [View same] [iqdb] [saucenao] [google] [report]

In OpenGL (ES2), I have some textures with alpha channels that may or may not contain garbage. So I want to have a shader that will draw it with the alpha value taken from the texture and another which will hard-code the alpha to be 1.0.
Would it be better for me to create two separate shaders that do these, or create a single shader which does this based on a boolean uniform?

>> No.69514906

Why do you not just pass an alpha of 1?

>> No.69514925

normal advice in the past was to avoid branches in shaders so you would do two seperate shaders, no clue how relevant that advice is with modern vid cards
but you should make that alpha data not-garbage, optimization before the program is ever run is the best kind of optimization

>> No.69514940

I reading the textures from read-only memory I don't have direct control of, which is an XRGB format (i.e. 8 bits are unused). OpenGL doesn't allow you to read this kind of format without treating the X as alpha, and I can't trust that the X is going to contain 1.0. In fact, it's more likely to be 0.0.

>> No.69515005
File: 13 KB, 512x207, godot.png [View same] [iqdb] [saucenao] [google] [report]

some shitty enter the gungeon clone, made in godot
if you have any question regarding the engine or how to do X, just ask

>> No.69515021

quite nice. can't judge anything else beside that you've made two standard class though. And for enum, use ALL_CAPS or something else. I mean, what you're doing is fine, but I just think my way is nicer.

>> No.69515034
File: 51 KB, 700x392, JgrSc.jpg [View same] [iqdb] [saucenao] [google] [report]

From my outdated knowledge the principle that branches take the maximum cost for each warp. So you can't meaningfully early out unless it's guaranteed for the whole warp. With regards to simply overriding an alpha value I don't think it matters. Setting the uniform is much less costly than swapping program if you're not rendering these separately.
I think it's most importantly a code style preference. It depends on how separate these shaders really are (does the if scope virtually the entire shader or not). It's important to be aware of state changes cost.

>> No.69515047

wtf is a warp?

>> No.69515054

a = {'bitrate': 1}
b = {'bitrate': 2}
c = {'bitrate': 3}
max([i.get('bitrate') for i in (a,b,c)])

>> No.69515084
File: 104 KB, 924x761, class.png [View same] [iqdb] [saucenao] [google] [report]

can someone help me in PHP, I want to make a class for prepared statement. I have a function "preparedstmt" that accepts sql query, the types of data to be binded, and the data to be binded that has no definite numbers.

then I have created a function Select that solves if the username and password is existing on Database.... I'm new to OOP, and I dont even know what I have placed in this codes. Please help

>> No.69515118

At best you could go to some bootcamp(s) (paid) and get some shitty job making wordpress websites or something, but that's more of a customer service type job where it's not much programming and all being a salesman.

>> No.69515124

I'm not 100% on the terminology. It's either that or 'wavefront'.
A group of executions. In fragment shading its best to think of them as a group of pixels basically.
So to explain what I explained before if you've got 63 pixels that take a branch to do nothing and 1 of them does a massive amount of work all 64 of them will finish at the same time.

So that's why doing early out on gpu might not be all that constructive unless you're gonna have a lot of warps/wavefronts that all take the early out.

But again, I'm not up to date. This might not be true at all.

>> No.69515181

Thanks that works

>> No.69515183

he wants the biggest dictionary not the biggest value faggot

>> No.69515241
File: 3 KB, 840x39, screenshot.6.png [View same] [iqdb] [saucenao] [google] [report]

Actually is there an inline method for looping through the dictionary keys? All the keys are integers from 1~n. IE,

1 = {'bitrate': 1}
2 = {'bitrate': 2}
n = {'bitrate': n}

Can I do something like this somehow?
max([i.get('bitrate') for i in (dict[n])])

No I need the biggest bitrate value. I'm trying to scrap twitter videos from tweets. The status json gives me a video_info parameter which has variable bitrates, randomized for some dumb reason. I want the highest quality video from the tweet. I don't know if it's always 3 bitrate values or more, which is why I need to loop through a variable amount of dictionaries.

>> No.69515295

no you dont you want the dictionary with the biggest bitrate value so you can get the url from it
not a python cuck but the code should look something like this
a = {'bitrate': 1}
b = {'bitrate': 2}
c = {'bitrate': 3}
bestUrl = max(a, b, c, key=lambda dict: dict.get('bitrate')).get('url');

>> No.69515306
File: 140 KB, 1105x701, Shitty Archive.jpg [View same] [iqdb] [saucenao] [google] [report]

My shitty image catalog.

>> No.69515414

What exactly is happening in the following python output?

>>> 2 or 3
>>> 3 or 2
>>> 2 and 3
>>> 3 and 2

>> No.69515428

Thanks,That's better, but I still needed a way to loop through N amount of dictionaries,so I did this:

maximum = 0
max_key = None
for k in bitratedict:
if bitratedict[k].get('bitrate') > maximum:
maximum = bitratedict[k].get('bitrate')
max_key = k

The dictionaries keys are all integers so it works for my case. Thanks for the help

>> No.69515443

Python programmers are horrible people

>> No.69515452

In Haskell, is the tag for `data` types on the object or on the pointer?

>> No.69515459

I'm not a python programmer, I just need to use it because it has a good twitter api scraper. it's not my main language.

>> No.69515463

You could try not being retarded, but that'd mean you wouldn't need/want Python anymore.

>> No.69515480

regular Haskell types are thunks anyway

>> No.69515487

probably more detail than you want

>> No.69515499

Is it in the object payload or in the code that gets jumped to when "entering" (as per STG terminology)?

>> No.69515500

youre a nigger

>> No.69515504

Imagine having runtime type information in a statically typed language
Holy shit

>> No.69515509

Thanks. Looks like things have deviated pretty far from the original STG paper.

>> No.69515512

>A lifted type is one that contains bottom (_|_),

>> No.69515522

Get that disgusting PHP shit out of here. People who use PHP should be publicly crucified.

>> No.69515530

btw, the ghc codebase is *littered* with innuendos.

>> No.69515534

i'm pretty sure he's talking about the (enum) tag that determines which part of a variant it is

>> No.69515540

Link to some

>> No.69515542

If it is anything like lua, 'and' and 'or' statements return the last expression evaluated.

>> No.69515543

fuck you, PHP has a lot of job offers nigger

>> No.69515561

>implying you want to get a job as a code monkey maintaining a spaghetti code cluster fuck 10 year old site
I've done that, trust me, it's pure hell.

>> No.69515574

I know the pain, I have read retarded codes, but fuck what should I do with my life? I skipped college and PHP is a decent Backend language to do web dev. If I finished learning PHP I'll jump out of the pit immediately

>> No.69515584

and all of those freelance job are looking for PHP developers, no python, java, ruby, let me just earn my first income and learn

>> No.69515591

you got a better way of doing it?

>> No.69515623

dictArr = ...
bestDict = max(dictArr, key = lambda d: d.get('bitrate'))

>> No.69515637

theres nothing intermittant? like coding apprentice?

>> No.69515655

I already tried that and it didnt work

AttributeError: 'int' object has no attribute 'get'

>> No.69515668

get a fucking brain

>> No.69515687

If you use any of these languages, then you need to kill yourself:

>> No.69515706

t.fat NEET who makes toy programs

>> No.69515707

You forgot to add

>> No.69515724
File: 661 KB, 596x799, 1548358981266.png [View same] [iqdb] [saucenao] [google] [report]


>> No.69515731

nigger the way you wrote it simply doesnt work

>> No.69515755
File: 165 KB, 1000x432, 1545433565466.png [View same] [iqdb] [saucenao] [google] [report]

>anon posts pseudocode
>copy/paste it verbatim
>it doesnt work
>it's anon's fault

>> No.69515759

Tell me how do I know you're a massive faggot who had never written any useful programs.

>> No.69515772

>You haven't written any useful programs because you don't like many languages of questionable quality
I'm not even the person you replied to, but you're beyond retarded.

>> No.69515774

>responding to bait

>> No.69515775

I didn't copy paste it. I already told you I tried putting the dictionary as an iterable in the max function before he even made the post and it did not work.

>> No.69515791

>implying you have written any useful programs to the languages you like

>> No.69515792

such slang are forbidden on 4channel. read the rules, please.

>> No.69515802

Well, what would you call a person who says, 'you've to off yourself, just because you're using a certain language'?

>> No.69515806


>> No.69515813

Sounds like a write-error, possibly because the application doesn't have permission to write in a directory (or can only edit pre-existing files, a creation permissions issue on more complex systems).

>read only memory
>I wrote to it
When writing it the first time, just set the alpha channel to whatever. If you got the textures from another library, tell the person to fix their damn library.

>more likely to be 0
There should be a way to tell the shader to interpret the X as transparency versus opacity, or vice-versa, if that's where this data is coming from.

>> No.69515825

You should be banned for having retard-tier grammar.

>> No.69515833
File: 867 KB, 1024x1530, common_lisp_on_the_beach.jpg [View same] [iqdb] [saucenao] [google] [report]

Falling for LISP meme. So far so good.
At least it's quite fun.

>> No.69515858
File: 368 KB, 1000x494, js-rocks.png [View same] [iqdb] [saucenao] [google] [report]

JavaScript rocks!

>> No.69515863

>i tried putting the dictionary as an iterable in the max function
the dictionary that has the bitrate and url or are you talking about the list of dictionaries?

>> No.69515872

Maybe? Depends where you live.

Anyway the main point is that you can't just "learn coding" in a few months and get a real job, the only way that is possible is if you are doing incredibly high level stuff and being a total code monkey, making wordpress/salesforce/shopify type stuff, which requires very little programming knowledge..But pays like a programming job, and does in theory require a bit of programming.

But as a junior, your job will literally be "change the color of this button on our clients site"
or "add a banner plugin".

>> No.69515880

>>> mydict = {'a':{'bitrate': 1000, 'url':'aaa'}, 'b':{'bitrate': 2000, 'url':'bbb'}}
>>> max(mydict.values(), key=lambda k: k['bitrate'])['url']

>> No.69515889

>little programming knowledge..But pays like a programming job, and does in theory require a bit of programming
whatt? isnt that like html and css though? if it pays well then why not do it? im sure most places would offer carreer advancement

>> No.69515896

or (||) short-circuits on the first truthy value and returns the last thing that was evaluated
and (&&) short-circuits on the first falsy value and returns the last thing that was evaluated

>> No.69515908

>When writing it the first time, just set the alpha channel to whatever. If you got the textures from another library, tell the person to fix their damn library.
>There should be a way to tell the shader to interpret the X as transparency versus opacity, or vice-versa, if that's where this data is coming from.
It's a inter-process protocol, and I'm specifically supposed to ignore the X component. They could have set it to 0.5 for shits and giggles, and I have to make sure to ignore it.

>> No.69515932

Now that's what I'm talking about this anon got it, thanks

>> No.69516010

Yes, it's like basic front end dev and pretty much just putting the client's info in the the right parts of the HTML and adjusting the CSS theme to match their "design" or whatever, later on you'll advance to making plugins in PHP and stuff like that.

>why not do it
Because for most people they get into programming because they like the idea of solving problems and making much bigger things, making a wordpress site is like being a mcdonalds worker in the programming world, where most people want to become a Michelin star chef.

>> No.69516052

for some stupid reason my emloyer asked me to use tenserflow instead of opencv's deep learning functionality to create classifier. could someone please give some good readings/tutorials on this framework?

>> No.69516120
File: 137 KB, 640x351, file.png [View same] [iqdb] [saucenao] [google] [report]

with a flood of laid off journalists flooding the coding market, how will you get a job?

>> No.69516147

nothing to worry about, they will starve.

>> No.69516150

Haha, butthurt

>> No.69516154
File: 89 KB, 992x744, qOJAKMb.jpg [View same] [iqdb] [saucenao] [google] [report]

>getting a job

>> No.69516434


>> No.69516436
File: 62 KB, 660x455, 1546426321141.jpg [View same] [iqdb] [saucenao] [google] [report]

how to make nice looking gui for desktop program? any design tips? what are some alternatives to muh minimalism?
it's not really programming question but I don't know where to ask

>> No.69516447

Please reply with relevant responses next time.

>> No.69516448

>>69515414 here.

Thanks for the response >>69515542 and >>69515896. I am having trouble reconciling in my head your explanations with the following additional output:

>>> 0 or 1
>>> 1 or 0
>>> 0 and 1
>>> 1 and 0

>> No.69516456

>>>/gd/ would probably be a better place to ask.

>> No.69516457

Linux kernel development by Love
Understanding the linux kernel by Bovet and Cesati

>> No.69516488

I don't intend this to be taken as a joke in any way, nor do I intend it to be unnecessarily mean, but I think that the Rust community inadvertently discovered a new paradigm of software development: Autism-Driven Development.

When we look at what they've created, both from a technological standpoint and from a community standpoint, I can't help but notice the impact that Asperger Syndrome may have had on how things have developed.

Let's start with the community. While the communities of languages like Perl, C++, Python, Java and C# developed organically over time, it is almost as if the Rust community has been manufactured instead. It's like the community's interactions have been scripted, to use a programming analogy. It seems to me that the Rust Code of Conduct may actually be there as a way to allow people who suffer from varying degrees of social ineptitude to interact in a way that mimics how they see other, naturally-formed programming language communities made of sociable individuals interacting. They wouldn't be able to manage this social interaction on their own. But if you give them a script or a checklist they can follow, they can at least engage in something that appears, on the surface, to be socializing. That's why I think their incorporation of social justice is quite interesting. In many ways the concepts of social justice are all about imposing a foreign order on what is naturally a very chaotic and perhaps unfair reality.

>> No.69516495
File: 337 KB, 1920x976, Screen Shot 2019-01-25 at 12.20.45.png [View same] [iqdb] [saucenao] [google] [report]

Don't really browse /g/, would anyone familiar with p5 be willing to help me with something I'm stuck on?

Trying to make a clock but with a .png in place of the second/minute/hour hands.

If you look at the pic, you can see that I've gone as far as the hands, but I DON'T want the hands to be visible in the final. Instead, i want an outline of the UK moving on the 'tip'/'end' of the hands, to point to the time.

(this project is a joke btw, I'm not making a political statement and I'm certainly not from /pol/)

I'm very new to programming, how would I go about this?

>> No.69516499

The language and its standard library also reflect behavior that may be expected from those suffering from Asperger Syndrome. While creating the language, it is as if its developers haven't been able to make the normal trade-offs that other language developers have made with ease. We've seen this result in Rust, as a language, constantly change over time. It's like they're striving for some unattainable form of perfection that most normal people would realize could not be attained. While other people would accept some drawbacks to their creation and move on, the Rust community appears to waver back and forth, unable to really make up its mind about how to proceed. Even the supposedly stable Rust 1.x release branch has seen 19 minor releases!

I think the complexity of the language also reflects the role that, I suspect, Asperger Syndrome has had on the development of Rust. It has become an immensely complex and convoluted language, even compared to a rather complex language like C++. It's like the language has been designed, perhaps unintentionally, to be cryptic and unwelcoming to normal people. By its very nature it is like it is trying to be self-isolating, to avoid having to interact with the world and the people around it. Programming languages like Java, Python, C++, Perl and PHP want to be used by normal people. Those languages evolved in ways that draw in new users. But Rust? It has evolved to become very difficult and awkward to use, especially for new, average users.

>> No.69516505

dumb neurotypical

>> No.69516507


From what I can see, the entire Rust ecosystem exhibits the traits that have come to be associated with Asperger Syndrome, or autism in general. Rust has a certain natural awkwardness to it; a inherent difference from every other programming language and programming language community that exists. It's like it wants to fit in, yet no matter how hard it tries it just can't. It's like, in my opinion, the entire Rust ecosystem lacks a natural understanding or ease of existence that other programming language ecosystems develop naturally.

I am just speculating here, as I do not know any of the Rust developers on any personal level, but could it be that mild/moderate autism or some degree of Asperger Syndrome has influenced how the Rust programming language has developed? If the developers of a programming language exhibit autism or Asperger Syndrome, could they in turn pass this on, so to speak, to a programming language and a related community that they have created? Could Rust be an example of, for lack of a better term, Autism-Driven Development?

>> No.69516509

Good advice. You should follow it.

>> No.69516512

fuck off

>> No.69516530
File: 43 KB, 980x972, shit.png [View same] [iqdb] [saucenao] [google] [report]


Ideally, I want, England&Wales to point to the hours, Scotland to point to the minutes, and Northern Ireland to point to the seconds.

(again, this is not serious)

pic is a quick mock up

>> No.69516535

qt designer

>> No.69516539
File: 90 KB, 650x650, vomit.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.69516561

Look at it from the opposite PoV.
1. All functions shoudl be like lambdas.
2. Then what's the usage of functions?
3. naming a function is sometimes handy

>> No.69516578

>0 or 1
0 is falsey, so it evals 1, and returns 1
>1 or 0
1 is truthy, so it short circuits and returns 1
>0 and 1
0 is falsey, so it short circuits and returns 0
>1 and 0
1 is truthy, so it evals 0, and returns 0

>> No.69516597


>> No.69516606

you're right, he could just omit it and the program would work the same

>> No.69516614

>not using strict mode
>not using const by default

>> No.69516624

sounds like you should be writing rust instead

>> No.69516647

>following general, basic good practices means you should be using a worse language

>> No.69516657

>worse language
He said Rust not C.

>> No.69516659

get a different image for england, scotland, etc.
make a function that computes coordinates (on the star circle) based on time (rule of 3 to get an angle in radians from 12/60units, then using sin/cos you get your x/y coordinates).
once you've done that you do the same but compute the rotation.
write a function that applies rotation to an image
write a function that draws image at given coordinate over another one
compose all your functions
get time (hours, minutes, seconds)
call your composition with hours and england.png
call your composition with hours and scotland.png
call your composition with hours and ireland.png

>> No.69516666


>> No.69516668

nobody uses lisp because it's too powerful

>> No.69516683

you know too much

>> No.69516721

I like Lisp.

>> No.69516735

which one?

>> No.69516742

Common Lisp.

>> No.69516750

Thank you, I'm very stupid so it's going to take a while to work through this but I'll try and follow your instructions. Appreciate it.

>> No.69516777

which is known as the curse of Lisp.

>> No.69516799

Then zero it out, or perhaps you can use a second texture layer to ignore the first by doing some 0XXX magic bullshit, like texture 1 & texture 2 = texture 3, on a byte-wise level, or 1XXX is applied as an opacity mask, so the next thing only sees opaque-XXX, or a matrix of 0111 multiplied against your original texture.

I still can't imagine why you aren't actually modifying X before you load it into your "read only" data.

>> No.69516808
File: 113 KB, 351x398, db96f72aa4004d3cc03fba83ff97d4e1.gif [View same] [iqdb] [saucenao] [google] [report]

>tfw your boss tells you to manually write all the visual node editing graphics for your video encoding debugger by hand
>because opengl is unreliable
>it crashes on modern machines
Lmao Cniles.

>> No.69516809

>call your composition with hours and scotland.png
>call your composition with hours and ireland.png
I meant minutes and seconds.
also for the coordinates, you can give it an extra parameter : ratio.
you multiply your end result by that ratio, as to control how far you want to draw england from the center.
Just suck through it, lookup examples on google for very specific things ("how do I resize an image") or read the documentation. etc. etc. You might even get better ideas.
It's definitely feasible, even if you're a codemonkey, if you're really desperate/lost you can always ask more questtions.

>> No.69516826
File: 416 KB, 500x775, 1520520003975.png [View same] [iqdb] [saucenao] [google] [report]

Anyone here have experience renting a sublet for an internship? Any good sites you'd recommend to start looking?

>> No.69516827

I think /g/wdg/ are more on board with js/node.

>> No.69516863

Clojure's doing alright.

>> No.69516870

not a lisp.

>> No.69516873

I want to find the following permutations. An ordered sequence of tokens are grouped into nested pairs. The order must be preserved.
For example:
a b c => ((a b) c), (a (b c))
a b c d => (((a b) c) d), ((a b) (c d)), ((a (b c)) d), (a ((b c) d)), (a (b (c d)))
How do I find every grouping of a given sequence of tokens?

>> No.69516894

No reader macros but it's close enough to lisp for most people.

>> No.69516902
File: 85 KB, 680x680, madoka.jpg [View same] [iqdb] [saucenao] [google] [report]

>functional programmers

>> No.69516940

this is just a problem statement

>> No.69517020

That looks like a really good debugger. Just diffing two images live like that would be great for me.

>> No.69517226

I use scheme though.

>> No.69517237

You want to generate all the binary trees with n leaves?

>> No.69517241
File: 687 KB, 680x680, puke.png [View same] [iqdb] [saucenao] [google] [report]

>imperative programmers

>> No.69517252

I think that's one way of interpreting the problem. Because you can then enumerate the leaves and use them as a mapping to those tokens.

>> No.69517269

>>> b = 10
>>> c = b > 9
>>> c

>> No.69517365

type 'a t =
| Leaf of 'a
| Node of 'a t * 'a t

let print_t pp_x ppf t =
let rec loop ppf = function
| Leaf x -> pp_x ppf x
| Node (l, r) ->
Format.fprintf ppf "@[<hv 2>(%[email protected] %a)@]" loop l loop r in
loop ppf t

let print_list pp_x ppf = function
| [] -> ()
| [ x; ] -> pp_x ppf x
| x :: xs ->
ppf "%a%t"
pp_x x
(fun ppf ->
List.iter (fun x -> Format.fprintf ppf "@ %a" pp_x x) xs)

let print_unit ppf () = Format.fprintf ppf "_";;

let generate =
let h = Hashtbl.create 10 in
let rec gen n =
if Hashtbl.mem h n then
Hashtbl.find h n
let ans =
match n with
| 1 -> [ Leaf (); ]
| _ ->
let rec loop accu = function
| 0 -> accu
| k ->
let left = gen k in
let right = gen (n - k) in
let accu =
(fun accu l ->
(fun accu r -> Node (l, r) :: accu)
accu right)
accu left in
loop accu (pred k) in
loop [] (pred n) in
Hashtbl.add h n ans;
ans in

let () =
let ans = generate 6 in
Format.printf "@[<v>%[email protected]]" (print_list (print_t print_unit)) ans

>> No.69517378

for >>69516873

>> No.69517418


>> No.69517472

a more complete version with letters
and for n = 5
(A ((B (C D)) E))
(A (((B C) D) E))
(A ((B C) (D E)))
(A (B (C (D E))))
(A (B ((C D) E)))
((A B) ((C D) E))
((A B) (C (D E)))
(((A B) C) (D E))
((A (B C)) (D E))
(((A (B C)) D) E)
((((A B) C) D) E)
(((A B) (C D)) E)
((A (B (C D))) E)
((A ((B C) D)) E)

>> No.69517495

cheers pal

>> No.69517538
File: 25 KB, 330x330, 1541394163586.jpg [View same] [iqdb] [saucenao] [google] [report]

>clojure is not a lisp

>> No.69517555

That is still very true, although I believe a CUDA warp is 16 invocations and a GCN wavefront is 64 invocations.

>> No.69517597

Learning C at uni and a bit of matlab in linear algebra. What other language should I familiarize myself before next year?

>> No.69517614

C and matlab are great languages for totally different problem spaces.
I'd recommend trying something easy and flexible like Python or something more """academic""" like a Lisp or a Haskell
Or, learn a "job" language like Java or C#

>> No.69517620

lua would compliment it well, but it depends what you want to do. an oop might be a good idea, maybe c++ although its not c

>> No.69517632

Or haskell if you want something different.

>> No.69517645

Pattern matching is awso-

if let Some(rusqlite::Error::SqliteFailure(err, Some(msg))) = err {

Wait no! Give me back golang!

>> No.69517646

I think we have an object oriented programming course next fall. Might be learning java there. I’m familiar with that from high school luckily. I’ll look into lua and Haskell for now ty

>> No.69517656

use imports retard

>> No.69517659

Imo the best thing you can do is learn something that is fun and gets you excited. Otherwise you'll burn out and be miserable

>> No.69517662

Prove it is a lisp without mentioning s-exprs.

>> No.69517667

>Might be learning java there

>> No.69517700

It's still ugly af desu

>> No.69517708

(((it looks like lisp)))

>> No.69517717

How is the weaver in Mumbay those days.

>> No.69517724

use monads, retard

>> No.69517736

use combinators retard

>> No.69517753

>prove it is a lisp without mentioning the defining feature of lisps

>> No.69517762

The "math" programming language is pretty much C++ and it is widely used for a lot of things.
But assuming "next year" means February, I would familiarize yourself with build systems rather than programming languages.
There are so much stuff surrounding programming that is way more important than learning language features, learn that stuff.
If you are at a university, the programming stuff will be covered anyway, so right now, you can focus on making simple projects as complicated as possible so they match real world projects.

>> No.69517765

that'd be like >90% of all code senpai

>> No.69517800

Why clojure isn't a lisp?

>> No.69517804

It doesn't contain the Lisp primitives.

>> No.69517805

Good to know. Thanks.

>> No.69517819

It doesn't come from the Lisp region of France

>> No.69517848
File: 49 KB, 630x630, John McCarthy lisp man.jpg [View same] [iqdb] [saucenao] [google] [report]

ATOM, CONS, CAR, CDR, and EQ (McCarthy's paper).

clojure doesn't have the before-mentioned primitives.

>> No.69517871

>make binding for language
>namespace you make them under prefixes the first letters of the language name
Why? It's like they wrote it as a joke. The point is supposed to be that you integrated it into the language. If it's a good idea to remind your user that they're in current language right now then you did a poor job.

>> No.69517873

Ahah… y-yeah, I love using monoids in the category of endfunctors, it nice r-right. As for combinators… I totaly know what they are, ahah I did the Little (((Schemer))) once.

>> No.69517887

Undefined reference to function 'XXXXXXXX'
This shit has been the bane of my fucking day.
Dynamic link library builds : check.
Client application finds import library : check.
Client application produces above link error.
/g/ What do ?

>> No.69517918

I think we'd be reading a bit too much into it if we assume it's because they find the use of serious libraries in their shitlang novel. But it's a possibility.

>> No.69517954

You've obviously fucked up something senpai, no way to tell if you don't share your project

>> No.69517987

The weird thing about it is that the heap of shit builds and runs in a debug config.
I am in despair.

>> No.69517991

post an archive and I'll see if I can help senpai, you're build script is probably fucked

>> No.69518057
File: 86 KB, 847x960, pepe_rad_dudebro.jpg [View same] [iqdb] [saucenao] [google] [report]

match &err{
Some(rusqlite::Error::SqliteFailure(libsqlite3_sys::Error{code, extended_code}, Some(msg))) if code == &libsqlite3_sys::ErrorCode::ConstraintViolation => eprintln!("Huho! Niggers be using the database!!"),
Some(rusqlite::Error::SqliteFailure(_,_) => {
eprintln!("We ain't rapin no constrait, waddafuck man?! Better panic right now!!");
panic!(); //This make Rust panic and crasc. Bane? I'am CIA. Big guys memes! For (You)
_ => ()

Aaaaah, now the error handling logic is in place. Looks beautiful desu~, Rust is such an elegant language. Functional programming MASTERRACE showing those imperative peasants how to deal with database errors in the most elegant way. Can't wait for myself to rediscover this code 10 days from now.

>> No.69518065
File: 160 KB, 1280x720, sensei.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.69518139

What compiler / platform?
What compiler flags for each config?
What is 'XXX'? Post the exact declaration (or the mangled name from the link error if you don't know).
It's not impossible for a function you wanted to export to get optimized out (and therefore not exported) because you weren't explicit enough.

>> No.69518270

>What compiler / platform?
>What compiler flags for each config?
-Wfatal-errors -O3 -c
>What is 'XXX'? Post the exact
It's an exported function with the __stdcall calling convention.
It's not impossible for a function you wanted to export...
The .def file is telling me the function (mangled name) has been exported from the dll.

>> No.69518284

dumb frogposter

>> No.69518376

I want to export a goto label as a global variable. Is this possible?
void *mylabel; <--- How to initialize this to "one"?

void something() {
goto *mylabel;


>> No.69518383


>> No.69518386


>> No.69518390

>I want to export a goto label as a global variable
no you don't

>> No.69518415

What the fuck are you talking about?

>> No.69518423

mydict.keys() # returns all keys

mydick.items() # returns an array of tuples which have key and value

>> No.69518433

for key,value in mydick.items():
doYourShit(key, value)

>> No.69518465

kotlin & c# master race
it just works and it works on windows®™ and lunix

>> No.69518487


>> No.69518497

>-Wfatal-errors -O3 -c
Any differences between debug and release?
> It's an exported function with the __stdcall calling convention.
Is it extern "C"? Is it __declspec(dllexport) (probably since you said exported) and/or have __attribute__ stuff? Is any part of the declaration obscured by macros that could be wrong in the release config?
If you're certain it's getting exported, have you tried demangling the exported name? Is the name in your link error mangled?

>> No.69518528

Is it possible to implement a directory parser without some sort of stack to keep track of recently visited sub-directories?

Any online solutions, such as
seem to use one.

>> No.69518679

enjoy wasting time tinkering with your hobbyist lang

>> No.69518835

glTF is such a horrible format, my god.
>stored as flat list with indices even though a tree would work in many cases
>certain dependencies are logically reversed and/or decoupled with relevant information scattered all over the place, meaning you have to do a lot of preprocessing to get usable data

>> No.69518865

Forgot to mention:
>spec is designed to fit the limitations of fucking WebGL and web apps so you might have to deal with data being stored as Base64 in a data URI instead of just loading a file

>> No.69518930

>Is it possible to implement a directory deep traversal without some sort of stack to keep track of currently open directories?
ftfy. I don't think you can avoid a lot. typically with recursive traversals you can go depth-first, which is what this one does, or breadth first, ie let files = [root_dir]
let rec(files := files) = {
files_next := emptyList
for each f: files {
if (r := f.listdir)
files_next ++= r
files_next += f
if (files != files_next)

>> No.69518994


Apple patent monads

>> No.69519003

Never use break! It's inelegant, and it has been proven you only need if and for!

>join a project
while(1) { break; break; continue; break; goto; continue; break; break; }

>> No.69519016

>Never use break! It's inelegant, and it has been proven you only need if and for!
Said noone ever.

>> No.69519046

Potential problem with the breadth-first approach: it uses more memory if all you want to traverse are the leafs. Altho now that I think of it, with a filesystem what you could do is use the "get parent directory" operation (dot-dot, however you want to call it) and rely on it to keep track of your stack for you. I'd be careful around eg symlinks tho because this algorithm assumes that the children directories know their real parent. Yeah, in summary: avoid cucks.

>> No.69519056

Every single one of my teachers did, unless it was syntactically necessary (eg switch) I was told to change it

>> No.69519084

I bet those ivory tower-dwelling faggots wouldn't bat an eye if you translated the breaks literally into tail-recursive function calls.

>> No.69519098

I have a small project required to be written in VHDL and I don't want to go all the way to my Uni just to complete it
Are there any VHDL simulation software out there that is free and not full of spyware?

>> No.69519136

I'm pretty horny right now, anyone wanna lend me their dick

>> No.69519146

Do you check the return value of malloc or just assume it never fails?

>> No.69519161

I use xmalloc. Unless I'm writing a library.

>> No.69519176

kys tranny or girl larper

>> No.69519183

My Uni made us install Altera ModelSim, and, altho it's bloated af, I think it was legal and not too spywary afaict. Want a link to a Arch+LXDE vm that contains it in a ready-to-use format?

>> No.69519247

Anyone here ever used PySpark? it's worst abomination ever.

You can't do nested maps, filter, reduces, etc. because muh drivers/workers and parallelization.
Any real application that's ever gonna do achieve any shit is stateful.

>> No.69519262

my Arch PC won't boot so I need to use my shitty laptop with Win 7 that I haven't bothered to deal with

>> No.69519292

>make games
>minimum wage with unpaid overtime

>make enterprise software
>6 figures and universal respect

Who in their right mind would do the former?

>> No.69519331

People who value their sanity.

>> No.69519337

Idiots who think game development equals "get paid to play fun games"

>> No.69519339

>Linus Torvalds about Rust:
>That's not a new phenomenon at all. We've had the system people who used Modula-2 or Ada, and I have to say Rust looks a lot better than either of those two disasters.
In other words the Rust phenomenon is not new and will fade with time.

>> No.69519343

That's unfortunate. All I can offer you is to pick up "modelsim" for DOS++ on http://fpgasoftware.intel.com/?edition=lite&platform=windows. (It's "just" 1GB) In my experience it's bloated af but it does executes VHDL in a satisfactory fashion. (On Arch, dunno about CaveOS)

Fuck VHDL and its toolchain man.

>> No.69519376

My experience with Spark is just to use the Scala API because Python is legitimately more painful in that context.

>> No.69519384

Why did you leave out the rest of the response or the whole question?

>What do you think of the projects currently underway to develop OS kernels in languages like Rust (touted for having built-in safeties that C does not)?

>That's not a new phenomenon at all. We've had the system people who used Modula-2 or Ada, and I have to say Rust looks a lot better than either of those two disasters.
>I'm not convinced about Rust for an OS kernel (there's a lot more to system programming than the kernel, though), but at the same time there is no question that C has a lot of limitations.
>To anyone who wants to build their own kernel from scratch, I can just wish them luck. It's a huge project, and I don't think you actually solve any of the really hard kernel problems with your choice of programming language. The big problems tend to be about hardware support (all those drivers, all the odd details about different platforms, all the subtleties in memory management and resource accounting), and anybody who thinks that the choice of language simplifies those things a lot is likely to be very disappointed.

>> No.69519431

I'm writing my own histogram bins function. It will take an array of objects (in this case Javascript - I know, shoot me), a key and an int. If the int is 0, the function calculates its own bin widths. It then returns a 2d array with the bin values being the first for graphing, the second being the categorized objects. Theoretically I can integrate this with d3 to allow a tool tip with graphs of all the objects in each bin. I'm about to start the coding after lunch.

>> No.69519466

Honestly what is even the point of histograms? Just take all the data, sort it, and make a chart of that.

>> No.69519475

>Any differences between debug and release?
Other than the link error. Nothing.
>Is it extern "C"? Is it ...
Tried compiling with gcc (with extern "C" removed) and g++. The problem persists.
I'm convinced that the link order is messed up some how. Not using __attribute__ as not sharing data between dlls.
I'll throw the code at cl and see if that can build it.

>> No.69519485

hello! i'm iterating through ids of youtube videos to check whether they exist or not. for some reason following code says that every link i have doesn't exist but i know some of them do.
errors = 0
for link in relative_links:
video_id = link['src'].rsplit('/', 1)[-1]
response = 0
url = f"https://www.youtube.com/oembed?format=json&url=https://www.youtube.com/watch?v={video_id}"
response = urllib.request.urlopen(f"https://www.youtube.com/oembed?format=json&url=https://www.youtube.com/watch?v={video_id}").status
except HTTPError:
errors += 1
if response == 200:

is there anything that's obviously wrong here?

>> No.69519488

Yes, because writing netcode and lighting engines to diversity simulators and being bossed around by blue haired gremlins is so much better for your sanity

>> No.69519496

>is there anything that's obviously wrong here?
Yes, four spaces indentation.

>> No.69519519

>security advisories everyday
>convince me to use C

>> No.69519524
File: 84 KB, 423x432, 1a7c5deb48c21fabe4f8077123676151.jpg [View same] [iqdb] [saucenao] [google] [report]

this script is for personal use so i don't really care how many spaces there are.

>> No.69519525

Ey bro you should familiarize yourself with string interpolation.

In Python3, you can do this:

my_str = f"Task {self.taskID}: {self.description} [{self.status}]"

instead of using the .format() method for strings.
Makes your code much more readable and is easier to use.

>> No.69519526

Data scientists find value out of it. I agree with you but I also know that data science isn't my specialty. If I do this and it works then our clients data scientists can make use out of it.

>> No.69519542

>anything obviously wrong
the [Embed] after urlopen(url).status. You didn't exactly put effort into posting this snippet did you fagget? Other than that idfk. Post an example of a "relative_links" entry with the src field so I can play with it.

>> No.69519554

That's standard practice in Snek just fyi

>> No.69519569

I know, but it's bad. Two spaces indentation is the only sane way to indent, with a 72 column rule.

>> No.69519579

sorry, here's the whole function:
def scrape_videos(pages):
videos = []
i = 1
errors = 0
i_pages = len(pages)
for page in pages:
sys.stdout.write(f"\rScraping YouTube links... ({i} of {i_pages}; {errors} missing videos so far)")
raw_html = simple_get(page)
html = BeautifulSoup(raw_html, 'html.parser')
relative_links = html.find_all("embed", src=True)
for link in relative_links:
video_id = link['src'].rsplit('/', 1)[-1]
response = 0
url = f"https://www.youtube.com/oembed?format=json&url=https://www.youtube.com/watch?v={video_id}"
response = urllib.request.urlopen(f"https://www.youtube.com/oembed?format=json&url=https://www.youtube.com/watch?v={video_id}").status
except HTTPError:
errors += 1
if response == 200:
i += 1
return videos

>> No.69519590
File: 522 KB, 975x1357, 1523260168597.jpg [View same] [iqdb] [saucenao] [google] [report]

>Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

>Rationale: The whole idea behind indentation is to clearly define where a block of control starts and ends. Especially when you’ve been looking at your screen for 20 straight hours, you’ll find it a lot easier to see how the indentation works if you have large indentations.

>Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.

>In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep. Heed that warning.

>> No.69519596

Beginner here, my code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv)
char * string0 = "Hello, World!";
printf("\"string0\" text: %s\n", string0);
printf("Current address of \"string0\": %p\n", string0);
string0 = "Henlo frens";
printf("\"string0\" new text: %s\n", string0);
printf("Current address of \"string0\": %p\n", string0);

return 0;

Returns this:
"string0" text: Hello, World!
Current address of "string0": 00405064
"string0" new text: Henlo frens
Current address of "string0": 004050AA

Why changing the initial content string0 was pointing to also changes the address instead of overwriting in the same address? Is the address "00405064" still occupied?

>> No.69519600

each of the embeds look something like this:
<embed src="http://www.youtube.com/v/gaKW2DsVaPQ?fs=1&amp;hl=ru_RU" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed>
i'm scraping from nya.sh/videos btw

>> No.69519657

Routing daemon in Rust
Or at least investigating the feasibility

>> No.69519661

Linus will be allowed to talk about best practice when he will provide a documentation for the kernel.

>> No.69519710

OK. I see now:
>>> link = {"src": "http://www.youtube.com/v/gaKW2DsVaPQ?fs=1&amp;hl=ru_RU"}
>>> video_id = link['src'].rsplit('/', 1)[-1]
>>> video_id

This prolly ain't helping chief.

>> No.69519733
File: 8 KB, 241x209, 77217EE5-2D5B-4E9D-9682-6ACBD4373122.jpg [View same] [iqdb] [saucenao] [google] [report]

Would it be possible for me to make a localhost site that scrapes data from other sites so I can watch YouTube and browse custom sorted 4chan at the same time? If so this project might actually be worth my time.

>> No.69519789
File: 103 KB, 640x472, 7d5ed7c699bedd072d8c6e644c502a37.jpg [View same] [iqdb] [saucenao] [google] [report]

aw shit nigga you right
i get a json response when i remove all the redundant crap from the end of the id
thx senpai

>> No.69519799

Yes. It is possible both on server side and client side.

>> No.69519810

It is possible (why the wouldd it not be) but why a website instead of a program?

>> No.69519823

event-driven programming more like EVENT DRIVEN PIECE OF SHIT

>> No.69519845
File: 246 KB, 2048x1152, privyet.jpg [View same] [iqdb] [saucenao] [google] [report]

You're welcome slavanon. May the spirit of Vodka be with you!

>> No.69519854

*blocks you-
No wait, event driven systems barely block.

>> No.69519859

Because it’s easier to embed in html than stream YouTube.

>> No.69519885

Shaftshit is so ugly

>> No.69519928

is it open source or do you share the code anyware. coulde be cool to use it somthin like danbooru.

>> No.69520006

with extensions like {grease,violent}monkey you could even watch youtube ON 4channel.org

>> No.69520057

How do I make Python execute Bash and remember Bash variable assignments?
echo $a

>> No.69520069

You can't.

>> No.69520121

>watch youtube ON 4channel.org
WOW https://youtu.be/dv13gl0a-FA

>> No.69520126

Well that sucks.

>> No.69520138
File: 193 KB, 912x900, 1540314414474.png [View same] [iqdb] [saucenao] [google] [report]

>in process of learning learn C
>no resources on how to do anything but print strings in console
>cant even create a goddamn basic window
>all opengl resources work with c++ even though the api itself is written in C

All I wanted was to write C with opengl

>> No.69520148

You can still easily pass data from one language to the other tho.

>> No.69520165

Creating a window is very OS-dependent. Use a lib for that like GLUT or GLFW or whatever the fuck it's called. (or maybe SDL)

>> No.69520169

it appears you use
os.system("some command line call as a plaintext string")
Not a python programmer myself but you should be able to use Python's string formatting utilities (whatever the equivalent of sprintf is) to shove `a` into a string, and then pass that string as the argument

>> No.69520190


>> No.69520195
File: 27 KB, 352x482, 1445194400457.png [View same] [iqdb] [saucenao] [google] [report]

I did my googles for like an hour
I know for a fact that there must be some way to do that.
setting up opengl shouldnt be too hard but I would have to plop it into the window I have no idea how to create and its all very tiresome

I refuse to learn C++, I already write java at work and dont want more bloated garbage

>> No.69520196

Use GLFW if you want to use OpenGL, SDL if you want to use their 2D rendering library

>> No.69520198

Youtube Link Title

>> No.69520254

If your program needs windows don't use C

>> No.69520261

i'm working on a little project that is doing some stuff based on spatial information. I've got 2d array that holds a score for each of the cells, and I'd like to find the amount of "hot spots" that lie in this data.
I thought about applying some sort of threshold and then find how many times cells above the threshold appear consecutively, but the issue I have with this is that the score is kind of arbitrary and very dependant on input data, therefore I don't always know how to set the threshold.
any idea what I could do to either count the amount of hotspots without applying a threshold or somehow calculate this threshold? shit's trickier than I thought

t. brainlet

>> No.69520273

careful tho https://docs.python.org/3.6/library/shlex.html?highlight=shlex#shlex.quote

for big amounts of data, use a pipe or a temporary file.

TFW no zero-copy messages :,(

>> No.69520278

I want to do it with a Bash variable not a Python one. I want to do this
os.system("echo $a")

But it’s not working for me.

>> No.69520284

compute mean and standard deviation, test "is it over mean+standard deviation?" does that sound good to you?

>> No.69520295

Your wise advice is falling on deaf ears. Freshman don’t believe in using the right tool for the job (which C sometimes is)

>> No.69520296
File: 70 KB, 645x729, 1496925989771.png [View same] [iqdb] [saucenao] [google] [report]

Find local maximum and then include points around it with specified % of the local maximum?
I dunno dude, i thought about this for 30 secs

>> No.69520321

that's not how os.system works. Each call to os.system creates a new shell.

>> No.69520328

Is the local maximum a strict local maximum?

>> No.69520387

>does that sound good to you
it does, mainly becasue I don't really know wtf deviation is, just rough idea, will read about it and try to implement, thanks anon
this idea is even simpler, that might very well work just fine for my purposes, will try this too, thanks anon
nope, to be specific it is temperatures that this thing is processing, so theoretically there is no limit, and there is no knowing what the background temperature is either

>> No.69520394

Lads, I want to learn C++. Where should I start?

>> No.69520406

Lads, I want to learn Malboge. Where should I start?

>> No.69520422

Lads, I want to learn CUDA. Where should I start?

>> No.69520425

Don't learn C++. There are thousants of security advisories every day.

>> No.69520441

start by ignoring retards like >>69520425

>> No.69520454

Prove me wrong.

>> No.69520457
File: 31 KB, 247x247, 1518388028223.png [View same] [iqdb] [saucenao] [google] [report]

Done. What's the next step?

>> No.69520459

CUDA Handbook

>> No.69520486

You made a claim, back up your claim. I'd like >1000 security advisories for 1/24/2019.

What kind of programming background do you have?

>> No.69520506

>There are thousants of security advisories every day.
The very ones who say that malloc & free is bad and we all should use java and js with electron or somehing?

>> No.69520527

That's dumb. Is there a way in Python to execute Bash while keeping the same shell?

>> No.69520546

You could create a subprocess, and pass to that process stdin, but this seems like a wrong-problem kind of situation. What is it that you're actually trying to do?

>> No.69520551

You can download it.

C/C++ and the Internet simply don't match because you can get hacked with a single one of those.

>> No.69520565

He said C++, not C.

>> No.69520570

No diference. You will get hacked.

>> No.69520579

Maybe if you treat C++ as C with classes. Modern idiomatic C++ doesn't have buffer overflow issues.

>> No.69520596

Provide links to the >1000 CVE's that involved C++ that come out every single day

>> No.69520599


>> No.69520606

Practically zero. Best I can do is hello world. Any decent beginners book you'd recommend?

>> No.69520608

You would need to know what is modern C++, what is old C++ and what is C. That just can't be prevented when you code.

>> No.69520609

Everything starts with these two langs like OS(s), browsers, other PL compiler, interpreters and VMs.

>> No.69520617

Just use the search utility on the same website idiot. Those come every day.

>> No.69520620

I'm trying to make my own terminal. That's why I need shell variable retention.

>> No.69520626

You okay there anon

>> No.69520651

Haskell is more powerful than Lisp: its type system lets the compiler make inferences that are impossible for Lisp's compiler, and the result is far more optimized code.

In a different sense, assembly is more powerful than either of them: you, being human, can make inferences no compiler will ever be able to make, and produce code more optimized than any other existing language. In fact, humans have access to a class of compile-time inferences that are impossible for a compiler to fully account for: inferences that lead to a formally incorrect program that will always behave correctly in every case that anyone gives a shit about.

>> No.69520658

>You would need to know what is modern C++, what is old C++ and what is C
No shit. I expect this of every C++ programmer. Get the fuck out if you don't know something as basic as that about the language.

>> No.69520661

In that case, I'm going to suggest that you not start with C++. You can do a lot with C++, but having a good understanding of manual memory management in C will help you take advantage of all that C++ has to offer (such as object oriented programming, automatic memory management with RAII, and others). For learning C, there are lots of resources available. Personally, I learned from K&R C but I'm not sure it's the best book available anymore.
You should be making a subprocess anyway, since a terminal application shouldn't be acting as a shell.
Post some

>> No.69520695

>You need to know the tool you're using
why do anti-C and anti-C++ faggots have so much trouble with this?

>> No.69520698

You are plain wrong. For example, how do you get an enviroment variable without using getenv from C stdlib which return char * instead of string?

>> No.69520731

Just use envp. I don't know the specifics of how envp is layed out and it doesn't matter to programming in C++.

>> No.69520772

is getenv a part of the C++ standard?

>> No.69520788

Not him but modern C++ is trash. Way too many things to consider, and they're all way too verbose. Literally just use old C++, it's so much comfier

>> No.69520794

No it's part of the C standard.

>> No.69520812

New thread:

>> No.69520816

envp is another char pointer and it's not portable

>> No.69520819

C strings are garbage. They do not permit string views, requiring you to use horrible inefficient hacks if you want to call a function taking a char* on a string view.
I thought C was about efficiency. What braindead fucking thoughts were going through the creators head when they decided we didn't need string views.

>> No.69520849

Stop programming.

So? You can build a nice safe and efficient interface around it using string views. You can still use string views efficiently if you do the lookup yourself.

>> No.69520869

>and it's not portable
Oh forgot to read that part. In that case see >>69520819 and blame C for every single bad thing in C++ and how C++ needs to be remade new without all the C retardation.

>> No.69521103

>that dog took a shit on the sidewalk
>lol, you must want to take a shit on the sidewalk
You don't know what that means.

>> No.69521227

>>lol, you must want to take a shit on the sidewalk
How do you know I don't

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.