[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
DPT – Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 20
File: 1378344138548.png (502 KB, 934x1000) Image search: [Google]
1378344138548.png
502 KB, 934x1000
Old thread: >>55280913

What are you working on, /g/?
>>
>>55283589
First for XML!
>>
First for size(size_t) == 3 on IA-32!
>>
Please stop with the gay anime little girl shit
>>
>>55283589
Thank you for handling my fuckups.
>>
> implying you know C++
>>
>>55283647
Nobody knows C++
>>
Reminder that unspecified exception handling is the root of all evil in python.

https://realpython.com/blog/python/the-most-diabolical-python-antipattern/

https://stackoverflow.com/questions/21553327/why-is-except-pass-a-bad-programming-practice

https://stackoverflow.com/questions/10594113/bad-idea-to-catch-all-exceptions-in-python

http://blog.gauffin.org/2010/11/do-not-catch-that-exception/
>>
>>55283589
Every time I see DPT a voice in my head goes "dual penetration thread". Fuck you.
>>
>>55283672
get laid fag
>>
>>55283656
>Exception handling is the root of all evil.

ftfy
>>
Using a Turing complete language to build everything is like using a nuclear bomb for all construction work
>>
How can I average two units in prolog?
>>
>>55283735
average(x, y):
yes
>>
>>55283706
So... what non-Turing complete language you use to program?
>>
>>55283651
speak for yourself, webshit
>>
>>55283759
Not even Bjarne knows it

>>55283744
Cfags BTFO
>>
3D realistic cheese pizza MMORPG that you can play on the browser and is decentralized (no server, clients inform each other of location etc data)
>>
>>55283601
I wish my computer had a 24 bit type

it would make audio programming a tiny bit more elegant
>>
>>55283776
Why dont you just invent one fag
>>
>>55283802
because that would be less elegant
>>
>>55283776
Write a class that aligns the value to 24 bits and overload the operators to fiddle the bits.
>>
>>55283824
I'll fiddle YOUR bits, anon. ;)
>>
File: 1.png (61 KB, 132x164) Image search: [Google]
1.png
61 KB, 132x164
>>55283838
>>
>>55283812

Honestly, there are a lot of natural frequencies / calculations that would make more sense if we had a system built up from 3 bits rather than 4.
>>
>>55283838
>>55283849
Hey HEY, none of that bit fiddling in my thread
>>
Currently finishing up writing a program that does the following:

Factor trinomials
Find slope of the line/y-intercept.

Written in C++. Proud of the slope/y-intercept code, but the factor code is shitty. I wanted to implement the Master Product algorithm method, but it was easier to just use the quadratic formula.

I was thinking of cleaning it up and maybe making an android version. Sell it for $.99
>>
>>55283849
I don't understand that facial expression, please explain.
>>
File: 1417928842657.jpg (20 KB, 251x242) Image search: [Google]
1417928842657.jpg
20 KB, 251x242
>>55283862
>Sell it
>>
>>55283751
Simply-typed lambda calculus.
>>
>>55283861
Hey now Anon, if you were jealou syou could've asked to come too ;P

/but to be more on topic, I really need to pickup angular again, might need it for a work thing soonish. Will probably write a shitty little thing that's just a couple of forms and shit, since what I'm doing is Health industry shit.

[spoiler]But really though, who wants their bits fiddled?[/spoiler]
>>
>>55283897
fuck. we don't have that here, do we?
>>
>>55283897
>angular
kys
>>
>>55283879
It was a joke. No one is going to pay for this program.

I'm trying to become a better coder in C++ by taking on mathematics based projects, though. I'm also learning MATLAB, doing basic DSP.
>>
>>55283897
just stfu and put it in your mouth slut
>>
>>55283886

So how do you use this in a practical non academic manner?
>>
>>55283914
Mmmm, why don't you make me?
>>
>>55283908
> Learning MATLAB
> not learning python with numpy, sympy, etc.
Why?
>>
>>55283908
https://projecteuler.net/
>>
>>55283906
I didn't chose it, it's a pre-existing project. I personally despise all Javascript.
>>
>>55283922
too much effort for some non-passable autistic faggot on /g/ lel
>>
>>55283954
Awww, you killed the mood. ;P No how am I supposed to troll on /g/ if people wont enable my autistic bullshit?

Besides, maybe I legitimately like getting all faggoty with smart people.
>>
>>55283926
Because MATLAB/C++ is used in engineering more often than Python.
>>55283930
Thanks! Looks perfect. Any other recommendations???
>>
>>55283981
I know you want the dick but I'm not in the mood to do the work lel. Shoot me an e-mail or something so we can um get to know each other deeply.
>>
>>55283767
>Not even Bjarne knows it
so? is that supposed to make you feel good about your incompetence?
>>
>>55284012
I would need an email address for that you silly fagget~
>>
>>55283981
>>55284012
I really hope one of you is LONDON
>>
>>55284013
Speaking of C++, did anyone else see what they added in for the C++17 spec? Not very impressed with it all myself.
>>
>>55283589

So I'm migrating over to C++ from MATLAB for some numerical simulations because I hear that even without all the convenience of MATLAB's inbuilt functions for linear algebra and vector handling C++ processes the code much quicker and thus is vastly superior for computationally heavy simulations. I just got visual studio and I have no idea where the fuck to start, especially since 90% of the guides are either at an intermediate level or they are oriented towards people looking to develop applications and GUIs. I just want to code maths and eventually want to use the results within MATLAB since it makes nice plots and visualizations and want to see where to start. Help a retard out.
>>
>>55283990
No, I don't know any other sites like that. Those challenges are perfect to learn MATLAB if you like maths. I had a lot of fun with them.
>>
>itt: retards think the C standard is relevant.

All that matters is the assembly the three real compilers emit.
>>
>>55283770
Good luck validating data and enjoy your mmo played with hacks by every user
>>
>>55284044
>an e-mail or something
>I would need an email address for that you silly fagget~
i changed my mind
>>
>>55284105
No fun. And here I was about to do ALL the fun gay things to you.
>>
How to tell a computer scientist apart from a programmer: Gauge their reaction to seeing the church encoding of the booleans + "basic" (not, and, or) boolean operations
>>
>>55284105
>rereads own post
>realize it implies I have no email
>fuck
Also, do note I was talking about your email address, yes, I have email.
>>
gay exclusive (no traps) /dpt/ when?
>>
>>55284130
if = λpxy.pxy
true = λxy.x
false = λxy.y
not = λpxy.pyx
and = λabxy.a(bxy)y
or = λabxy.ax(bxy)
>>
>>55284183
>implying gays can code

In my experience they're worse than women. Even autistic weeaboos are better than gays.
>>
>>55284183
You willing to participate?
>>
>>55284216
>autistic weeaboos
>better than gays
really? the mentally ill are better than the mentally ill?
>>
>>55284216
I'll believe it when they program the perfect waifu
>>
>>55284205
I'd like to see the definition of that λxy struct
>>
>>55284216
so autistic weeaboos are better than daddy turing? kill yourself

>>55284228
sure, why not
>>
>>55284239
It's shorthand. The following are equivalent:

λxy.M

λx.λy.M
>>
>>55284254
Well, if >>55284012 ever responds we can have a big, gay party. Got an email address we could engage in faggotry on?
>>
>>55284254
>implying Turing didn't steal his with from that woman in his lab

Kek. Gayfags are so delusional.
>>
>>55284271
wow, you're really thirsty for my dick huh. shoot me your email address
>>
>>55284130
>boolean operations
Do you mean 'logical operators'? The BHK interpretation of lambda calculus and the CH correspondence concern intuitionistic logic, which is a Heyting algebra not Boolean.
>>
>>55284205
Amateur.
if = id
true = const
false = not true
not = flip
and = λpq.p(q true false) false
or = λpq.p true (q true false)

ftfy
>>
>>55284282
lol, stay delusional japfreak, daddy turing x daddy alonzo x daddy hilbert were totally getting it on and it's a fact that the entire field of computer science is obscenely gay

>>55284271
i do, but what kind of faggotry would we engage on? i don't want to erp or anything, i just want gay buddies who like to program
>>
>>55284322
>implying I'm weebshit

All I said was that gays are worse than them. Apparently they can't read either, so gays might be worse than Pajeet too.
>>
>>55284337
only weebshits defend other weebshits over gaybros
>>
>>55284298
>>55284322
I dunno. I like having gay buddies who code too. Why don't you hit me up at [email protected] and we shall see where it goes?
>>
>>55284346
Can I come too, even if I don't have a penis?
>>
>>55284346
im the guy you've been so eagerly waiting a reply from lol, imma hit you up now. i like how eager you are ;p
>>
>>55284352
what are your qualifications
>>
>>55284352
Yes, yes you may. Programming buddies are best buddies, regardless of genitailia.

>>55284362
I aim to please, and to have smart gay men to surround myself with like a hyper intellectual harem.
>>
>>55284378
I have a BA in CS
>>
>>55284322
>>55284362
>>55284352
SHIT, misspelled the email, [email protected]
>>
>>55284381
hope you got some strong jaws and energy then, it says recipient failed tho, rewrite your address
>>
>>55284391
you can come but you have to like penis
>>
>>55284322
>>55284391
[email protected]

come pay me a visit, let's chat and enjoy ourselves~
>>
>>55284398
Eww
>>
>>55284435
you don't need to like penis, women are super annoying and boring tho, stay away bb
>>
>/dpt/ is now a hook up thread for fags
Suddenly I remember why I stopped coming here.
>>
>>55284457
they're just cargo culting turing
>>
>>55284457
it's specifically not hook ups man, if they start doing weird hook up shit I'm leaving and not talking to them

I just want other /dpt/ fags. you know you'd want a /dpt/ girl to talk to if there were any in here
>>
>>55284457
>be me
>troll reply about bit fiddling in a programming thread because lol
>actually get hit on by smart gayboys and an alleged lady
>victory.jpg?

I apologize to you anon, but I am not sorry
>>
>>55284103
easy, just have the game logic on the server
>>
>>55284481
dw you'll be given lots of opportunities to show us gratitude x
>>
>>55284534
Oh my. Not that could go a lot of ways, most of them interesting.
>>
>>55284506
>no server
>just ... on the server
Ok anon.
>>
>>55284547
Now*

>>55284391
So, are you joining this party or what? I wanna chat CS with you dammit
>>
>>55284558
we should make a group of some sort
>>
>>55284571
I could setup a discord or some shit.
>>
>>55284547
it could get pretty intense ;D
>>55284558
you kids do your hangout thing, imma keep using mail
>>
>>55284550
ethereum or some other cryptoblock validation meme
>>
>>55284595
I should certainly hope I could. and I have only received emails from two of you nerds, one of ya is holding out on me.

>reCAPTCHA really likes fucking storefronts today
>>
>>55284595
I should hope it could get intense. Also, I have only received emails from two of you, I am minus one /g/ friend to hang with. How sad.
>>
>>55284587
Mumble is more free.
>>
>>55284745
I could get us a mumble, if all of you really wanted to.
>>
>>55284759
Actually, fuck it. Who wants a /g/ buddy mumble? Faggotry not required.
>>
>>55284759
why not the discord though, it's easier to set up
>>
>>55284759
you're going to be able to make only muffles from now on
>>
>>55284774
What's a mumble?
>>
>>55284777
I can go either way, Mumble, Discord, whatever. i already run a few discord server's, so I'd rather do that, but some people prefer the fact that mumble is Open Source.
>>
>>55284667
Nice framerates, Pajeet.
>>
>>55284782
https://en.wikipedia.org/wiki/Mumble_(software)
>>
>>55284796
allow preliminary actions, send actions in batches for validation, if the player gets marked as a hacker your client can get told by other nodes to block him in advance without even doing preliminary actions
>>
whatever you guys do, please do not become power hungry and please do not indulge attention whores. a /dpt/ chat must be kept civil and thoughtful
>>
>>55284841
Fuck off with your CoC shenanigans
>>
>>55284841
Ha, didn't mean to attention whore, sorry.
>>
>>55284873
Shut up. Calculus of Constructions is one of the best PTS there is.
>>
GNU Turd kernel and realistic 3d cheese pizza MMORPG programmer out, bye kids, remember to poo in loo
>>
Should I Haskell or OCaml?
>>
File: smug_sakura.jpg (29 KB, 337x404) Image search: [Google]
smug_sakura.jpg
29 KB, 337x404
>2016

>He still codes by hand instead of evolving his software automatically

Found a codemonkey!
>>
>>55285044
neither but ocaml

fuck hasklel
>>
File: 20160627_115531.jpg (630 KB, 1920x1080) Image search: [Google]
20160627_115531.jpg
630 KB, 1920x1080
This is the faggot that wants to be my submissive sissy girl and suck intelligent and capable nerds off LOL
>>
>>55285050
>codes
when will you seek help for your mental illness?
>>
>>55285050
>'he' posts anime
Found the virgin
>>
File: 1455311885635.jpg (5 KB, 200x200) Image search: [Google]
1455311885635.jpg
5 KB, 200x200
>>55285050
you do know that /dpt/ is mostly the same people posting over and over again?
>>
>>55285064
MUH DUCK!
>>
>>55285064
nice neckbeard
>>
>>55285082
Quack?
>>
>>55285076
>getting raped over and over again
>he never learns
weeb...
>>
>>55285086
It's /g/ what do you expect?
>>
>>55285092
You know it gee! :^)
>>
>>55285064
>submissive sissy girl
>

