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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 321
Thread images: 36

File: haskell-logo-with-name.jpg (17KB, 800x400px) Image search: [Google]
haskell-logo-with-name.jpg
17KB, 800x400px
What are you working on, /g/?

Previous thread: >>61623104
>>
>>61628058
>What are you working on, /g/?
I was working on
Trigger warning:
A game engine that used C for rendering and performance related operations, with Go as a glorified scripting language(game logic etc) but I gave up.
>>
Re-writing Haskell in Scala.
>>
>>61628095
>Go as a glorified scripting language
Why?
>>
>>61628095
>scripting in go
Why? Wouldn't you use something that easily facilitates hot swapping code?
I'm not saying you couldn't with Go. I've done it with C. But it seems weird to opt for Go like this.
>>
File: advanced-collision-detection.webm (993KB, 800x608px) Image search: [Google]
advanced-collision-detection.webm
993KB, 800x608px
>>61628095
>giving up
Shame

t. scheme + c minecraft anon
>>
>>61628117
https://github.com/scalaz/scalaz
https://github.com/typelevel/cats/
>>
>>61628136
>Why?
Because the syntax is almost like C, but with a richer standard library.
And the Go language is well defined by the language reference, not some sort of less than unholy abomination that is C#(for Unity(i.e. non-standard)) or GMScript(Whatever the fuck that is)
>>
>>61628040
>Why are you making an ""optimization"" that uses std::array? Fuck me anon just use a C array. You don't modify a lookup table.
I don't want to make this complicated, I swear, I'm just struggling to determine how I can achieve what I want.
constexpr MyClass arr[] =  { /* ... */ };

What am I supposed to write here? Can I do a macro that will enumerate
 { makeObj(0), makeObj(1), makeObj(2), ... ,makeObj(512) };
>>
>>61628095

> Not Lua

wtf
>>
>>61628179
>arrays start at 1

wtf
>>
>>61628155
You've posted that webm for the last few days. I don't think you're actually making progress. Perhaps >>>/vg/agdg would be a better place for you.
>>
>>61628179
Unknown Worlds did this for the Spark engine(Natural Selection 2) and it ran like garbage, also Lua does indexes starting at 1, not 0, which is just wrong.
>>
>>61628195
>>61628220
But the natural numbers start at 1.
>>
>>61628196
I'm working on things that don't make good webms (multithreading) anon. I've been posting a lot of my code too.

Perhaps you should fuck off if you don't think code is /dpt/ related.
>>
>>61628231
Array indexes are ptrdiff_t, not natural numbers.
>>
>>61628276
maybe in your shitlang they are
>>
>>61628257
Sorry anon, it was just a joke meant at the expense of /agdg/.
>>
>tfw it makes more sense for arrays to be 1:1 to their length but were so used to [1] = 0 that the right way just feels wrong
>>
>>61628231
Tell that to Peano.
>>
>>61628388
delete this herecy or be cursed to forever write in shitlangs
>>
>>61628419
who the fuck?
is that your pajeet friend or something?
>>
>>61628438
Ive already found the light, shitlangs cannot reach me now.
>>
>>61628155
>Shame
>t. scheme + c minecraft anon
Serious question, what did you do in C and what did you do in Scheme?
Where did the C implementations end, like, did you specify the "model" in C, or did you let scheme pass the vertex coordinates to C.

