# New & Revised /dpt/ Code of Conduct # We want to ensure that the /dpt/ community, while large and diverse, remains welcoming and respectful to all participants. To that end, we have a few ground rules that we ask people to adhere to.
- *Be friendly and patient.*
- *Be welcoming.* We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
- *Be respectful.* Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the /dpt/ community should be respectful when dealing with other members as well as with people outside the /dpt/ community.
- *When we disagree, try to understand why.* Disagreements, both social and technical, happen all the time and /dpt/ is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of /dpt/ comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
Is there one of those lists of projects to implement?
I need something to practice my C before I move on to C#
Brandon Perry
Are you expecting us to read all that? We have important brainfuck projects to work on!
Daniel Howard
I'm making pancakes
>/dpt/ frequenters will get this
John Brooks
>What are you working on, anonymous ? a TCG, with monsters and dragons and shiet
Eli Thomas
Thinking about namefagging on dpt.
Give me one reason not to.
Owen Peterson
There you go my dude
Ryan Brooks
No one gives a shit.
Julian Martin
you will instantly be hacked and all your devices full of violent gay porn.
Thomas White
>all your devices full of violent gay porn. but it already is?
Noah Mitchell
I have a question about good practice in C++.
Let's say I have the following class defined in Foo.h class Foo { ... private: Bar *bar; }; where Bar is another class.
In my makefile, I've specified both Foo.cpp and Bar.cpp, which in turn include their respective header files. Now, my question is this: Do I #include "Bar.h" from within Foo.h, or simply do a forward declaration (which is feasible, due to only using Bar pointers)?
Nathan Brown
No one cares who you are on here It means you probably have a big ego and people will dislike you for it
Leo Baker
Forward declare wherever possible.
Nolan Murphy
Why is it every shitty programmer likes anime? Whenever I see people using anime avatars on github their code is invariably shit and every person I've met in real life who likes anime is some greasy neckbeard manchild.
Christopher Ortiz
That is a very tiny room. I hope there's some brilliant solution for ventilation and airflow.
Leo Ramirez
I've had this problem for a long time. Can't speak to their code quality, but anime lovers are invariably wierdos who I would never want to associate with irl. Nothing you can do.
Ignore and move on.
Adam King
Yeah thats what I've noticed, personally. In my experience they're basically like "bronies". I don't particularly care that they like childrens cartoons, but they overwhelmingly seem to act like children as well.
Carter Jenkins
I like anime but I don't shove it in anyone's face. Nobody knows I like anime. Most people are like this.
But since this is an anonymous site we don't feel the need to hide it.
Nathan Diaz
I'm sorry, i must have ended up on Tumblr by mistake. Could you guys point me the way to Cred Forums?
Joshua Bennett
Can I practice this with php?
Aiden Richardson
Yeah these googles are killing Cred Forums
Isaac Harris
...
Aiden Rivera
wow haven't been to Cred Forums for some months but op is still a faggot
Anthony Adams
So, /dpt/. If we forced all of the Haskell programmers in this thread to only program in x86-64 assembly for a week, what kind of code do you think they'd all produce?
Are you a reasonably interesting person? Can you program your way out of a box?
The problem is less so much that they like anime, and more that they're attention whores. I just use the stock avatar on github.
Isaiah Collins
I'm interested in learning SDL and OpenGL for making a vidya game, but should I stick with C or learn C++?
Angel Harris
Do you WANT to learn C++? If so, might as well start now. Otherwise, sticking with C will do fine.
Jeremiah Lopez
If you're making anything bigger than tetris go for C++.
Sure you could make it in c. But id go for c++ as it will make your life easier.
The only reasons to ever use C these days are either embedded programming or you want to create a library with lots of bindings to other languages.
Brayden Phillips
C++ is a terrible terrible language. Stick with C, or use another language like Rust or D.
nothing visibly wrong with that. if you want a better answer, post all the code.
Christian Sullivan
There is a reason everyone uses c++ in vidya dev user. Don't listen to Cred Forums, they have a superiority complex so they think telling people to use C for everything makes them look smart.
>D >Any better than C++ Just no. >Rust Unproductive language, it takes ages to write something. Maybe I'd use it if I was gonna program a space shuttle and a single bug could kill people.
Isaac Mitchell
The last line *literally* answers your first line
Aaron Reyes
I'm currently writing a game engine using C++ and OpenGL, and I would say it's worth it to learn C++. Sure, it's been done before in C by many, but I like the object orientation when it comes to games, which obviously is made up of objects.
Jack Lee
I'm trying to research diversity of race and ethnicity in Hollywood movies (2016 titles if that matters). It is pretty easy to scrape and compile the data of titles and actors/actresses, but I'm stuck on the problem of how/where to look up the racial background of each individual actor in an automated way.
Asher Cox
OOP is a terrible way to design games.
Landon Morgan
How so?
Eli Hernandez
False
Lincoln Miller
>the entire industry is wrong
Leo Smith
here the concrete code
class Card { public: Card(); virtual ~Card(); void printcarddata(); int cardnumber;
In games you will make heavy use of polymorphism and using c++ virtual functions beats using function pointers or creating your own dispatch table.
Henry Clark
Why not try and see for yourself?
Liam White
""" The more social subset of hackerdom watches anime because it reinforces their identities and values. Anime shares a certain aesthetic with the computer and Wired culture, thus it is attractive to hackers. """
""" 76 to 85 percent of anime fans are male.
Anime fans tend to be students.
Most anime fans who are student major in either computer science or electrical engineering.
Most anime fans who are not students are high-tech workers. """
Grayson Martin
OOP is a terrible way to design anything, so it's a terrible way to design games.
Polymorphism is not exclusive to OOP. >virtual functions Terrible performance.
Justin Price
I'm finishing my electrical engineering studies and they're making us learn the following languages >C >C++ >VHDL
What are some other languages that could be relevant to my field of work at some point?
Henry Thomas
Explaining nothing.
>Anime shares a certain aesthetic with the computer and Wired culture Wat?
Julian Campbell
verilog forth
Luis Brooks
What is your field of work?
Hunter Gutierrez
>Terrible performance As opposed to function pointers or a dispatch table? But user, virtual functions ARE implemented using dispatch tables. The only difference is that in C you have to write it manually and so you're more likely to write bugs.
David Foster
x86 assembly MATLAB
Dominic Thompson
>There is a reason everyone uses c++ in vidya dev user. Mainly technical debt and cultural spread tho. Ride the tiger etc.
Robert Sanders
Technical debt?
Oliver Robinson
the -> operator has higher precedence than dereferencing, so this (*cardn->cardnumber) is equivalent to (*(cardn->cardnumber))
also cardn is an iterator, so *cardn has type Card, so it should be cardn->cardnumber, or (*cardn).cardnumber
at least, thats what i think. im kinda tired.
Jason Allen
Any LUA programmers here? I trued writing this hastebin.com/ehihuguhoc.vbs For mpv, to download the currently playing video file. But It doesn't work. Any idea?
Zachary James
>Suggests user is wrong >Doesn't suggest the solution
Gavin Reed
rolling
Aaron Turner
The industry is moving toward muh data-driven and muh homegrown entity systems.
Ryan Richardson
Historically it was all C user. There is a reason they switched to C++
They would switch again if something better came available. Most gameplay code is no longer written in C++ already.
William Robinson
""" The Anime Aesthetic
The anime aesthetic is similar to Harris' description of the aesthetic of the computer[9]. Harris goes even so far as to say that modern computer systems are filled with "comic-book froufrou" which hides the internal function of the computer. The connection between the comic-book look and anime is simple: anime comes from Japanese comic strips, called manga. The colorful, smooth, articulate aesthetic is common to both the computer and anime. While Harris goes on to describe why this aesthetic is a bad thing -- at least that it serves no purpose -- computer hackers appreciate the beauty they can create with the computer even if it is useless in practice. Levy's description of the hacker ethic states you can create art and beauty on a computer , and he goes on to discuss how a hacker spent hours working on program that would play a song. """
Xavier Campbell
From what I get so far, if I dont wish to make Computer games or other high performance stuff, there is no reason to go deep into C++?
Simply learn Java, JS Angular, CSS, as everyone does?
Blake Morris
thanks a lot, I will try it
Christian White
I have met some god-tier anime loving programmers. So I have respect.
Still have never watched any of that shit. Still visit an antarctic 2d pictorial interaction application.
Isaiah Bennett
#include #include #include
char *strrevdup(char *src) { size_t len = strlen(src); if (!len) return NULL;
char *str = (char *) malloc(len+1); if (!str) return NULL;
how can i improve my program to make it less shitty? t. new so no bulli pls
Jayden Morgan
Applying for that kind of job right now (binding). It will make me very happy if I get it.
Nicholas Russell
Sounds like a load of bullshit.
Dominic Price
Thank you user
Well I don't know that yet, I'll have to make the decision in a few months and the big specialization next year
Oh yes we've dabbled in both of those, I remember assembly being a massive pain
Thomas Thomas
Exactly. >C Embedded stuff, kernels, small libraries. >C++ Large high performance projects (like games) >C#, Java Desktop/mobile apps. Server apps. >Python,ect... If you wanna make it werk quickly and don't care about performance. >JavaScript Web >Ruby Only use if you're gay
Justin Myers
>so it should be cardn->cardnumber, or (*cardn).cardnumber thats what helped!
thanks a lot again.
Anthony Parker
>ow can i improve my program to make it less shitty? >strrevdup More descriptive function names comes to mind.
Jose Williams
Okay, thanks. This is the impression I got as well.
And I will consider Ruby.
Grayson Rodriguez
> Mainly technical debt and cultural spread tho. Those are reasons they didn't switch from C to C++ earlier (that, and the fact that C++ compilers tended to be fairly shitty for the first decade or so).
They aren't going to be switching back to C, whose only real advantage is that there's less to learn, which only counts for something if you're an amateur/casual programmer.
Cameron Taylor
hey Cred Forums what books would you recommend for a dev stuck in "no mans land" (not a beginner, but not advanced), i have seen the god-tier books on the wiki are they still relevant?
Justin Stewart
what should i put instead?
Nolan Powell
I would recommend you stop reading books and start a project on something that interests you.
Then just google/read up on problems as they arise.
Nolan Russell
I don't know, do i? That's the problem. I shouldn't have to analyze the code to know what the function is supposed to do.
Brandon Ross
If I wanted to start with some basic graphics, as if wanting to make my own game engine, what should the language and library I use be?
It's mainly for learning experience, rather than developing anything particular.
Easton Hill
c++
Ayden Russell
it duplicates a string and reverses it
Adrian Davis
And libraries?
I don't know enough about graphics yet to use something like Vulcan/opengl
Sebastian Lopez
C++ and opengl
Elijah Wright
c++ has the most libraries and tools for game development.
Tyler Smith
Are you unable to think of a good function name for that?
Is OpenGL easy to get into? I don't think I know enough
Jordan Bennett
Something like char* DuplicateAndReverse(char *cstr);
Angel Ramirez
yeah i have no imagination sorry
Jackson Gray
>CamelCase eww
Juan Barnes
There's plenty of documentation and tutorials for it. It helps if you know a bit linear algebra
Dominic Hughes
its not camelcase camelcase would be
duplicateAndReverse
Brody Cox
That's even worse!
Christian Barnes
strdup_rev()
Tyler Miller
Now you're back where you started.
Lucas Ortiz
>Making your own engine As someone with experience making games as a hobby. Making an engine is the wrong way to go about it.
What you wanna do is make games. Not engines. Otherwise you'll waste a lot of time wondering what features your engine needs and implementing ones it doesn't need. And half a year later you'll still have nothing.
Anyway I think learnopengl.com is currently the best resource for beginners to learn graphics programming.
Gavin Flores
what would be a beginners tool for testing? particular functions, instead of having to relaunch the whole program again and again.
John Cook
But making the engine is the interesting bit.
Cameron Lopez
what language ?
Lincoln Lee
Going through a roguelike C# tutorial. It's cool to see stuff I learned previously actually come together.
Gabriel Hall
BlueJ IDLE
Eli Flores
c++ and java
thanks. i think IDLE is the more mainstream one?
Jose Bell
JUnit
Hudson Nguyen
Yeah I agree but if you don't have a game in mind you can work towards you'll just program aimlessly, i've been there myself and there is a reason /agdg/ cals engine devs nodevs.
Once you're on your second, third,... game you'll start reusing your old code and eventually you'll be left with an engine.
Benjamin Long
>game you'll start reusing your old code and eventually you'll be left with an engine. True enough.
Hunter Wilson
rate my hello world: #include
int main(void) {
printf("hello, world!\n");
return 0;
}
Hudson Sanders
BlueJ is for java. I took a noob java course a long time a ago. We used BlueJ. At the end of the course we were supposed to make a small complete program, and the whole class was stumped, and the teacher was "oh wait, did we actually forget to teach you about main?".
For c++ it's HTFU.
Brayden Jones
careful, someone might steal your ideas and claim ownership
Liam Gonzalez
"hello, world!"/10
Nolan Williams
Add length into strrevdup as a second argument so you can avoid strlen() if the user already has the length (for example with a static sized buffer). Then either let the interface always be: strrevdup(s, strlen(s)) or maybe add a special case for len == 0 and then you call strlen() inside strrevdup.
Michael King
If I want to make games, I think I'd use Unity or GameMaker Studio.
But making an engine would be fun side project to slowly build. I know it'd never amount to anything serious, but would be fun thing to do.
But yeah, I realise making a game engine to make my own game is reinventing the wheel.
Cooper Powell
>HTFU google search doesnt give me anythung ;__; typo?
Henry Turner
To be honest followed the C philosophy of naming functions. If you'd create a function named strrevdup in Java I would agree that is stupid, but in C I really don't see an issue.
Jaxon Price
bloated as fuck
Hunter Thompson
>Give me one reason not to. I can't think of one reason you should.
Dominic King
Cool man. i have some RLtuts "queued up" aswell. Atleast the ones with hq
Luis Carter
how much is that
Robert Hughes
Forward declarations save compilation time.
However, raw pointers in C++ is generally considered bad. You need to have an exceptionally good reason to justify not using unique_ptr, shared_ptr etc.
Adam Lewis
>printf instead of puts or write 2 / 10 see me after class
The C philosophy of naming functions is shit, and a relic from when storage space was limited so you didn't want your source code to me unnecessarily large. There's absolutely no reason to stick to it anymore.
Brayden Clark
No wat I mean is that without something in mind you'll have a hard time figuring out how to write an engine that is practical or even usuable.
If you don't want to make a game then just clone Mario or something. As long as you have a clear goal on mind.
Christopher Reyes
m80 if you want an answer you really need to start including all the code thats executed.
Brayden Brooks
Ah, yeah I guess that's fair.
I think my "engine" would just do a basic 3D environment, that can be walked around and textured. But I guess once I did that, it would be a "well that's done, not much point now..."
Anthony Turner
That would be a good start. You would have something to build on. Then you can give the player a reason walk around the environment.
James Ward
AGDG is retarded though because most enginedevs are clearly working towards a specific game.
Xavier Morgan
more CALLs than actual code
Luke Allen
Ambitious target for one, self-learning programmer with only C as a good experience.
But yeah, I will try and follow something.
It's either that or make some games in studio maker. Or learn Swift and do iOS app development that way.
I'm new to meme science and R. What are some good beginner projects?
Jordan Butler
TAOCP
Thomas Martinez
filtering
Austin Hernandez
...
Alexander Butler
...
Dominic Lee
>trusting the compiler
Juan Brown
>unique_ptr Why? What benefits does it has that a raw pointer doesn't?
Grayson Fisher
>You need to have an exceptionally good reason to justify not using unique_ptr, shared_ptr etc. How about "I'm not a baby"?
Robert Jones
do i still need to learn arrays in C++, if i can already use STL containers and iterators?
Leo White
yes.
Luis Brooks
Yes you do. Don't be a bargaining codemonkey, master the fundamentals before depending on the STL.
Michael Watson
okay senpais. but i am still finding myself using vectors, for convenience reasons.
Grayson Diaz
arrays are now an obsolete data structure, a relic from the past.
Adam Roberts
Nah, they are great for cases where you want to avoid overhead. A vector of ints can be wasteful if an array works for your purposes, since you'd use 64 bit pointers for each 16 bit integer and the extra level of indirection increases access times.
Lincoln Gomez
so the basic difference between java and c++ is the lack of pointers in the former?
Lincoln Brown
Java has pointers sun.misc.Unsafe
Cameron Brown
>since you'd use 64 bit pointers for each 16 bit integer lel, no. the only overhead is 8 bytes.
Jack Flores
dreamt in code last night: i can't really remember what the program was about now though. i think it was oop
Nathan Rogers
>dreaming in oop get help
Caleb Wright
014 Collatz Conjecture ayy
Liam Rivera
Was it when of those dreams that made perfect sense while you were in the dream, but then when you want up you realise how insanely illogical everything was?
Jayden Cruz
It was OOP, so I doubt even he thought it was logical
Christopher Brown
>i think it was oop that's no dream, that's a nightmare
these get funnier and funnier everytime
Kevin Williams
known to hold for values well above INT_MAX not the worst short script to write
Oliver Martinez
r u a kid prodigy can u make me a google
Evan Brooks
rloling for a gud projekt
Adrian Phillips
garbage collection in the former, as well, so you have non-deterministic object destruction.
personally i prefer C++ templates to java generics, particularly when it comes to functors.
Logan Thompson
#include #include #include int main() { std::vector v = { 5, 1, 3, 4, 2 }; std::sort(v.cbegin(), v.cend()); for (int i : v) std::cout
Dylan Rodriguez
why do weebs have to ruin everything
John Turner
You're supposed to implement it yourself you donut.
William Murphy
>Java lacks pointers >All objects are pointers by default ? Integer a = 10; Integer b = a;
a += 10; System.out.println(b); ????
Isaac Green
>LUA see lua.org/about.html >Like most names, it should be written in lower case with an initial capital, that is, "Lua". Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!
Luke Lee
that's what the :^) was for you muffin >tfw my shitposting is too advanced for Cred Forums
Christopher Hernandez
Thanks for nothing you useless reptile.
Ian Smith
in haskell this is just import Data.List (sort) main = print $ sort [5,1,3,4,2]
Wyatt Jones
But that's a singly linked list user, not a vector. Lists don't have O(1) random access.
Matthew Adams
>1474404234145.jpg fizzbuzz plez
Nolan Rodriguez
it didn't say anything about vectors
Evan Nelson
...
Jaxon Moore
Here you go, I editted his code for him
#include #include #include #include
int main() { std::vector v = { 5, 1, 3, 4, 2}; time_t seed; time(&seed); while (!std::is_sorted(v.begin(),v.end())){ shuffle (v.begin(), v.end(), std::default_random_engine(seed)); for (auto a:v){ std::cout
William Moore
Best algorithm.
Owen Kelly
Can someone please calculate the big-O of that one? Is the worst case O(∞) ?
Samuel Stewart
After reading every single post to this point, you might as well call this a C++ thread ...
Levi Butler
best case is O(n)
Lincoln Williams
>Is the worst case O(∞) ? No.
Brayden Bailey
im going to rewrite akaribbs in x86 assembler!
Josiah Flores
>shuffle >no using namespace std >not std::shuffle This shit's not even gonna compile. Probably better anyway.
OP's pic is very true. Only women program computers. It's where they belong. Couldnt make money with them in the kitchen anyway. Good they know their place these days.
""" For any collection of fixed size, the expected running time of the algorithm is finite for much the same reason that the infinite monkey theorem holds: there is some probability of getting the right permutation, so given an unbounded number of tries it will almost surely eventually be chosen. """
Also, it could be infinite with a true random number generator but such a thing doesn't exist.
It's a command line app for getting the data for judas.watch/
Christopher Reed
no you wrote
class returnACustomObject () {
that's not a real function you want
custom returnACustomObject () {
Sebastian Brooks
Yeah, but instead of 'class' you use the name of the object class, like when you define the object.
Carter Baker
ah, ofc
my bad and you are right, would be dumb if you could not
David Moore
i'm not ur dude, "man"
Brayden Perry
I stopped caring about Haskell when I was introduced to the concept of monads. What a crock of shit. If your program can only modify state by inventing a higher-order abstraction that can't exist, like some kind of programming deity, then you are fucking wrong and the language is flawed. Same for type checking that basically says "the correct type is whatever the correct type is". That's what the error message said transcribed to words, but god forbid if i wrote in down in English instead of the meme Haskell runes that GHC marks me wrong.
Haskell is logical and category theory never lies my ass. Haskell is just as flawed as any other """functional""" language.
Wyatt Robinson
also this won't work because the iterators passed to sort need to be non-const
Jaxon Brooks
You have seen the light.
You're baby is now read for OCaml.
Luke Lewis
Pasta
Austin Taylor
> Posting #1488 meme image Poltard, who told you to get outside your containment board? Go back, we don't want or need you here. Reported for racism.
Connor Garcia
>body*
Joseph Morales
what is the point of having a language for functions only?
Adrian Sullivan
Sorry, retard time here, why are/would you putting pointers to another class in your class?
Austin Taylor
see you next thread
Brody Wood
No one cares about your /pol memes, alt right stormtard.
Jonathan Wood
then how can apply the infinite monkey theorem here.
more or less is not something I can proove something with
Asher Baker
...
Benjamin Peterson
The answer is yes, if you run any proper random number generator long enough it will eventually produce all numbers within the range.
>*iter->parameterofobject Nope, operator precedence fucks it up, you virtually always want to wrap *iter in braces just to be safe, also >Iter++ This is autistic, but with C++ that'll create unnecessary copies of iter to do the operation, whereas ++iter won't.
Robert Gonzalez
how do I design a function that searches for a particular parameter in an object?
the input is "number" and the function returns the first, lets say, car, where number = carnumber
Wyatt Adams
It's literally against the global rules to post your pol meme images here, newfag poltard.
Jacob Wilson
O(n!) solution in Hasklel
import Control.Monad.Logic
bogosort l = once $ do p = insert x
insert e [] = pure [e] insert e l@(x:xs) = pure (e:l) `mplus` (((:) x) insert e xs)
MLton > OCaml
Nicholas Nguyen
'tism
Adam Perry
thisdesu
Logan Gray
That's bad how?
Ethan Kelly
...
Ryder Harris
Hey /dpt/ trying to work in C++, already know a bit of C and Java.
I've noticed that I can use classes in C++ for polymorphism etc, what are the differences between using classes and using structs?
Also, I'm used to having structures with headers and the functions on a normal cpp file associated, like car.c includes car.h, with classes, do I need to do this or just write the functions in the header file?
Hudson Clark
I don't get the meme, is it because there's spanish on the box and a lot of latinos are criminals?
Jose Flores
What is the point of having a language for objects only?
Parker Clark
>MLton > OCaml explain
Julian Lewis
samefag
Colton Cruz
none
Ryder Ramirez
Name a programming language that ONLY has functions.
Andrew Walker
'tism
Eli Ramirez
C
Carson Hughes
No
True randomness is idealistic, like a perfect circle.
Brandon Thompson
>((:)x) (x:)
>if sorted p then pure p else mzero monad comprehension: [ p | sorted p ]
Jason Perez
Don't try to play dumb stormtard, that is a reference to the Nazi 1488 meme. 14 is the number of words in a white supremacist mantra, and 88 is code for HH (Heil Hitler).
Angel Lee
>True randomness is idealistic, like a perfect circle. no it's not. Just listen for quantum properties. Easy as shit.
Logan Baker
epin :DDDDDD
Noah Bennett
post the most pointless function you can think of
void function() {}
Juan Lopez
main(){for(;;)main();}
Hudson James
Those get used all the time. Someones you need to pass a function to another function, but you can't always want that function you are passing to do anything. So empty functions are useful.
Adam Cooper
A struct is a class, in c++. The only real difference is struct memebers are public by default. Any other difference is semantic.
Evan Sanders
safePerformIO :: IO a -> IO a
Jaxson Collins
they still depends on the state of the universe.
something truly random depicted in pseudo code would be
state = get_current_universe_state() // the state of all things assert( random(sate) != random(state) )
you are confusing randomness with impracticability.
Jaxon Sanchez
Or else what?
Julian Phillips
Because the classes need to communicate to one another. In some cases, pointers are the only way to avoid circular dependencies.
Hudson Flores
The identity function is the only function that can be typed as (X : Type) -> X -> X so it is not useless. It functions as the sole value of the Church-encoded unit type.
Nathaniel Miller
[](){}
Oliver Lewis
>they still depends on the state of the universe. No it doesn't. That's not how quantum properties work. They are truly random and unpredictable.
>get_current_universe_state() One of the fundamental concepts of quantum mechanics if that you can't measure the state of the universe without affecting it.
float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F;
x2 = number * 0.5F; y = number; i = * ( long * ) &y; // evil floating point bit level hacking i = 0x5f3759df - ( i >> 1 ); // what the fuck? y = * ( float * ) &i; y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y; }
i think i fucked up
Asher Watson
No I'm not. Quantum properties are predictable with regards to what possible values they will have and how likely each one of those properties is, but which one actually gets observed is completely random.
Zachary Morgan
Nice OS.
Angel Brooks
First of all, use string.format instead of .. (it's faster for concentration because .. makes extra copies of the string). Second, just pass the download function as a key callback, no need to wrap it in an anonymous function that calls download, so like this:
Other than that, you've not pasted the entire code, you're not doing anything with generate_filenames() and you've not posted any errors so I cannot help any further.
Xavier Hernandez
Do you want to search every object of "car" for the matching number? Jam all the objects into an array/vector, then iterate through the container comparing number to Car.getNumber() (ie) then if true call Car.getName() or whatever you're looking for. If C++ use std::array or std::vector and learn about iterators and auto.
Nolan Campbell
Which one is the best practice then?
Gavin Lewis
Does anyone else get spurs of motivation, like once every month or two I'll spend an entire night programming then not touch code for months, but this time it feels different - I've been doing nothing but programming in my free time for a week is this finally going to be it boys am I going to be a programmer?
did you honestly think that you could only have one if statement? what kind of language only allows one if statement?
Jonathan Rodriguez
Thanks for replying. I'm getting this [download] Lua error: ~/download.lua 27: expected near 'end' The code is a cut and paste from the mpv lua scripting guide.
Robert Hill
sorted xs = zipWith (
Matthew Sanchez
...
Jose Perry
anyone a clue what this could mean?
error: could not convert 'cardn.__gnu_cxx::__normal_iterator::operator*()' from 'Card' to 'Ally'|
card is a parent, ally an child class
Jack Adams
Yeah it seems like you've not copied the entire snippet because the upper part of the code is missing the function name and variable declaration (and possibly some logic).
Evan Hill
first time programming and on codecademy it would always make me use if, elif then else never made me use two ifs
James Cox
It's not Japanese, though.
Jack Fisher
It's in japan or Taiwan presumably.
Jonathan Anderson
I've went through it again, and everything seems right. As I've copied everything. I know it's a hackjob but I most be missing something crucial.
Jaxson White
no
Juan Clark
Why are jews so rude?
Michael Morales
are you talking about nested if statements or does it actually limit you to a single if statement for the whole program? If so then wow, I'm sorry you had to put up with that
Caleb Allen
nevermind, found it out
always trust the compiler
Cooper Reed
did you mean and . (drop 1 >>= zipWith (>=)) ?
Ryan Myers
If it has methods, it's a class.
Landon Turner
Already stuck on my first python project lads 4 def a1() 5 choice1=("Pick red or blue") 6 if choice1 == ("red") 7 print("red") 8 a1()
Error message if choice1 == ("red") ^
SyntaxError: invalid syntax
Parker Cook
I use struct when I have something POD and class otherwise.
I disagree.
Joseph Rodriguez
It just means you'll crash harder.
Levi Watson
dubs confirm
Lincoln Kelly
You're comparing two tuples rather than the strings. You're not reading the user choice. You're missing a colon.
Brayden Foster
replace 6 if choice1 == ("red")
with 6 if choice1 in ("red"):
Anthony Hughes
thanks, working fine now
Nolan Roberts
what's the most meme template engine out there i think it might be this
i have also been coding for five days in my free time
but i still have such a fucking lot to learn before i even get considered for an internship ;___;
Michael Sanders
Pug is pretty nice, but I haven't tried any other template engines as I'm not big on web dev. Why is it meme and what other template engines would you recommend instead?
Bentley Ross
memes aren't necessarily bad
Michael Hall
>A language must be good enough for everything
What the actual fuck Stroustrup. Are you insane?
Jace Bell
The absolute madman.
Jose Howard
If a language is only the best at one or two things (but bad at everything else), isn't it more of a DSL than a "real" programming language anyway?
Brandon Perry
That's what it means to be a general purpose language.
Robert Ramirez
>file.png please use descriptive variable names
Parker Wright
That would be true, but that's not how most language are developed. Most languages identify some things that should be their selling point and really solves a problem and the defines a language around those selling point and then put reasonable limits around what can be done in the language so it doesn't lose focus.
C++'s objective is different. It goes and identifies problems that C++ can kinda do but not too well, and then schemes up some pretty well designed but bloated feature to solve the problem. Which is why the language has a ton of ways to solve one problem and why it is so big.
General purpose doesn't mean to do everything under the sun that's possible.
I'm not going to save something I just printscreened.
Jaxson Phillips
reminder that pure functional programming is the only true multi-paradigm
Chase Morales
new thread when ? :3
Luke Cruz
Purity can be accomplished without being overly functional.
Wyatt Robinson
this is the last one
Austin Parker
purity isn't enough
Zachary Davis
I mean I agree that using higher order functions is good but it's not exactly multi-paradigm.
Zachary King
you can easily embed other paradigms into FP, but not vice versa compare "multi-paradigm" FP with FP FP
Matthew Garcia
Okay, I see what you mean.
Nolan Ortiz
>you can easily embed other paradigms into FP, but not vice versa You can embed FP into procedural somewhat easily, and by extension you can embed anything that you can embed into FP, into procedural.
Evan Sanchez
>You can embed FP into procedural somewhat easily No you can't.
Juan Cruz
Pure procedural means no lambdas, which means you're fucked.
Oliver James
pure functional isn't multiparadigm by definition
Hudson Russell
You can embed other paradigms in pure functional code
Zachary Robinson
>Pure procedural means no lambdas Okay fair enough, but "pure procedural" is just a term you made up right now.
Gavin Moore
No you can't.
Jeremiah Jones
I mean purely procedural. Not necessarily procedural with no observable side effects.
Jason Ortiz
Yes you can.
Josiah Ward
Playing about with Godot and it's funky Python dialect. Haven't had this much fun coding in a while.
Austin Wilson
I guess it's just a matter of definition, but I don't see why it wouldn't include lambdas or at the very least function pointers.
Ryder Reyes
>As opposed to function pointers or a dispatch table? Yes. > But user, virtual functions ARE implemented using dispatch tables. The shittiest possible way to implement them. They take up valuable space in the first cache line of objects. They are invisible to you so you can't actually achieve true dynamic dispatch by hotswapping different sets of functions. They incur double indirection because you need to deref the object itself, then indirect into the array of function pointers.
Manually implementing your own dynamic dispatch is much more flexible, reusable, ultimately cleaner AND more efficient because you can control memory layout better and do clever things like sort the function pointers to maximize instruction cache usage.
Jaxon Powell
No you can't. If you add them it's no longer pure FP.
Christopher White
If it had lambdas, it would be functional. There's a lot of overlap between procedural and functional, that being the main difference IMO.
Jordan Roberts
>if you add them then it's no longer pure FP the language is pure FP
Evan Hernandez
Pure FP means you don't have object oriented shit and don't have mutation, which non functional paradigms tend to rely on.
Ryder James
Objects work best without unbridled mutation (strong updates), actually.
Michael Cox
State monad
Thomas Reyes
I agree. But OOP means they need to contain mutating state. So pure FP bans that kind of shit.
Wtf. I've used C++ for years but I've never seen this syntax before. I'm guessing this tells the compiler how many bits to use, What's it called?
Brody Ward
Not really. Objects don't need mutation, not that purity means no mutation at all. Mutation is just an optimization where you use the same memory instead of making a copy somewhere else.
Owen Carter
bitfields
Nathan Jenkins
Bitfelds, but you should generally avoid them, compilers tend to generate horrible machine code for them. Better to mask and bit twiddle manually.
Hudson Ramirez
>Pure FP means you don't have object oriented wrong. thank you for sharing your ignorance with us.
Cooper Morales
>Objects don't need mutation They do in OOP. THat's the entire point of them actually. To contain mutable state and keep it encapsulated.
Jason Johnson
You could program in an OOP style, or embed a DSL, and just because you can run state purely doesn't mean you have to.
>and just because you can run state purely doesn't mean you have to. We're only talking about "pure" fp, so obviously everything needs to be done purely.
Benjamin Watson
Maintaining invariants through encapsulation is one thing they're good at but it's not the only thing. And, again, you can have mutation and have it still be pure. So if you have e.g. Rust where the type system is good at verifying mutation but can't verify other properties you still want to make use of encapsulation. But it's still pure.
Chase Evans
Pure FP means all the expressions are pure, you can still have values representing impure computations thanks to the first class nature of monads
Bentley Foster
>if(index == 100) > { > break; > } > index++;
If only there was an easier way to do this.
Easton Butler
Linear types are better at making side effects non-observable.
Hunter Peterson
>you can have mutation and have it still be pure. wrong.
>Rust where the type system is good at verifying mutation but can't verify other properties you still want to make use of encapsulation. But it's still pure. Rust is absolutely not pure. Just about any remotely FP language can be considered "pure" is rust is pure.
Zachary Price
Linear types do not achieve what monads do, stop bringing them up and shilling them at every opportunity
Kevin Hall
Linear types have nothing to do with effects, and even if you tweak the semantics so that they do, they still aren't as powerful as monads.
Angel Rogers
if(++index == 101) {break;}
something like this annon?
Alexander Fisher
while (index < 100) { ... index++; }
or
for (index = 0; index < 100; index++)
David Anderson
Purity isn't the complete absence of effects. Otherwise, nothing useful could ever be pure. It's about controlling effects to ensure that they're either not observable or expressed in the type system. Rust does a good job of this.
Even Haskell isn't that pure since you have partiality and non-termination everywhere.
Calm your tits, I never said they were good at everything monads do.
Anthony Hall
>Purity isn't the complete absence of effects. yes it is but it's idealistic. the best we can do is to separate the pure from the impure which is what haskell is about.
>It's about controlling effects to ensure that they're either not observable or expressed in the type system. Sure, with OOP and mutation require happening. Sure you can find FP ways of achieving what these concepts seek to achieve, but that doesn't mean you are doing OOP and mutation.
Hunter Mitchell
I want to make a bash script that does the following >makes a .txt file with a random letter >waits 1 hour >deletes old .txt file >makes a new .txt file with a random letter >repeat any help is appreciated
Nicholas Scott
rust is a meme
Eli Cox
>351 We need a new thread now !
Evan Bell
that's incredibly simple. I don't know much about bash scripting, but I'm sure you can find the few commands you need here tldp.org/LDP/abs/html/
Jayden Taylor
>Exactly I don't think you get my point. I'm saying that you can be pure for all the reasons that purity is good without having to give up usefulness.
Think about what a pure function is. Same input means same output, every time, yeah? Haskell gets around this by (at least conceptually) reifying computation in a monad and using laziness to "interpret" the reified computation at runtime. Linear types facilitate this by allowing you to simply say you can't ever call this function on that input again. In both of these frameworks, you can perform useful effects without disrupting the "pure invariant".
>Sure you can find FP ways of achieving what these concepts seek to achieve, but that doesn't mean you are doing OOP and mutation. OOP has fuck all to do with mutation. It's encapsulation that's important.
Christopher Gray
This should be incredibly easy to figure out
Adrian Bailey
here you have it
Oliver Russell
is it okay if I start my curly brace on a new line instead of at the end of a line
Jace Fisher
hey to be an asshole but i just wanted to get some input on these courses i am planning on starting on 1 this winter witch one would you pick and why?
Nolan King
1-5 and 7
Brody Gutierrez
Can't have Let's Encrypt on LAN server, so figuring out alternatives. Not going to use a self-signed certificates either.
Might go with public+private keys for encryption coupled with one-time challenge to prevent replication attacks on login only. The problem is session cookie is still up for grabs. Might need to link the session cookie to IP, but then changing IPs becomes a hassle.
Zachary Moore
Looks like all shit but I guess one of the last three
No one cares about CompTIA
Luke Nguyen
can i get a decent job doing it?
Henry Collins
Ayylmao
Ryan Lee
HtDP, then if your good at math work through SICP.
John Perry
I don't always dream about programming, but when I do, it's functional.