sigh
for a moment I really thought we were going to have a nice group, but no, it had to be hook up shit
>>
>>55285130
At first I though it was joke. It was not joke my freind. I am le sad
>>
>>55285130
Actual penis-less person here. I knew this would happen, that's why I didn't join
>>
>>55285150
we get it, you're a girl and you have a vagina, here's some attention lmao
>>
>>55285140
>>55285150
the ability to send images over the internet as well as stream video was a mistake

I fucking hate everything. why are there so many seemingly cool people in dpt but then everyone who actually exchanges contacts just wants sexual shit
>>
>>55285150
Tits or GTFO
This is 4chan, no one cares that you have a vag
>>
>>55285187
because that's all you have to offer besides your dull personality and lack of knowledge in anything lol, quit crying and go to a normie chat site
>>
>>55285187
>inb4 it is all le epic troll to piss you off
>>
>>55285187
Because people that are cool aren't looking for friends on 4chan
>>
>>55285209
>Implying 4chan isn't just one sad, lonely fucker. Talking to himself via the internets.
>>
>>55285209
destroyed
>>
I'm itching to try out more Cython, what should I make?
>>
>>55285191
>>55285178
You both cared enough to reply, lol ;-)
>>
>>55285238
4chan clone named pychan, do it.
>>
>>55285252
NSA malware, use 4py instead
>>
>>55285252
>webdev
no thnx
>>
>>55285280
Who said it had to be web? Clearly it should all just be done via IRC style relays
>>
>>55285289
NSA pls go
>>
>>55285303
But I just want a hug.... and all your personal data
>>
File: output.webm (2 MB, 1280x720) Image search: [Google]
output.webm
2 MB, 1280x720
display is not very good to see, but it shows the adc value
>>
File: paul (16th copy).png (735 KB, 1396x1600) Image search: [Google]
paul (16th copy).png
735 KB, 1396x1600
>>55285406
good job bud now make a matrix.
>>
>>55285502
saved the image atleast. Maybe on the weekend.
>>
I have a game where a contact with the enemy ends the game but when I use removeFromParent on the enemy node it only removes the most recent one. The enemies are spawned using a switch statement to determine what side they enter from and once a contact happens and the game ends the nodes still present mess up the game by causing more contacts. If the user doesn't press anything and the enemies finish their trajectory during the game over screen then the problem doesn't occur.