tl;dr:
I struggle to figure out where to stop with C, and let the other language take over.
Should I parse a model with shaders in "whatever language" and pass the values of importance to a C api, or should I just pass the path to the model and or shader and let C handle it?
>>
>>61628178
I usually just generate the syntax for that stuff with another tool. You don't have to write your C++ in C++. The advantage of arrays is you can just do
= { {0, true, 0.5}, {1, true, 0.5}, ...
which is pretty easy to do in an external tool. That external tool can even be a C++ program that generates the source code you want.

Didn't you say your object has no constexpr constructors? So makeObj seems like it would have problems.

I think unless startup time is important you should just do

MyClass arr[len];

void main() {
generate_lookuptable();
....
}


>>61628292
Ah no problem.
>>
>>61628446
I know it's bait but I'm falling for it anyway
https://en.wikipedia.org/wiki/Peano_axioms
>>
>>61628471
Seconding the question
What do scripting engines usually control in games?
>>
FPGA programming using Verilog, never has my mind been fucked this much
>>
>>61628497
I assume more construction type stuff. Place this actor here, add this event here. Et.c.
>>
>>61628479
i reject these axioms as applying to the natural numbers but concede that they do apply to the whole numbers
>>
Anyone here with JS/userscript development experience? I'm thinking of filtering spam in twitch chat. As a challenge. I feel it'd be a good thing to do to learn JS and some light frontend webdev.

What resources would I need and how feasible is this? Ideally I'd make it generic.
>>
>>61628562
You can filter span in Twitch chat by not watching Twitch
>>
>>61628585
no you can't
>>
>>61628585
Yeah but I'm interested in what a cleaned up chat would look like mainly.
>>
>>61628546
But then N is not a monoid under addition, only under multiplication. How do you define multiplication without addition?
>>
>>61628474
That's sad, I was hoping i could do it entirely within C++.
For the record my object does have constexpr constructors, it's simply the zero-arg constructor that can't be constexpr (because it doesn't initialize its data members). But I think ultimately it'd be simpler if I just used a basic integral type instead.
>>
>>61628562
Isn't twitch chat a glorified irc? You could look up irc bot python dev
>>
>>61628562
Twitch chats are just IRC channels
>>
I used a closed source language today
But I finished the relevant part so I shouldn't have to touch it again
I hope RMS wasn't watching
>>
>>61628648
>>61628657
Yeah I know it is. I could filter it like that if I wanted. But I wanted to learn JS and some webdev. All I know is C, C#, Python, Java, Lua, and Basic. And some C++, I'm the C with templates kind.

I've written an IRC client in Python, it's not new to me. I want to look into how I'd develop a solution that works in browsers. It's not just a filter.
>>
>>61628721
>I'm the C with templates kind.
No you're fucking not. Filthy sepples scum trying to gain the prestige of being a C programmer.
>>
>tfw the only reason your software is proprietary is because you're nervous that some 1337 freetards will laugh at your code if it's open source
>>
>>61628471
>>61628497
They usually control black boxes about the game. The interface does things like
>load a model from "halfblock.mdl"
>make a kind of block that's a liquid-class block with sprites x y z a b c that uses model fullblock
>create the world as a finiteworld with this list of blocks
>change the block at x y z to water with state s

Here's the full interface if you're curious:
init
cleanup
clear_screen
set_finiteworld
draw_world
set_cursor
draw_cursor
make_basicblock
make_ultrabasicblock
load_model
make_air
make_void
unload_block
getneighbor_coords
finite_draw_cursor
load_image
menu_make
menu_render
menu_alter
unload_finite
make_finiteworld
finite_getblock
finite_getstate
finite_getneighborstate
finite_getneighbor
finite_getdiorama
finite_getdiorama_n
draw_compiled_finite
finite_alter
finite_render_depth
read_block_data
xoroshiro_randomize
xoroshiro_random_flonum
TOP
BOT
EAST
WEST
NORTH
SOUTH
opposite_side
SOLID
TRANSLUCENT
SEETHROUGH
WATER
update_screen
client_framesleep
finite_mouse_pick
finite_mouse_pick_side
target_framesleep
program_running
debug
mouse_x
mouse_y
mouse_x_rel
mouse_y_rel
mouse_pressed
mouse_down
mouse_released
mouse2_pressed
mouse2_down
mouse2_released
letter_pressed
letter_down
letter_released
give_player_coordinates
isatty
key_pressed
key_down
key_released
set_relativemouse
mouse_relative
poll_events

Example usage:
(define glass
(make_ultrabasicblock fullblock_model SEETHROUGH blocksheet #t 1 3))
(define water
(make_ultrabasicblock fullblock_model WATER blocksheet #t 6 2))
...
(define (water-place! kind world state x y z)
(finite_alter world kind (water-filltop kind world state x y z 0 0 0) x y z)
(defer! 12 x y z)
'success)
(define water-class (make-block-class
water
update/now!: water-update/now!
update!: water-update!
place!: water-place!))
>>
>>61628735
>Filthy sepples scum trying to gain the prestige of being a C programmer.
There's no pride in language choice. Nobody should prefer C. You're forced to work with it. Much like I'm forced to work with C++.
Templates is my interface to other programmers. It's very difficult enough to get them to not use stupid bullshit in their user facing code. I'd never convince them to not use templates at all.
>>
>>61628786
Thanks, I've always been wondering where the line ends with game engines that "does all the performance related stuff in c and or c++".
>>
>>61628786
I've been messing with Common Lisp, it's pretty fun.
It's quite nice to be able to a window then be able to mess around with opengl using a REPL.
>>
>>61628388
the number in an array is an offset, it makes more sense for arrays to start at 0
>>
>>61628862
The way most people think of and use arrays, it does not.
>>
>>61628831
That line ends depending on what you are doing. In love2d the ratio of c to script is much lower, in WoW the ratio is much higher since only the UI and the spell casting interface is exposed.
>>
>>61628888
it makes sense if you are using a list but not an array
perhaps most people use languages with lists instead of arrays
>>
File: ty btw.png (638KB, 4760x4986px) Image search: [Google]
ty btw.png
638KB, 4760x4986px
>>61628058
What exactly is the preresiquite knowledge I should have in programming before I can start to dive into more specific stuff. For example, some of the things i think are cool and want to understand:
>how computers work
>Machine Learning/AI/Neural networks
>Audio programming
>Pen-testing/writing malware
>how networks work
I've been learning for maybe 6 months now, but I feel like i'm floating without any direction. With no curriculum, I never know what to move on to next. Seems everything else requires some prerequisite knowledge to understand, and I can't find a good starting point. Would it be foolish to start with Assembly/C and work my way back up to high level languages?

Does this seem like a good resource?
>https://github.com/jwasham/coding-interview-university
>>
>>61628926
It only makes sense if you're used to treating them interchangeably with pointers and using pointer arthimetic. Most people use languages where the actual array is hidden under some other container type or language construct which abstracts all the memory related details. Starting at zero isn't meaningful to most people.
>>
>>61628978
Not at all. Your first question is usually addressed a good degree in any decent assembly book.
>>
fuck this i will just get into robotics and AI just so I can make my robot waifu and fuck her everyday
>>
Programing 110 student with a Professor and TA who don't answer phone calls or emails here.

TL;DR This weeks assignment was to write a walking man program and display it graphically using python. Pic related, my finished product.

Here's the problem. I used Pygame. There is no Pygame module, it has to be installed. The TA is never going to install it because that would mean having to do work. Is there another module for python that will graphically display stuff other then GUI elements?
>>
>>61629316
>>>/wsr/
>>
File: you just know.png (511KB, 786x401px) Image search: [Google]
you just know.png
511KB, 786x401px
>>61629241
already been done.
https://www.youtube.com/watch?v=oRlwvLubFxg

https://www.youtube.com/watch?v=jQ42we2gyPg
>>
File: 1497254408998.jpg (255KB, 954x663px) Image search: [Google]
1497254408998.jpg
255KB, 954x663px
>>61628058
Trying to unit test this code:

void parse_args(int argc, char **argv)
{
const char *argp_program_version = PACKAGE_VERSION;
const char *argp_program_bug_address = PACKAGE_BUGREPORT;
const char* doc = "Eternity";
char args_doc[] = "file1.jpg file2.png file3.bmp ...";

struct argp_option options[] = {
{"verbose",'v', 0, 0, "Produce verbose output", 0},
{"quiet", 'q', 0, 0, "Don't produce any output", 0},
{"silent", 's', 0, OPTION_ALIAS, NULL, 0},
{"output", 'o', "FILE", 0, "Output to FILE instead of std output", 0},
{0}
};

struct argp argp = {options, parse_opt, args_doc, doc, NULL, 0, NULL};
struct args args;
args.count = argc;
args.silent = args.verbose = 0;
args.output_file = "-";

argp_parse(&argp, argc, argv, 0, 0, &args);
}


Do I have to mock out all function calls and structs here?
How do I approach this while still getting 100% coverage?
>>
Writing a protocol on top of TCP akin to HTTP or Gopher in Erlang. I am this to be more secure and anonymous.
>>
>>61628748
No. It's because someone paid for it and want me to do non free software.
>>
I got this code(in C), I'm using to learn how to manipulate files and registers.

So assuming I have a book, with codes and names, and there can be several names with the same code.

When I want to read the names, I want to organize and list them by codes.

The thing is, that listing only works if I insert all the codes in order beforehand.

So my question is, is there a way I can rearrange them in an ascending order, into the code, so that even if I insert them in disorder, they are still listed the way it should be.


The struct database is not memorized in an array, they are saved directly into the file, and I make the program read them one by one.
>>
Im working on egpu's for thinkpads so i never have to buy another computer again. Working on hotplugging and Driver issues on linux
>>
>>61629316
That's a matter of distribution. You can simply distribute pygame with your app, or you could use pyInstaller. Though I am guessing the TA wants to be able to execute your code directly in python, in which case distributing pygame might be the best option. In the real world anybody who is dealing with source code and refuses to install the requisite development libraries is a joke, you are a developer not an end user.
If you were using C or C++ you could have the build system pull it in automatically as an external module but lol python.
This is why python is for hobbyists only, you can't realistically -deploy- python code in production.
>>
>>61629467

struct sNames{
int code;
char name[50];
}rNames;


int main(){

FILE* filex;
int cod;

filex = fopen("names.txt","r");
if(!filex)
{
printf("File doesn't exist");
}

fread(&rNames,sizeof(struct sNames),1,filex);

while(!feof(filex))
{
cod=rNames.code;
printf("\nCode %i\n",cod);
printf("\nCode \tName\n");
while((!feof(filex))&&(cod==rNames.code))
{
printf("%i \t%s \n", rNames.code,rNames.name);
fread(&rNames,sizeof(struct sNames),1,filex);
}

}
return 0;
}
>>
>>61629540
I hate python (dynamic typing) but you're wrong. Developers need a way to automatically install dependencies, otherwise your project is hell. In python, this is done with pip.
pip install requirements.txt
>>
>>61629587
>Developers need a way to automatically install dependencies, otherwise your project is hell
Just use your system's package manager.
Your system DOES have a package manager, right?
>>
>>61629316
See >>61629587. Make your program install pygame when the ta launches it.
>>
>>61629623
>globally installing packages
>installing dependencies manually
Enjoy dependency hell when two programs require incomparable versions! Enjoy figuring out exactly which dependency you're missing with obtuse error messages!
>>
>>61629634
>Make your program install pygame when the ta launches it.
I can do this, but is it proper form?
>>
>>61629687
If your TA is too lazy to install pygame, then make your TA install pygame.
>>
>>61629687
>but is it proper form?
Fuck it. It's improper form to not reply.
Have it take an optional flag that skips the installation check and add it to the commandline interface help.
If he complains you can say he should have read the help.
>>
>>61629687
No, thats not proper form. Give step by step instructions on how to install in the readme. Take a look at open source python packages. Work with your TA to find out what works with him.

The standard procedure
>create a sandbox with virtualenv
>enter the sandbox
>pip install ...
>python main.py
>leave virtualenv when done
>>
>>61629735
Anon he said the TA doesn't return calls or emails.
>>
>>61629759
Face to face communication is scary, I know. But you can do it anon.
>>
>>61629316
If you don't want to bring in external dependencies, you can try the curses library. Otherwise, make the TA install pygame.
>>
>>61629782
What? You mean anon should show up at his house unannounced?
That's how you get shot dude.
>>
>>61629816
Office hours are a thing.
>>
>>61629872
>Office hours
>TA
Not here. w/e. They should answer.
>>
>>61629316
ya dun goofed they probably told you in the class you didn't attend which libraries you were supposed to use. Ask another student.
>>
>>61629782
>>61629929
>>61629816
>>61629920
Class is online.
>>
>>61629423
How does it feel being a mental prostitute anon? Do you enjoy strangers' balls slapping on your chin?
>>
>>61628612
I don't.
There's no good reason why N should be a monoid under addition.
We have the whole numbers for that.
>>
someone has a picture of source code with the curly brackets and semicolons all the way at the right?
>>
>>61629984
>Class is online.
>prof & TA doesn't respond
What a fucking mess.
>>
>>61630007
You do realize you can take any piece of code and trivially edit 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 ;
i = 0x5f3759df - ( i >> 1 ) ;
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ) ;
return y ;
}
>>
>>61630095
the code it are pleae me
muy pythonc
>>
>>61630095
you missed one ;
>>
File: fisr.png (5KB, 349x194px) Image search: [Google]
fisr.png
5KB, 349x194px
>>61630143
Noticed.
>>
what's the point of using anonymous classes to pass implementations of interfaces when i can have my enveloping class implement the interface and pass the class instead? it's cleaner and nicer
>>
>>61630409
Better question: what's the point of OOP?
>>
>>61630456
I've looked far and wide for good answers to this.
>>
>>61630456
>>61630473
big projects
>>
What's a good beginner real programming language to teach a 12 year old?

C may be a little confusing to get the basic points across
>>
>>61630482
Alice
>>
>>61630512
I said REAL programming languages.
>>
>>61630521
nim or lua
>>
File: jf5vkp2b.png (8KB, 107x107px) Image search: [Google]
jf5vkp2b.png
8KB, 107x107px
>>61630482
x86 assembly
>>
>>61630482
How so? C is a very simple language, its' simplicity makes writing complex programs difficult but for learning the basics it's perfect.
>>
>>61630473
well there's your answer anon.

>>61630481
only slightly a mediocre api is basically all OOP could offer for a big project.
>>
>>61630482
Maybe try Python? It's a bit more readable.
>>
>>61630482
>What's a good beginner real programming language to teach a 12 year old?


Pascal/Delphi
>>
>>61630482
I had a class on (Q)Basic at around that age. It went fine. I learned python a short while later, and thought it was an easier language, so that's probably a better place to start these days.
>>
[https] is.gd [slash] ZBh7XO
why is my program in infinite loop (c++)?
>>
File: 38b.jpg (154KB, 1400x1000px) Image search: [Google]
38b.jpg
154KB, 1400x1000px
what keeps you /g/oing?
I feel depressed as fuck right now, I cant continue like this...
>>
>>61630521

>>61630512
I mean, I have never used it personally, but it is pretty good for the use of graphics. I'll see what happens.

>>61630548
Lua seems popular

>>61630567
One problem with C is that it dives into pointers and references, and that kind of takes time away.

>>61630563
I wish we were in the 70s Anon.

>>61630595
I guess, since it lacks braces (extra time typing them out)

>>61630618
Hmm, I guess Python might do the job then.

Due to python lacking braces and such, it would be faster to go through the basics I guess. I haven't personally used Python that much, but I guess it would be a good extra reading for me since I will probably look into graphics as well.

Thanks for the feedback, I'll see what I can do. I'll probably also report back how it goes.
>>
>>61630666
the tought that I'll be doing drugs soon keeps me excited enough
>>
>>61630666
Spite, mostly.
>>
>>61630666
Recently been driving for Uber and discovered they have APIs.

I want to make some money and I wanna drive less, so I guess, making something to help me out on the road.

But fuck, I think I have to wait for a confirmation before I even start making shit.
>>
>>61630674
>I wish we were in the 70s Anon.
Try 6502 then.
>>
File: 1501340986560.jpg (137KB, 403x403px) Image search: [Google]
1501340986560.jpg
137KB, 403x403px
>>61628058
Is there any documentation editor that would produce something as simple as this? could be also a markdown editor that has an automatic table of contents.

http://surjithctly.github.io/documentation-html-template/
>>
>>61630612
Both of these syntaxes are time consuming to keep it steady without them getting bored. But good languages.
>>
>>61630674
Romero was doing ASM for the government at 15, dont coddle the boy.
>>
>>61630482
my experience with C as my first language:
>installed Ubuntu successfully
>install Geany
>probably still better than using Bloodshed software on Windows like a Youtube video suggested
>robotics club full of lazy people
>could tell the club wasn't going to go anywhere
>definitely wasn't going to make anything worthwhile anytime soon if you need to write an entire program to print 34*62
>friend confused because he never learned C, just C++ and had to Google the appropriate syntax for include statements
>dropped C

my experience with Python:
>no annoying semicolons
>taught me how to indent
>did some brainteaser puzzles after learning functions and loops
>moved on to better languages
>>
>>61630481
It really doesn't help big projects beyond what other paradigms do.
>>
>>61630719
>>61630725
I guess after we do basic high level operations, might aswell start off with some NES stuff.

I personally don't know ASM that much, but I was learning it a bit a couple of months ago. I guess that would be good for both of us.

Thanks for the motivation.
>>
>>61630482
Lua maybe. It has very little datatype considerations. I feel that's something that trips people up early on.
And it's comparable in simplicity to C, which is very nice.
>>
>>61630774
ASM is very easy. It's a huge pain to write anything even medium sized in. But it's very easy.
Also the best education you can give someone is to teach them from fundamentals. Focus on what the machine actually does and you won't go wrong anon.
>>
File: qD7Jr[1].png (411KB, 504x676px) Image search: [Google]
qD7Jr[1].png
411KB, 504x676px
>>61630725
You mean the same John Romero who ruined his career by proclaiming that he was going to make you his bitch and hiring his useless girlfriend in a lead designer role, all the while renting expensive penthouse offices and promising to make the best game ever, even though he threw away over a year of progress after he's seen quake 2 because the realized that he ain't shit without Carmack's technology?

>>61630774
I would personally recommend IBM s/370, but I don't think you have a mainframe lying around. What ever architecture you chose, make sure it has enough registers. My suggestion of x86 was a joke. Don't do it. I find MIPS very pleasant, although ARM would probably be more useful.
>>
>>61630674
>Due to python lacking braces and such
Instead he will mix spaces and tabs and get confusing errors.

Lua is a wiser choice. Ending blocks with "end" is very obvious.
>>
>>61630839
Yeah, thats him
>>
>>61630855
Lua is not meant to be beginner friendly, though. It's meant to be fast. There is a lot of black magic going on with meta tables in the background.

>>61630867
Did you suck it down?
>>
>>61630734
>friend confused because he never learned C, just C++ and had to Google the appropriate syntax for include statements
This makes your story sound fake.
#include is the same in C and C++.
>>
>>61629587
He said there is no pygame module though.
>>
>>61630889
>there's a lot of black magic going on in the background
Compared to Python?
Fuck no.
No newbie will even touch metatable for a long ass time.
>>
>>61628179
>Lua
Fuck off, skid
>>
>>61630855
>>61630833
I haven't used Lua but I'll check it out.

>>61630838
Do you mean logic gate level stuff?

>>61630839
I guess we'll start off high level first, because he just wants to learn programming. Then if he wants to dig deeper (which probably he will in the future) I guess we can do that.

I hope that there are emulators and I'll try these out.
>>
>>61630482
pff, I learned C at 12, by myself.
>>
>>61630900
Well, technically you're not supposed to use C includes in C++. As in iostream instead of stdio.h. And if you really want to, you should use cstdio in order to not pollute the global namespace.
>>
>>61630923
http://interactivepython.org/runestone/static/thinkcspy/Functions/thinkcspyExercises.html

Here. You can code in the browser. You even can't mix up tabs and spaces. Maybe you might even want to start him at the beginning of the tutorial.
>>
Any good resources on learning java or C#? I have a good grasp on the basics so far.
>>
>>61628058
I want to learn GUI programming. I know Java, C++ and Python. What's the best GUI framework for learning GUI programming?
>>
>>61630979
None. GUI programming is nothing but trash. Just write your own in fixed function OpenGL. That would be less of a mess then the current options.
>>
>>61630979
Java SWT, my nigger
>>
>>61630923
No ASM itself is very easy. You download the manual to your cpu instruction set and then you learn about registers. That's it.
You could learn ASM in a week or two.
>>
>>61631016
>You could learn ASM in a week or two.
Not with x86, you can't.
>>
File: python.png (23KB, 490x390px) Image search: [Google]
python.png
23KB, 490x390px
>>61630957
>the appropriate syntax for include statements
>what you choose to include
Completely different things.
>technically you're not supposed to use C includes in C++
Not true at all. If you want the C functions you include them. It's considered a language feature that C++ compilers can compile C code.

Also comparing C and python in verbosity for printing a number is ridiculous. The 'overhead' is easy to move past and is introducing you to things you will need to know to do anything useful. To me it sounds like you didn't actually give C a shot. you joined a crappy robotics club which chose the language for you and then when you left you left it behind.
>moved on to better languages from python
Like what?

>>61631001
"dear imgui" is a nice shortcut.
>>
how often does this loop in WinMain get called by Windows?

            while (running)
{
MSG message;

if (PeekMessageA(
&message,
0,
0,
0,
PM_REMOVE
)) {

if (message.message == WM_QUIT)
{
running = false;
}
//Convert the keyboard message and process it for whatever reason
TranslateMessage(&message);
DispatchMessageA(&message);
}
>>
>>61631088
>"dear imgui" is a nice shortcut.
But inefficient. Someone should rewrite that in vulkan. Command buffer reuse was made for shit like this.
>>
Can you help me guys

I want to establish some github system for around 5 people, problem is 3 of them don't know how to use git and don't give flying fuck about learning (i know)

I have decided it's safer to not let them learn cli git and just go with some drag and drop into folder gui, like dropbox

Problem is, i don't know which one is the most retard-friendly, what about tortoisegit?
>>
>>61631096
>how often does this loop get called
Your program runs that loop. Windows doesn't call it directly, it calls winmain and I'm presuming that loop is contained in winmain.
The messages will continue to be passed until your window closes.

A caveat to the windows message loop is that the callback you defined in your window handle can be called without having a message be passed through this message loop. Which is frustrating if you care about this loop intimately.
>>
>>61630900
See >>61630957
This was all sophomore year, I think, so around 2010. Ubuntu hadn't forced Unity on everyone yet, I had difficulties reinstalling the Windows Bootloader on my desktop so I used Wubi for my laptop, and the network adapter I bought for my desktop (Broadcom) wasn't really working on Linux. My favorite distro to this day is Puppy Linux because it was the most fun distro out-of-the-box without internet access. I had to teach my parents how to unmute their computers, so everything I learned I had to learn by myself. It wasn't fun.
>>
File: master · ocornut_imgui.png (3KB, 991x31px) Image search: [Google]
master · ocornut_imgui.png
3KB, 991x31px
>>61631127
>But inefficient.
>rewrite in vulkan
It's much better than a lot of these UI systems.
>>
>>61631026
I'm talking about learning vs mastery. You could spend years mastering C but you can learn C in about a month.
>>
>>61631151

yea well i care about it intimately because i have a moving visual on my application (a simple epilepsy trigger) but i want to vsync it if possible.
>>
Learning Nim by making small games using nimgame2.

Liking it so far, its standard library just needs a bit more polish.
>>
>>61631171
Only for the programmer. A gui is not supposed to be redrawn every god damn frame. dear imgui is meant for embedding into games for debugging and shit. But I would probably still use it because everything else sucks so much.

>>61631180
x86 assembly is more complex than C. We don't call it CISC for nothing.
>>
>>61631213
My nigga.

How did the implicit/explicit type conversion affect your impression on Nim?
Turns out you have to define the traits (concepts) for addition
>>
>>61631151

also, im asking because I thought that my application is running under the tyranny of windows right? since every time i want to update the pixel on my windows i have to set a flag to the windows saying i want to change the pixels to this set of pixels i have here (bitmap)
>>
File: dunecat.jpg (30KB, 439x392px) Image search: [Google]
dunecat.jpg
30KB, 439x392px
Employed Haskell programmer reporting in :)
>>
>>61631219
>Only for the programmer.
No, look at the performance of QT rendering an equivalent of what you can do in imgui.
It's pretty horrid.

I'm not saying imgui is ideal or anything. It's just perfectly fine for just about any desktop application on a modern computer.
>it's meant for
I don't care really. I have had so many shit experiences with all of these garbage systems I'm not using them anymore. They make no sense and often that's because of OOP philosophy.
>>
>>61631251
Can I touch your cock?
>>
>>61631251
>lying on the internet
>>
>>61631088
So there's a bit of a cult going on in my CS department where there are a few C fanatics. A guy I knew was proud of doing all his algorithms homework in C even though that was the style of the pseudocode in the textbook. He was so proud of himself. There were students in my C class who had difficulty grasping recursion and still think that the only language they really learned was C.

So after Python, I jumped to MATLAB (which is fine for linear algebra) then Java (which is fine for learning OOP) then C (which is fine for assembly/operating systems concepts). One C++ assignment in a stats for CS majors course and suddenly everyone in my class thinks they know C++.

I spent two classes and half a year in high school on C. I don't like the people involved in it and I think it's shit for scripting, which was the only work I've done that I've ever been appreciated for. I'm more upset that you think I'm lying.
>>
>>61631258
It will consume more power, though. I would assume that shit like at and native gui libs just write to the frambuffer directly without actually using the GPU. Fine for desktop, but it would be a disaster on mobile.

>They make no sense and often that's because of OOP philosophy.
OOP is perfect for guis. It's just that the designers are retarded. If you use OOP you need to explicitly differentiate between composition and aggregation with weak pointers.
>>
>>61631189
>>61631250
>vsync
You enable that through your opengl/directx context.
Not really all that related to this loop. Also iirc vsync for non-exclusive windows in windows rely entirely on the desktop vsync settings.
>since every time i want to update the pixel on my windows i have to set a flag to the windows saying i want to change the pixels to this set of pixels i have here (bitmap)
Yeah if you choose to render through the WM_PAINT calls I suppose. It's not the normal way to go about things. You tend to use opengl or directx to draw.
>>
File: ackchually.jpg (8KB, 250x250px) Image search: [Google]
ackchually.jpg
8KB, 250x250px
>>61631251
NEET C programmer reporting in
>>
>>61631290
>I would assume that shit like at and native gui libs just write to the frambuffer directly without actually using the GPU.
Well if you mean they build their bitmap themselves I can agree they feel slow enough that they'd be software rendering but I doubt they actually do that.
>OOP is perfect for GUIs
Elaborate. Nobody has ever argued this point convincingly.
>>
>>61631298
>Being truthful over the internet
>>
>>61631219
Not really. x86 is complex because of the manual but if you just search the manual then it's much easier. You also learn, within the week, how syscalls are run.
I've learned, to simple proficiency, about 20 languages and ASM was among the easiest. Because it is always how the machine operates.
>>
>>61631288
Oh so you're not actually a programmer. Nevermind you then.
>>
>>61631290
You can do GPU rendering with imgui. I would say the main inefficiency with imgui is that you need to draw every frame, which might not be necessary when no interaction or animation is going on.
>>
>>61631298
>>61631268
>>61631276
>replying to bait

every. single. time
>>
>>61631346
Most haskell users ITT are traps. I want to touch a feminine penis
>>
>>61631346
>replying to bait replies
every. so. often.
>>
>>61631311
GUIs are the reason the OOP meme took off in the first place. The point is that abstracting things into objects makes sense for GUIs since you can actually SEE the objects on screen.

>>61631341
That's my point. You can not not use the gpu. You will waste GPU and CPU cycles if you auto redraw every fucking frame.
>>
>>61631341
>You can do GPU rendering with imgui.
What the fuck are you on about?
You DO GPU rendering with imgui.
I haven't seen a software renderer implementation of it.
>>
>>61631363
>That's my point.
But it makes no sense. You can easily cache the commands and evaluate if there's any potential updates (you can easily define a region of the screen where mouse movement would potentially update the rendering for instance, or check for relevant keypresses).
What you will have issues with is limited updates. Because your drawing code carries so little layout state you'd have trouble jumping to the right place.

But consider how inefficient all these fucking drawing programs are you shouldn't even care. It's top tier oddly enough.

Being a performance-nazi when we're in such a bad state already is crazy.
>>
>>61628058
Trying to include a third party library (FLTK) in XCode but am having the worst fucking luck in doing so.

I'm following this guide -> https://stackoverflow.com/questions/25879961/setup-xcode-and-fltk

to setting up FLTK on XCode, but despite doing this, XCode can't seem to find <FL/Fl.h> (even though it's definitely included)

I have no fucking clue where to go from here
>>
Fuck why do I even waste my time here with you people?
>>
>>61631408
because you have nothing going on in your life.
>>61631398
i dont have this problem on linux
>>
>>61631421
What IDE / command are you using to compile?
>>
>>61631396
>Being a performance-nazi when we're in such a bad state already is crazy.
Look at the state of the webstack. Performance nazi, lmao. That's js dev reasoning.
>>
>>61631340
Why do people like you have to put down others to assure themselves of their own ability? How does that shit even work?
>>
Redpill me on Skia
>>
What do aaa games use for ui? Some proprietary autodesk things?
>>
Why does my code keep looping?
https://pastebin.com/9PctCa21
>>
>>61631245
Yea I read that thread, I'm used to explicit type conversions(even for simple shit like ints to float) so I don't mind really.

The concepts usage brings it back to my big negative that the stdlib needs work.

All in all there is this feeling that programming in this language feels a lot of fun(and more productive) even though you have to reinvent the wheel from time to time.
>>
>>61631463
>Why do people like you have to put down others [for contrived reason I've imagined because I wish to feel i'm in the right]?
How would you feel if someone stepped into a high-skill domain and started making incorrect claims that come from a lack of familiarity with the domain while wasting everyones time by being such an insincere person?

Stop being an ass anon. You wouldn't go to doctors forums and tell them about your house cures. But you come to programming forums and do just the same.
>>
>>61631421
>>61631430

Nevermind... Literally all I had to do was re-do the project.

Kind of a dumb thing to do, but who gives a shit. Maybe now I can actually get to programming what I want
>>
>>61631398
File names are case-sensitive mate.
I'm not familiar with XCode, but I see you have a folder called "Frameworks" and subfolder "FL," is that where you are keeping FLTK headers?
Also note your project name is misspelled (lol)
>>
>>61631519
>I'm not familiar with XCode, but I see you have a folder called "Frameworks" and subfolder "FL," is that where you are keeping FLTK headers?
Yeah.

>Also note your project name is misspelled (lol)
Fuck (lol)

Fortunately it works now. Thanks anyways
>>
>>61631490
Varies a lot I'd imagine. Most make their own UI systems, is my impression at least.
>>
>>61631495
Works fine for me
>>
File: 1474325315193.jpg (44KB, 636x616px) Image search: [Google]
1474325315193.jpg
44KB, 636x616px
>>61631268
Sorry to disappoint but I'm a gril :)
>>
https://hackage.haskell.org/package/grenade
Torch for Haskell!

You know a Haskell library is good when its types take multiple page widths of documentation: https://hackage.haskell.org/package/grenade-0.1.0/docs/Grenade-Layers-Convolution.html
>>
>>61631556
dropped then
>>
>>61631508
I don't really expect my friend from high school to know anything about C if he spent all his time with C++. I don't expect a question about what a 12-year old should learn as his first programming language to only be answerable by experts in high-skill domains. This isn't even a programming forum, it's a programming thread on a technology-related messageboard.
>>
File: Google Search.png (11KB, 561x207px) Image search: [Google]
Google Search.png
11KB, 561x207px
>>61631615
>This isn't even a programming forum
>>
File: dgffdg.jpg (62KB, 625x477px) Image search: [Google]
dgffdg.jpg
62KB, 625x477px
>>61631539
wtf i forgot to save the original source so i hastily retyped it and didnt even test it and now it works...
>>
File: 1qwertghjk.png (14KB, 166x166px) Image search: [Google]
1qwertghjk.png
14KB, 166x166px
post your github
>>
>>61631495
You should not be using srand in C++, and you should avoid static_cast too at least in this context.
Your construction of string soFar seems incorrect (http://www.cplusplus.com/reference/string/string/string/).
>>
>>61631679
Yeah, great idea, get doxed and harassed
>>
>>61631696
Did you use your real name for your GitHub?
>>
File: 1500917814823.jpg (639KB, 1500x782px) Image search: [Google]
1500917814823.jpg
639KB, 1500x782px
>>61631679
https://github.com/ez3chi3l
Currently moving eternity over to CMake, rewriting everything, and writing tests, so that's why I haven't committed in a while.
>>
>>61631706
Most open source developers use real names.
>>
>>61631691
fuck off
>>
>>61631719
wait did you seriously spend 11 months on that garbage
>>
>>61631797
C isn't productive
>>
>>61631797
>spend 11 months
I don't see a project where she spend 11 months.
>>
>>61631661
I get this strong feeling the guy in the pic is programming in Java
>>
>>61631851
oh wait actually 2 years L M A O
>>
>x11 is garbage collected
How true is it?
>>
>>61631797
Yeah well I have other things to do besides programming all day.
And if you got any criticisms of my code I wanna hear them pls, help me help myself, I'm begging you.
>>
int value = sizeof(int);


why is value = 4?? shouldnt it be 32 or 64?
>>
>>61631928
divide 32 by 8
>>
>>61631916
I don't have any criticism other than the fact that you used C and wasted your time on something that should have been a weekend project.
>>
>>61631948

well..erm.. why?
>>
>>61631928
bits != bytes
>>
>>61631928
size in bytes
>>
File: 1477855377260.jpg (50KB, 453x604px) Image search: [Google]
1477855377260.jpg
50KB, 453x604px
>>61631747
Maybe you shouldn't ask for help then, not sure what else to tell you man.
>>
>>61631959
One byte is 8 bits. Sizeof returns size in bytes. 4 bytes is 32 bits.
>>
>>61631954
Post your shithub then nerd.
>inb4 everything is python
>>
>>61628388
That would make offset calculation much less efficient, and program logic would be more rigid.

Never again would you see:
int size = 10;
int array[size];
for (i = 0; i < size; ++i)
do_stuff(array[i]);

and in its place there would only be trash.
>>
>>61632056
Like i said, its just because how weve all done it for decades.
Literally just start i at 1.
> make offset calculation much less efficient,
Why exactly?
>>
>>61632043

new to c, how do i run your program?
>>
>>61632083
>Why exactly?
because arrays don't real
>>
>>61629984

>Taking an online class
Hot garbage. If you're gonna pay for an education, pay for one with actual quality. Make sure you have the ability to pull your professor aside after class to ask questions about the assignment. Even better is when your professor is willing to spend a couple of minutes during the lecture to answer student questions about the assignment. This ensures that if multiple students are having the same problem, the entire class can get the background information necessary to tackle it.
>>
>>61632189
How many McChickens have you had with the help of Ruby programming?
>>
>>61632083
>Why
Computers are machines, and thus they are slave to the underlying logic of the universe. ie, there are rules. The flexibility we have in designing systems is finite and there are tradeoffs you see in every computational system / signal processor in existence, whether it's a cell, a localized network of cells, the brain, or a bunch of rocks.

Put directly, 1 is not an abstract thing the compiler does magic to, and then stuff happens. It maps to a hard mechanical basis in the machine. When you write array[1], "array" is a pointer to an address in memory, "[1]" means "+1". That's what an offset calculation is.

Say you've added together multiple quantities. That number is now stored in memory. It's actually there. Signals have been generated and manipulated in an orderly way to yield that result, which has been stored. Now you want to iterate over a number of bytes equal to that quantity. To do so, in every loop, there would now be "< size+1". Assuming the compiler just maps it differently automatically when you try to do subscripted access at compile time, the offset calculation is not automatic and either continues to function 1:1 of the stored quantities, or it tries to automatically add 1, or whatever. It's just a mess, and there is no benefit to slogging down that avenue until it shakes out into some hackjob of a thing.
>>
>>61631870
If you think that's absurd then you seriously underestimate the difficulty of writing robust C code. Gliv has been in development for 13 years and had a similar degree of functionality even 5 years in. Most people doing this use GTK or SDL in a single file project with a makefile and do not bother with shit like argument parsing, adhering to the XDG spec or rolling variadic macros for error handling which he seems to have done. Hardly a weekend project all things considered.
>>
>>61631251

Being an employed Haskell programmer does not mean you are employed AS a Haskell programmer. You could be a McDonalds fry cook who knows what a monad is, and technically be an employed Haskell programmer.
>>
File: 1493973448516.jpg (89KB, 406x371px) Image search: [Google]
1493973448516.jpg
89KB, 406x371px
>all these gaymurs complaining about GPU shortages due to miners buying them for PoW coins

Sure would be a shame if someone created a Proof of Bandwidth algorithm and the entire internet collapsed under its weight.
>>
>>61632251
hm, well that makes sense, thanks anon.
>>
>>61632251
"<= size" looks cleaner than "< size+1" imo
>>
>>61632237

I have not used a Ruby program to order a McChicken before.

>>61632087

Not him, but... compile it, run it. What's the problem?
>>
>>61632287
Proof of Bandwidth does not exist yet, but
Proof of Space does (BURST coin)
Mine with hard drives
>>
>>61632087
 git clone https://github.com/EZ3CHI3L/Eternity.git && cd Eternity && ./autogen.sh && ./configure && make

Then you can either run it by
./src/eternity path/to/file.png
or install it by
sudo make install
(should probably use checkinstall when installing things from source even tho I got proper uninstall rules).
You do need a working OpenGL driver. It doesn't work on mesa, and not sure about noveau.
>>
>>61632338
I know it doesn't. That's why I said, it sure would be a shame if someone created one.
>>
>>
File: 1324690418001.jpg (35KB, 388x380px) Image search: [Google]
1324690418001.jpg
35KB, 388x380px
Celebrating my birthday by completing action items from my code review.
>>
File: slut.png (606KB, 800x767px) Image search: [Google]
slut.png
606KB, 800x767px
>>61632442
happy birthday, heres a gift
>>
File: dt950624dhc0.gif (61KB, 1200x364px) Image search: [Google]
dt950624dhc0.gif
61KB, 1200x364px
How many times do I have to read sicp to gain fearsome wizard powers?
>>
>>61632631
It's [was] the book for introductory courses... you're not supposed to stop there.
>>
>>61632631

0. Wizard powers do not come from reading SICP... at least not on its own. Pick a Lisp and read its source code. Then extend it.
>>
>>61632654
where does one go after it?
>>
>>61630666
I started a psychological treatment that gave me hope of stopping a piece of shit. Also Paradigms of Artificial Programming in Lisp. Nice book, fun to read.
>>
>>61632772
Pick a project that interests you and make it work

If you're looking for more essential CS Books there's always K&R or Knuth
>>
>>61632804
>K&R
that's also a beginner book tho
>Knuth
is he really that good?
his books are fucking expensive
>>
>>61630095
Oh my gosh... why always boys make everything so complicated!!
>>
>>61632840
u havin a stroke m8?
>>
Can you actually make money as a freelancer/get a job as a programmer without a college degree? I always see people talk about how there's more demand for programmers than programmers available but do you need a degree or can you get by with just a solid portfolio and certs?
>>
>>61632904
>Can you actually make money
no
>>
>>61630095
>const float threehalfs = 1.5F ;
> y = y * ( threehalfs - ( x2 * y * y ) ) ;
wtf you dumb shit nigger
>>
File: John carmack.png (59KB, 531x467px) Image search: [Google]
John carmack.png
59KB, 531x467px
>>61630095
>>
>>61632660
Actually, by your own measure of developing wizard powers, SICP does develop wizard powers.
>read a lisp's source code
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-25.html#%_chap_4
>extend it
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-27.html#%_sec_4.2
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-28.html#%_sec_4.3
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-29.html#%_sec_4.4
>>
>>61632327

because from my experience in java you need a set of parameters for compilers to work most of the time so i was wondering about that
>>
Would there ever be a proper use case where a function could have two or more var types
like:

func : int || string -> int || string -> int || String
>>
>>61633156
no
>>
>>61633156
I have no idea what that syntax means. Nor do I know what a "var type" is.
>>
>>61633228
like
auto func (int x || string str, int y || string str2) 
{
...
return int
or
return string

>>
Scheme is the best Lisp
>>
File: dis.png (427KB, 545x557px) Image search: [Google]
dis.png
427KB, 545x557px
>>61633156
>>61633195
yes?
what is function overloading?
>>
>>61633280
i have literally needed to do this
you shouldnt either
>>
>>61633263
Yes that's what function overloading does.
>>
>>61633156
This is just combining two Either[Int, String] instances
>>
>>61633280
>>61633297
Any specifics where itd be best practice though?
>>
>>61633295
necessary? no
nice? yes
name mangling? thank mr sepples
>>
>>61633305
Validation
>>
>>61633295
You're right function overloading is a bad idea.
>double+
>float+
>longdouble+
>int+
>byte+
>short+
>uint+
>ushort+
>ubyte+
>long+
>ulong+
>volatilefloat+
>...
>>
>>61633305
Optional arguments and functions which do similar operations on different data, like * and +
>>
>>61633331
>similar operations on different data, like * and +
Wouldnt you just make a template then?
>>
>>61633346
A template is just automatic function overloading. You should also drop C++.
>>
>>61633361
Good thing C++ isnt the only language with templates. And i meant non-templated functions, but i realize the original question is silly.
>>
>>61628155
I want start game development as well any tutorial for Minecraft

Seems like a good place to start
>>
>>61633361
>You should also drop C++.
And move to...?
>>
>>61632660
>Pick a lisp
Does Ruby count?
>>
>>61633305
-- Either x y is like your x || y
checkEven :: Int -> Either String Int
checkEven x = if x `mod` 2 == 0 then Right x else Left "Not even"

checkMultipleOfThree :: Int -> Either String Int
checkMultipleOfThree x = if x `mod` 3 == 0 then Right x else Left "Not multiple of 3"

addCheckedInts :: Either String Int -> Either String Int -> Either String Int
addCheckedInts x y = (+) <$> x <*> y -- or just liftA2 (+)


*Main> addCheckedInts (checkEven 4) (checkEven 6)
Right 10
*Main> addCheckedInts (checkEven 7) (checkMultipleOfThree 6)
Left "Not even"
*Main> addCheckedInts (checkEven 6) (checkMultipleOfThree 7)
Left "Not multiple of 3"
*Main> addCheckedInts (checkEven 6) (checkMultipleOfThree 9)
Right 15
>>
>>61628155
>minecraft
>games in general
Way to waste your time. But you're probably 13, so still years to learn.
>>
>>61633435
Interesting.
Thanks lad, i need to get more comfortable with function chaining.
>>
>>61633399
D. Shit's clean af
>>
Any good recommendations for parsing an input with infix expressions? (a + b - c / d)

I'm looking for resources that will help me make a calculator
>>
>>61633518
https://www.youtube.com/watch?v=kNqiiyPu2eg
>>
File: 1495486088249.png (371KB, 832x868px) Image search: [Google]
1495486088249.png
371KB, 832x868px
>>61633542
Delet this
>>
>>61633538
Infix expressions fucking suck. I'm pretty sure you have to do multiple passes grouping according to PEMDAS to form an AST.
>a + b - c / d
>a + b - (c / d)
>(a + b) - (c / d)
>((a + b) - (c / d))

If you don't want to do PEMDAS it's a lot easier. Read 3 symbols at a time, interpret them, then substitute the 3 symbols with the output of the operation.
>1 + 2 - 3 / 3
>3 - 3 / 3
> 0 / 3
>0
>>
>>61633598
I think GHC (Haskell compiler) parses all operators and then re-arranges the tree according to precedence and associativity
>>
Ok hello there friendos, I have a basic ass C++ question but being new to programming as a whole (couple of weeks) I can't fucking figure something out

I have a function with parameter of type int. I want to create an array in said function of the size indicated by the int parameter. Is this possible?

I cannot make the int parameter a const int, and I cannot use vectors. So those two are out of the question
>>
>>61633656
.g c++ new []
>>
>>61633653
That's cheating though.

I had a final step which was
>(eval '(- (+ a b) (/ c d)))
But cut it out because I thought that was cheating.

But """write""" a calculator that's literally the GHC REPL? You didn't write a calculator. You didn't do shit.
>>
>>61633683
What? I'm just telling you how GHC handles infix expressions
>>
>>61633683
He didn't mean use GHCI as a backend, he meant do what GHC's parser does (parse without operator precedence then rearrange the tree to fix it). You will need to remember which nodes of your AST were made of parentheses to do it I guess
>>
>>61633699
>how
You didn't say shit about how. You just said that it did.
>rearranges the tree according to precedence and associativity
Ain't no how.
>>
>>61633598
>>61633683
Thanks for the responses!
How doable would an "Infix to prefix" converter be? I was thinking that if I separate the tokens (making a couple of assumptions with order of operations for now before I iron out all the details), then parsing the prefix-ed input would make things a bit easier
>>
>>61633730
There's no fucking point wasting any more time on you.
>>
File: tdmgcc1.png (8KB, 327x103px) Image search: [Google]
tdmgcc1.png
8KB, 327x103px
I have been using tdm-gcc for a while now but I am having trouble working with c++11 and past.
What are some good compilers that can actually handle the new standards?
>>
>>61633756
>wanbowlz
haha
>>
>made a clever program that has no high demands
>it aided my work though
>wants to sell copies, but the attitude of programmers today are to make open-sourced and freeware
>attitude of computer users are to hunt for the free shit
>chances are that anyone can reproduce my algorithm
>in desperate need of some money, even selling this code without encryption and license generation, but no where to list it
wat d0
>>
what does it mean for a algorithm to be feed-forward??
Our  method  is  faster  than  a  number  of  example-based methods,   because   it   is   fully   feed-forward   and   does not  need  to  solve  any  optimization  problem  on  usage
>>
>>61633538
Look into "shunting yard algorithm", it's the easiest algorithm for infix operators, and it allows for both left and right associativity if you need it.
>>
>>61633792
provide a service. information should be free
>>
>>61628058
Please use the anime image next time.
>>
>>61633735
Converting something to prefix notation requires that you already have the syntax grouped by order of operations.
>a + b - c / d
is either
>/ - + a b c d
or
>- + a b / c d
in prefix notation depending on order of operations

But once you have everything grouped it's not too bad.

What language are you going to write this calculator in?

>>61633741
:^)
>>
>>61633800
Holy shit this is exactly what I was looking for.
Where can I go to praise the algorithm hyper-god Dijkstra?
>>
>>61633836
C/C++
I'm probably going to use the shunting yard algorithm but it looks like I'll need to read up on it in detail before I even attempt to tackle the calculator
>>
>All the faggots muh learned X lenguage at 12 years old
>Still no games or fame with a gamestudio today

Top kek
>>
>>61628058

Rewriting Rust in Scheme rewritten in Haskell on a Linux kernel rewritten in HolyC
>>
File: DFKrCrhV_400x400.jpg (10KB, 225x225px) Image search: [Google]
DFKrCrhV_400x400.jpg
10KB, 225x225px
>>61633862

> Gaymes
>>
>>61633853
Oh yeah I didn't know about that algorithm. Looks pretty neat and way less complicated to do in C. My strategy would involve using trees which are significantly more painful than stacks in C.
>>
>>61629316
How is this even programming?
How is teaching students to install libraries and then pass some functions to them actually programming?

We're raising a generation of computer niggers I swear.
>>
File: dijkstra.png (44KB, 643x220px) Image search: [Google]
dijkstra.png
44KB, 643x220px
>>61633842
>Where can I go to praise the algorithm hyper-god Dijkstra?
https://en.wikibooks.org/wiki/Haskell
>>
>>61633800
That reminds me, do you happen to have any good books/resources for it?
I tried looking in my library for "Shunting Yard Algorithm" and all I got was conferences on transportation

>>61633883
>Haskell
This was actually a language I was intending to pick up after SICP!
If I had known Dijkstra loved it this much before, I would have jumped on the functional paradigm train much earlier
>>
Question to C/C++ autists: why won't you use a package manager? Do you think hunting down dependency is easy for retard consumers like >>61633430 ? He should be using a Linux binary in the first place
>>
>>61633897
Maybe Dijkstra just really hated Java.
>>
>>61629540
Works great for microservices. I don't see the problem with python in production, I do see the problem with using python for the wrong things, though.
>>
>>61633898
I do use a package manager for C libraries though.
>>
>>61633842
I don't know, Hacker News or something

>>61633897
In the past I've just transcribed off the wikipedia page and it works. It's just an algorithm, and a pretty simple one at that. The thing you'll have to notice is that it's usually designed for emitting RPN expressions, and you want prefix expressions. The difference between the two is very little and it is very easy to make shunting yard work for either. I can write an example of the algorithm but I'd rather not do so in C++
>>
>>61633919
Yes that package manager syncs with the distro the user's on, it won't probably download your preferred version of library. Or it might not even be available in his distro repo
>>
>>61633898
Is Conan shit or something?
Have never heard any sepples friends talk about it.
>>
>>61633932
Use Meson
>>
>>61633944
I dont use C/++, just asking
>>
File: Master Hand approval.gif (813KB, 303x303px) Image search: [Google]
Master Hand approval.gif
813KB, 303x303px
>>61633926
Fair enough. Thanks for all the help anyways!
>>
>>61633930
Just stick the dlls/sos in the same folder as the executable. Not that hard.
>>
>>61633959
that doesn't solve the problem
>>
>>61633967
What problem is there? If your user is using something other than windows or a debian based linux then they're off the reservation and they should be able to handle it themselves.

How hard is it to include the dlls or source files in your package for people who are off the reservation?
>>
>>61633976
>What problem is there?
The required version not being in the repo.
>>
>>61628058
Working on my imageboard, 4kev.org
>>
>>61633992
>How hard is it to include the dlls or source files in your package
All you have to do is include gay-library.so with your zip/tarball/installer/etc
>>
>>61634042
>All you have to do is include gay-library.so
How about actually making a script that downloads from the git and builds it for the user?
>>
>>61634056
>How about actually making a script that downloads from the git and builds it for the user?
Less than 1% of users including advanced users would have anything to gain from such a script. Writing it would be a waste of time.

There's value in letting people build from source, but that should be a big package on your website. Why would you ever not keep local copies of a library and its source code on your product's website?

Why would you make your product totally dependent on some other fag's server being up?

That kind of thinking is how node.js got brought to its knees when the guy who wrote leftpad got pissed.
>>
>>61634151
>>61634151
>>61634151
>>
>>61632934

What these links show me is the definitions of standard library functions. I'm talking about tearing apart the interpreter itself. Incidentally, that is right here for MIT Scheme:

https://git.savannah.gnu.org/cgit/mit-scheme.git/tree/src

And right here for more sane and usable variants of Scheme:

https://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=tree
https://github.com/Conservatory/s7
https://github.com/racket/racket

>>61632997

In the C world, we have build scripts that handle what flags to send to the compiler.

>>61633408

Ruby is not a lisp... although I suppose any dynamic language would work in a pinch. If you wish to be a wizard, it is fundamentally important that you see how your program runs on the metal, beyond all of its abstractions.

Incidentally, if you do want to modify a Ruby interpreter, I recommend using MRuby. It's kind of built for that shit. Of course, on the flip side, it also doesn't have a lot of functionality out of the box, including "require".
>>
>>61629316
turtle
Thread posts: 321
Thread images: 36


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.