Old Thread: What the heck are you working on, Sup Forums?
How'd your finals go, if you had any?
/dpt/ - Daily Propgramming Thread
dead
you're working on the dead?
anyone having problems with Sup Forums x?
You tell me
Kill(target)
or
Suicide() ?
yep same here. not sure whats worse: no css or vanila Sup Forums
Listen faggots
Add this userscript to greasemonkey or whatever shit you use and it will make Sup Forums work, even if the weird domains are blocked
gist.github.com
Works with Tampermonkey.
Opinions on Coderbyte? Looking for programming challenges that are stimulating a la Euler but without the mathematical focus.
how many years until I become a decent programmer?
go away with bullshit I want to hear numbers
that's the stupidest question a million people already asked
coincidentally, it does not have a numerical answer
>how many years until I become a decent programmer?
>go away with bullshit
If you really want the blunt truth: ∞
>coincidentally, it does not have a numerical answer
Well, there's no answer in the general case, but in his special case there is one: he will never become a good programmer because he's self-evidently dumb.
Why am I so superior, /dpt/?
> IQ as a measure of intelligence
> i mean skill
small-brain.jaypeg
This is only works on Firefox. Chromefags need to add ||Sup Forums.org^*$csp=script-src 'unsafe-eval' to uBlock Origin instead.
>Pluralsight is a privately held online education company that offers a variety of video training courses for software developers
hmmmmmmmmmmmmmmmmmm really makes me think
>sepples
you poor bastard
You need to be subscribed to do the test, so there's no point in giving you an inflated score. It's used to give you a personal recommendation about which C++ course should you do: the basic, intermediate or advanced one. My employer pays for my subscription :^)
good for you then
>his sepples IQ is 233
That's kinda like having an IQ of 233 where 100 is the average for a tribe of malnourished inbred sub-Saharan Africans.
>tfw /dpt/ is jelly at my superior C++ IQ
forgot my pic
>my superior C++ IQ
>my
>superior
>C++
>IQ
>C++
>IQ
This is a thing that someone actually said on Sup Forums...
not really, jealoussy is for retards
So you're not actually a C++ expert or a genius, you have enough intermediate experience to qualify for the advanced course. Congrats, I guess?
Sup Forums meme-IQ testing when?
Roll for it.
Not to mention that you're at the low end of that part of the spectrum, lmao.
I am definitely not rolling for my /dpt/ IQ in this post. This is not Sup Forums, after all.
Probably the only spectrum hes at the low part of
>at
10 000 hours
how do i get better at writing c without using dynamic memory management? does anybody have any good resources?
Thanks to user I managed to improve my word-order swapping function to this:
FUNCTION SwapWordOrder2 : DWORD
VAR
dwTemp : DWORD;
END_VAR
VAR_INPUT
dwValue_in : DWORD;
END_VAR
dwTemp := dwValue_in;
dwTemp := SHR((dwTemp AND 16#FF000000), 16) OR
SHR((dwTemp AND 16#00FF0000), 16) OR
SHL((dwTemp AND 16#0000FF00), 16) OR
SHL((dwTemp AND 16#000000FF), 16);
SwapWordOrder2 := dwTemp;
END_FUNCTION
This programming environment is Beremiz. It can be used for PLC automation programming. I am using it just for testing this kind of small stuff.
>without dynamic memory management
why
You just read about pools and arenas, I guess?
Considered harmful.
but it is necessary at times ...
It's slow and error-prone. It can be avoided almost entirely in many cases.
>post a C++ test result
>half of /dpt/ get mad and jealous as fuck
ahahahahaahahahhaha. how can be someone be some insecure and pathetic? Maybe it's because you're NEETs playing with meme languages and doing fizzbuzz-sized projects. Enjoy ;)
no (You) for you
if someone feels the need to brag about test results that's called insecurity, not the other way around ¯_(ツ)_/¯
>makes autistic posts
>predictably, no one is impressed
>gets mocked
>u-u-u guise j-jelly
last few months before I start mass-applying to jobs. what's more important to focus on - algorithms and algorithm design skills?
or
personal projects, tools, frameworks, language concepts, etc...
I'm torn, because for example I could spend a few weeks working my way through CTCI again, implementing algorithms and such, or I could learn the Spring framework and work on a few projects I have going on right now. I do not have time for both. (or at least I would rather focus on one, instead of half-assing both)
what program is your pic related?
I did well on finals. Apparently I did unusually well on my Computer Architecture final. I got a perfect and my professor said no one has gotten a perfect in a really long time.
Also working through SICP. Just skipped the exercises on writing programs with specific complexity, I'm too lazy for that stuff
looks like clion
congratulations anonymous friend
Thanks!
>What the heck are you working on, Sup Forums?
Exploring the deepest, darkest corners of Racket. Advent of Code 2017.
As mentioned in my original post, it is Beremiz. beremiz.org
Free as in freedom PLC programming environment. I sometimes use it for fun.
you again
Which one is the better method to generate a 2D matrix:
>Make an array of pointer for the y axis, and each pointer in the array point to another array for the x axis
>Make a (x*y) sized array and store the whole matrix in linear.
int array[x][y]; on the stack or int (*array)[y] = malloc(x * sizeof *array); on the heap
You definitely don't want separate allocations for each row/column, so use a single array.
4 years
I need some help with a project
I need to extract the peak volume levels of a sound file for every step in a set interval and get them in a text file
Example:
>0.1;0.2;0.5;0.8
The peaks are between e.g. 0 and 1, with 1 being 0dB, so maximum loudness and 0 being no quiet
Interval could be e.g. 250ms, so 0.1 is at 0ms, 0.2 is at 250ms and so on
Since this is only a small part of a project I'm doing in Lua I'm thinking of writing it in C and exposing it for my Lua application.
Any recommendations on C audio libraries that would help me do this?
Or do you know of any software that is capable of doing this?
In seppels if I want to do this:
struct foo : public bar
{
int a;
int b;
}
int main()
{
foo x, y;
x = x + y;
}
I need to overload only the + operator or also the = operator for the foo class?
My intuition said that I need to overload only the + operator, since the copy constructor will be called when doing the = operator,
but if the + operator will return a bar class, did I need to overload the = operator for the bar class?
The operator = is already defined by calling the = operator of each field. So you don't need to define it. But you have to define +.
But do I need to overload the = operator if the + operator return a bar class?
struct foo : public bar
{
int a;
int b;
bar operator+(foo& a, foo&b);
}
int main()
{
foo x, y;
x = x + y;
}
Sorry if my question is a bit brainlet grade. Inheritance is so confusing and taxing on my brain.
In C++2017, operator overloads you.
that works, but it's different if you wanted to do those operations on bar.
Polymorphism in C++ is dodgy.
Sorry, I can't help you. You're beyond salvation. No just joking, going to bed.
whatever you're doing, you're probably doing it wrong. Inheritance in C++ is broken.
Is it normal that my high school Java "computer science" class has taught us if statements and methods and while statements but we still haven't even touched arrays
yeah
if they start doing object stuff before then, you can get scared
Is it necessary to free malloc'ed stuff on error? I mean, the OS should remove the entire process image from the memory when the program exits.
If you are going to exit, don't bother freeing unless you want to be valgrind clean.
It's not necessary, but like said you should still free everything at least in debug builds so that you can be sure you don't have an unexpected leak.
How do I have a leak if all program segments are removed from the os?
You don't, but if the definition of a memory leak was just memory left around after program exit it obviously wouldn't be a very useful term. I'm talking about memory leaks that build up over time because you're allocating and not freeing something within a loop or something. If you free what you think you need to free at program exit and there's something left over, it's might be indicative of that kind of leak.
Alright thanks. Got any cool exercises for newbies that I can do?
Why would you do that to yourself, user?
Or allocating and not freeing during initialization or something. Not as bad, but you're still wasting memory throughout the whole run of the program.
fizzbuzz
lol
Finals went decently well. Can't brag about my grades but did average.
Now that I have time I want to throw some personal projects on my resume. However if I crashed and burned on it and can't get it working should I still put it on my resume? I really don't want to apply to places with just school projects on there.
Can I say "Currently implementing X on X to do X" on there?
Recursion or iteration?
Whichever is appropriate for describing the problem at hand.
iteration. Recursion requires function call on every iteration.
>slow as gay mother of balls
>no static typing
>dynamic typing can optionally be made manifest but instead of types you use "contracts" which literally do FUCKING RUNTIME CHECKS on the types of values and handle discrepancies by THROWING EXCEPTIONS
>they actually bothered to have the contracts constitute a fairly expressive algebraic type system -- as if it even fucking matters at that point?!?
>there are libraries called "teachpacks"
>their names start with htdp or 2htdp -- "how to design programs"
>the language has an official implementation and ide -- because no one else bothered making any notable effort to implement it
>the ""official"" """""ide""""" literally has fucking beginner and intermediate modes that DELIBERATELY LACK FIRST CLASS FUNCTIONS so that brainlets don't have to hurt their little heads
>the only meaningful application of this language is in private prep schools in california
>THERE IS A DEFAULT LIBRARY FOR GAME / SIMULATION DEV
>AND IT'S FUCKING GARBAGE
...
>Exploring the deepest, darkest corners of a shit.
ftfy
>using a shitlang without tail call optimization
>>the language has an official implementation and ide -- because no one else bothered making any notable effort to implement it
You can't really implement racket because it's constantly updating and not standardized.
>trusting the compiler jew
so why would you make any software in it
They're equivalent. Any recursive algorithm can be implemented with iteration and an explicit stack if it's not tail recursive. Any iteration can be implemented with tail recursion with no difference in compiled code if you're using a decent language.
begin cnile
>You can't really implement racket because it's constantly updating and not standardized.
>so why would you make any software in it
It provides platform, most things have only one used implementation like nodejs.
*recursion or goto
goto, djisktra can go fuck himself.
you don't even need an explicit stack, any recursive algorithm can be implemented with the following data structure or its equivalent in whatever iterative language
struct variadic_tree {
struct variadic_tree *parent, **children;
int breadth, color;
void *data;
};
where:
>data is anything you need to put there
>parent is a reference to the branch one step back
>children is a vector of all branches that are one step forward from the current one
>breadth is the length of said vector
>color is either white or black; the meaning is specific to the current traversal and depends whether the root node was white or black when that traversal began
the stack functionality is provided by the fact that the tree is doubly linked, and the set functionality (which you didn't mention, but is also necessary) is provided by storing the visited/unvisited status in the branches themselves
no need for any actual auxiliary data structures other than the tree used to represent the recursion state itself
That's horrifying.
I think I like it.
>no static typing
en.wikipedia.org
parallelise this
god no i don't even know how to parallelise a hello world
what even is multiple processors is it some kind of newly discovered neurodegenerative disease
>mfw
>got a B in the class despite having 0 on multiple assignments
what should I learn now having just finished 2 intro java programming classes? I mostly want to do programming as a side pursuit
>I mostly want to do programming as a side pursuit
probably python
it's not a very elegant language but it's easy to understand and has a lot of libraries
therefore it's ideal for someone who isn't actually very interested in computer science and just wants to get his computer to do things he needs it to do
pick a non poo-lang to learn.