Could I kill all the nodes from the screen any way once the game ends? Could I suspend input for like 3 seconds during the end screen to let the actions finish? Do I need to enumerate the enemies as they spawn to kill them off one by one once the game ends?

I've been stuck on this for like 3 days and would love some help. I think I explained it fairly well but if I need to show any code please ask and I will. I'm very new to swift by the way.
>>
File: stroustrup sez.png (1 MB, 1010x764) Image search: [Google]
stroustrup sez.png
1 MB, 1010x764
>mfw space engineers is written purely in C#
>it runs like shit

this is what happens when you don't write your games in C++ you fucking normies
>>
>>55285626
sorry, its in swift and I'm making a simple iphone game.
>>
>>55285626
You managed to write 3 paragraphs without stating the language, data structure and a simple sample you're using. Congratulations on being a retard.
>>
>>55285698
No, he mentionned the language:
>I'm very new to Swift btw
Apart from that, yeah, that blob of text is properly repulsive. I cant be bother to actually read it in depth, agreed.
>>
>>55285698
haha, sorry. I really don't know enough to be clear. They're spritenodes. I'm just wondering if there is some swift command to make all nodes fuck off when a bool changes. Or can I make it not accept touches for a few seconds? Do you know or can you help me?
>>
what math courses do I need to take in order to start learning DSP?
>>
>>55285803
Wtf is Swift in your mind??? To me it's a new memelang from Apple, but in your post it sounds like a dumb framework. Explain yourself moron, I cant even start to understand your stupid problem if I dont know where to look for background documentation.
>>
>>55285626
Ok, fuck that, I get that it's Swift+SpriteKit from Apple. I'd say this:
- iterate over them
- call removeFromParent on every one of them one-by-one
Would that not do it? Seems like iteration in SpriteKit is contrived, but I found this:
http://stackoverflow.com/questions/26112340/iterate-all-sprite-nodes-in-spritekit-using-swift
maybe it'll help if you haven't already seen it?
>>
>>55285810
All of them, start with Ramsey Theory
>>
>>55285050
Fuck off Yahweh
>>
>>55285178
>girl
>>55285191
>boipucci
>vag
>>
>>55284066
New > Project > Visual C++ > Console Application

Use standard C++

Write data to a compatible file format; maybe a .mat file if the spec for it is open or just use a .csv file

If you want to get really fancy you can automate the entire pipeline right from a matlab script. Import your .mat file, invoke C++ program on file, open the created file with your script, plot away.
>>
I completed 18 SICP exercises today.

1.

x = (list 1 2)

(car x) equals 1
cdr x = (2)
(car (cdr x)) = 2

Why is this allowed?

2. Is it useful to think of lists as tonnes of pairs? Are the differences of list(), append, and cons anything more than a pain in the ass?
>>
>>55285687
minecraft is written in java and is shit, that doesn't mean java is shit
you can write slow code in C++ too
>>
>>55286139
[t] :: [] | t : [t]
>>
>>55286139
x = (list 1 2) //is the same thing as:

x = (cons 1 (2)) //2 is still a list which has both a car and cdr

//(1 2)
(car (cdr)) //displays 2



elements of a list always have both a car and cdr
>>
>>55286226
*(car (cdr x))
>>
File: sicp_cover2.jpg (25 KB, 278x244) Image search: [Google]
sicp_cover2.jpg
25 KB, 278x244
>>55286139
>Why is this allowed?
Why not?

>Is it useful to think of lists as tonnes of pairs?
Yes, it gives a very natural destructuring for recursive functions, and it allows for dotted lists and circular lists to exist.

>Are the differences of list(), append, and cons anything more than a pain in the ass?
They can't not exist. Sometimes tho, quasiquotes are handy, but they are just a shorthand.

Feel free to ask more question, I'm a pious Emacs preacher and I gave nothing to do this evening ;^)
>>
>>55286168
>minecraft is written in java and is shit, that doesn't mean java is shit
you are right, java was shit even before minecraft existed
>>
>>55286139
>Is it useful to think of lists as tonnes of pairs?
a list IS a ton of pairs

(1 2 3 4) is actually

(cons 1 (cons 2 (cons 3 (cons 4 nil))))
>>
>>55286263
*have
>>
>>55286284
epic
>>
>>55286263
>I'm a pious Emacs preacher and I gave nothing to do this evening ;^)
vimmer here

how do I switch windows?

is C-x o the only way?
>>
>>55285687
what pc are you running and what frame rates are you getting? the graphics look ok tier and it's a large scale game so have some reasonable expectation of the performance, probably runs better than kerbal space program while having shitloads better physics and graphics etc
>>
>>55284322
/r/ing turing/church slashfic
>>
>>55286333
and as far as i can tell it's not even written in C#, probably C++ with C# as a scripting/modding language
>>
>>55286327
Dunno, I actually use Evil and Spacemacs. But yeah, after a quick inspection, it seems like that's the only way.

Remarks:
Why would I use more than two windows anyway? It's just messy
Ace is installed by default on Spacemacs and it could interest you.
>>
>>55286395
I'm trying to actually learn emacs tho

spacemacs feels like a hack 2bh
you end up having to resort to emacs commands anyway


I want an editor that is consistent
>>
>>55285810
You need calculus and algebra. You also need to know how the Sigma sum operator works.

That should be enough for some DSP
>>
>>55286466
>You need calculus
well sheeiuut

I don't take that until next spring

I am going up to calc 3 and physics 2 before I transfer to a university tho
>>
File: piliersdelademocratie.png (116 KB, 2372x1549) Image search: [Google]
piliersdelademocratie.png
116 KB, 2372x1549
>>55286427
I understand where you're coming from. I used to use it Vanilla or almost, and it's also good that way. But then I fell for Vim's modal editing and now I'm trying to recover my holiness.

>you end up having to resort to emacs commands anyway
True, I have to periodically. If Spacemacs were perfect tho that would be the bomb IMHO. Emacs needs a rewrite, but it's so extensible...

>I want an editor that is consistent
Is VIVIVI inconsistent in your opinion? I have an idea what kind of inconsistencies you could see and I agree, but I want to know.
>>
>>55286391
Nope.
>>
I keep failing my job interviews when applying for new positions. I get to the thrid round itnerviews with multiple companies but then they throw me some programming question and I always panic. I don't think I'm meant for programming afetr all this. What would be another course of action / career for me to take?
>>
>>55286580
killing oneself
>>
File: maxresdefault (2).jpg (20 KB, 1280x720) Image search: [Google]
maxresdefault (2).jpg
20 KB, 1280x720
>>55286580
>>
Can someone with a Mac please see if they can get this to compile? https://github.com/rzumer/Webbum/
I don't have access to one, so I haven't been able to test yet.

You would need Qt, and (for the master branch) ffmpeg libraries (it looks in /usr/lib, so if ffmpeg-devel exists on Mac that should work).

If you want to try the libav branch as well, I haven't tested it on Linux, so the paths in the .pro are probably wrong. You'd need to change the paths to the ones used by libav libraries if needed, and let me know which ones to use or pull request. I suspect it is /usr/local/lib/ or /usr/lib. The main branch is more important to me right now though, and if that one coincides with the Linux config, I can fix libav as well.
>>
Any of you have apps on android/ iphone market? have you had much success?
>>
>>55286580
You can probably try sucking dicks
>>
>>55286333
I have an i7 and a gtx 670

I'm fine if I'm not on a planet or something. I'm gonna look through their code to see where they fucked up. Either that or just rewrite it in C++
>>
File: AMD spontaneous fires explained.png (358 KB, 575x592) Image search: [Google]
AMD spontaneous fires explained.png
358 KB, 575x592
>>55286666
And with these digits, the thread was killed
>>
Looking to create a peer-to-peer chat program for some friends and myself. Not sure on how to get started.

I figure if I know their route to a specific server, and I know my route to that same server, then I can create a socket and open a connection between two of us. Is that correct?
>>
Hello,

Is anybody having any issues with SDL2 getting to recognize a gamecontroller?

I compiled SDL2.0.4 from source, that could be why.

I tried an afterglow 360 controller and an xbox one controller and neither passed the SDL_IsGameController() function.

What I found online is alot of people asking, but no one giving answers. Something to do with xinput.
>>
>>55287325
do you really need SDL_IsGameController()?
why not just get the kinds of inputs the device has, and then if it has (a,b or x,y) and (up,down,left,right) and perhaps (at lest one joystick) then it doesn't matter if it's technically a "GameController" or not
>>
>>55287436
The left trigger and right trigger use the same axis, so i've had a really hard time getting them to work. Otherwise i've already coded everything I need for the joypad.

That's the only major issue, aside from the DEVICE_ADDED and DEVICE_REMOVED events never occuring (but it's my understanding those don't work period).
>>
Trying to get a bit more familiar with C, so I tried implementing a string queue.

https://gist.github.com/anonymous/8755fea0f81525f6a09a6cac3bd2ed63

I have close to zero experience with C, so I'm looking for critique. Is there anything I'm doing terribly wrong/should avoid doing?
>>
>>55284058
Bruh, fold expressions make variadic template arguments actually easy to use. The most useful additions in C++17 are probably standard library additions though.

I'm mostly excited for when concepts finally gets added though. after using it for a while now with GCC I wish there was major mainstream support.
>>
>>55287615
I gave it a quick glance, and it looks fine, I'm assuming you're being careful and making sure to free *every* malloc()'d string. I know some people would recommend using an array instead of a linked list to implement it.

Line six could just be
queue_item *next;
>>
>closures in R keep the entire environment around in memory, not just the objects you referenced
whut

who thought that was a good idea
>>
>>55287615
>close to zero experience with C
you're already better than more /dpt/ citizens
>>
>>55287708
I used just
queue_item *next;
initially, but the compiler was screaming about queue_item being an unknown type at the time
>>
>>55287615
Linked lists suck ass but that's the right way to store a queue of strings in a linked list
>>
>>55287708
Not without forward declaration.
>>
>>55287724
It's completely sensible given R's uses and the general paradigm of popular libraries.
>>
>>55287660
>finally getting concepts
Welcome to the 80s, C++
>>
File: tips fedora.jpg (42 KB, 333x333) Image search: [Google]
tips fedora.jpg
42 KB, 333x333
>>55287951
>Linked lists suck ass
>>
>>55288245
They do. They're space efficient, have horrible asymptotics for most operations, and traversing one performs terribly because of cache misses. Name a situation in which they're the best tool for the job.
>>
>>55288297
Damnit, I meant space inefficient
>>
Any good relaxing electronic or non electronic music to listen to while programming?
>>
>>55288297
>Name a situation in which they're the best tool for the job.
Teaching CS students how not to program so Indians can take their jobs.
>>
>>55288245
the good thing about linked lists is their utility for teaching new people about pointers and time complexity, since they have O(1) insert but O(n) search
but that's pretty much it
>>
>>55288359
https://www.youtube.com/watch?v=jgNvzc-ZdME
>>
>>55288359
I found this a few days ago
https://www.youtube.com/watch?v=yBsfw-QIB0o
>>
>>55288384
Since inserts usually come after O(n) searches, they are hardly O(1).

Unless you mean inserting to head/tail of course. in that case arrays would be O(1) too.
>>
>>55288429
Prepending to an array is definitely not O(1).
>>
>>55288462
It might be, if you leave a buffer at the beginning too
>>
>>55288297
You're kidding, right? Any time you're doing a lot of insertions/deletions in the list.

Unless it's a list of some basic type. because then it's just retarded no matter how you look at it.
>>
File: fite me.jpg (54 KB, 612x612) Image search: [Google]
fite me.jpg
54 KB, 612x612
>>55288297
You're kidding, right?

Any time you're doing many insertions/deletions in the list. That's literally what they're for.
>>
>>55288492
Yes, that would work. I was thinking of a simple array, not a more complex structure backed by arrays.
>>
>>55288509
>Any time you're doing a lot of insertions/deletions in the list.
this is really uncommon
the majority of the time you can just use a sorted array because the insertions/deletions are always happening at the beginning or end

and in the vast majority of the remaining cases you can just use a hashmap instead
>>
>>55288547
>>55288509
All those allocations anon, you wound me. You best be only inserting and deleting at the head and tail, too.
>>
Would it be cool to have a /dpt/ discord? For idle chatter and collaboration on projects...
>>
>>55288685
I wouldn't see a problem as long as none of it spills over into the thread.
I've seen the results of posting chat logs to their respective generals and it ain't a pretty sight
>>
>>55288685
Yeah and a subleddit too :-))
>>
>>55288685
>another discord suggestion
Why is this shitty gaymer app being suggested three times in every thread?

What's wrong with IRC?
>>
File: 7fcbe223744809.5632820b834f1.png (351 KB, 600x338) Image search: [Google]
7fcbe223744809.5632820b834f1.png
351 KB, 600x338
A pyqt4 based media viewer inspired by Kodi's reFocus theme Recently Added list to view my porn collection complete with metadata database and thumbnails.

It's currently on a fappable state, need to clean up the UI more.
>>
>>55288754
IRC is more work to set up/manage. Also a higher barrier of entry, but I guess a bunch of programmers should manage to connect their asses to IRC. Either would be fine.
>>
>>55288216
I don't see how that follows. This is a language-specific implementation detail that presumably came before any libraries even existed, and there's nothing about R's typical usage that should require using memory that inefficiently or allowing state quirks like it does now.
>>
>>55288685
>no logging
>no control over the server or the channel beyond basic editing and topic changing permissions
>entirely browser based, no proper API
discord is shit
>>
Reminder that procedural, data driven code is the only true code.
Everything else is error prone bloat
>>
>>55288851
>a higher barrier of entry
Very slightly. IRC is not difficult to use.
>>
>>55288939
>data driven
what does that even mean? all programming beyond entirely deterministic scripting can be justifiably called "data driven"
>>
>>55288851
>>55288892
Just set up a #gentoomen channel
>>
>>55288921
>>entirely browser based, no proper API
There's a standalone application and also https://discordapp.com/developers/docs/intro

>>no logging
IRC also only has logging through bots.

>>no control over the server or the channel beyond basic editing and topic changing permissions
I'm pretty sure you can also change things like who gets to join your channels, set up user groups etc.
>>
>>55288967
he's talking about data oriented design which is popular with a niche group of video game programming spergs
>>
>>55288984
Still, what's wrong with IRC?
>>
>>55288984
>There's a standalone application
The standalone application is a lightweight web browser that visits the discord homepage. Before they locked it down somewhat, you used to be able to open up any link in the Discord application and visit any website.

>IRC also only has logging through bots
... and also every client on the face of the earth

>I'm pretty sure you can also change things like who gets to join your channels, set up user groups etc.
okay, but that's still pretty light compared to the level of control you have over a proper IRC server.
>>
>>55289015
Nothing. It's just that

>>55288980
I personally don't have enough experience with IRC, someone else would have to set it up.
>>
>>55289015
It's not the hip new gaymer fad

Reminder that this board is mostly /v/ spillover
>>
>>55288297
>have horrible asymptotics for most operations
Most of them are literally O(1)
>>
>>55288967
Data driven simply means that the design decisions were based upon efficiently manipulating the dataset, rather than an idealized abstraction of it.
A basic form of this is packing the cache line to the fullest.
>>
Is it still considered recursion if you don't return anything? For instance if the function is called within itself but the modifier is void.
>>
>>55288685
sounds fun, send me an invite if you make it
>>55288754
IRC is nice but last time I tried making a /dpt/ channel it died within a day or two
>>
>>55289702
yes
>>
>>55288685
no, it will turn into a circlejerk which will turn into tripfags which will spam threads with their "memes"
>>
>>55289868
that's literally what it's like right now
>>
>>55288359
Go to di.fm and listen to whatever genre fits you best, I found that it's really nice for focus music, it's got trance, vocal, chillout etc
>>
>Tfw programming is too hard
>>
c++17 sure is looking neat.
>>
>>55288547
>believing everything pajeet tells you

https://isocpp.org/blog/2014/06/stroustrup-lists
>>
>>55290352
protip: it's easy and you're either retarded or not trying
>>
>>55290352
>I'm too stupid to write line-by-line instructions for a computer
>>
>>55290453
Okay pal program me a network nodes of reverse binary trees

>>55290461
Just admit it. It's difficult
>>
File: jabba.jpg (89 KB, 1280x1021) Image search: [Google]
jabba.jpg
89 KB, 1280x1021
>>55290461
>he's to stupid for declarative programming
>>
>>55290761
o shit i fucked that spelling, should be "too"
>>
>>55290761
I was talking about Object Oriented programming btw Java
Thread replies: 255
Thread images: 20

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.