/dpt/ - Daily Programming Thread

Previous thread: What are you hacking together incompetently, Cred Forums?

Other urls found in this thread:

youtube.com/watch?v=5LlQNty_C8s
chem.ualberta.ca/~massspec/atomic_mass_abund.pdf
eclipse.org/downloads/packages/eclipse-ide-java-developers/neon1rc3
dotnetperls.com/oop
htmlgoodies.com/beyond/php/article.php/3907521
youtube.com/user/pannekeok2012
youtube.com/watch?v=9hdFG2GcNuA
hackerrank.com
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-1-algorithmic-thinking-peak-finding/
pastebin.com/dtQkNF2R
opengl-tutorial.org/
code.visualstudio.com/
eclipse.org/downloads/packages/eclipse-android-developers/neonm6
docs.oracle.com/javase/7/docs/api/java/util/Stack.html
catb.org/esr/faqs/hacker-howto.html
twitter.com/NSFWRedditVideo

First for D

I a dumb
How can I have it so that in a CodeBlocks project, the include, lib, src folders are in the project folder?

Also I still can't figure out how to get glad.c to be able to find glad.h.

deez nuts that is

youtube.com/watch?v=5LlQNty_C8s

In Java, what does a statement like this
Integer newInt;

do vs a statement like this?
Integer myInt = new Integer(1);


The first declares an instance and the second declares it and allocates space in memory so it can be used?

Do we agree that these books in img are still accurate? The picture is still suggested on installgentoo.

What modern sources for learning are you using?
>2016 and still finding books the best condensed source of learning, with exception of treehouse and itpro

Pretty much

>The first declares an instance and the second declares it and allocates space in memory so it can be used?
Pretty much.

Integer newInt is just an uninitialized reference, you could assign null to it or a reference to another object

Integer myInt is a reference which you initialize with a reference to a new Integer object which gets created on the heap

>Design Patterns
That book is garbage.

>CodeBlocks project
Have you tried not using an IDE?

>Also I still can't figure out how to get glad.c to be able to find glad.h
If you include like this:
#include "glad.h"
Your compiler will look for the header file relative to the source file.

If you include like this:
#include
Your compiler will look for the header file in a set of predefined include paths, of which, more can be added with the -I (that is a capital i, not lowercase L, in case your font sucks) flag in GCC and Clang.

i want to have sex with an ai

Snake oil makes your code Faster™, more Efficient™ and Scalable™

Wow
It's true that tripfags never make good posts
You didn't even understand the question and thought that the compiler couldn't find the header

In fact, I've been seeing a lot more namefags lately.
They used to be a shitty anomaly but now it feels like there's sometimes many to be a thread.

>Have you tried not using an IDE?
have you tried not having autism

>Your compiler will look for the header file relative to the source file
your compiler will look for the header file relative to the source file *first*

>Your compiler will look for the header file in a set of predefined include paths
your compiler will look for the header file in a set of predefined include paths *first*

ftfy

>What are you hacking together incompetently, Cred Forums?
DNS server

user had two problems, one of which was related to Code Blocks projects, which I didn't answer, and told user to stop using IDEs. The second, was how the fuck to make a header visible to a source file, which I answered.

Still working on my smiles parser, trying to figure out the best way to calculate an individual atoms mass and abundance using element and isotope.

I started out using this data with pattern matching:
chem.ualberta.ca/~massspec/atomic_mass_abund.pdf

But there has to be a better way of doing this! Theres no way I`m going to write out pattern matches for over 100 elements each with their own isotopic masses, abundances and valances. Is there some kind of magic algorithm I can use for this??

stop using codeblocks, it will fuck your ass at OOP, just go for visual studio and be a microshit cuck or stop using ide... also I learn how to insert libs from some youtube pajeet.

You could try loading it from an online database, or create a file

Do you know how to change the predefined include paths?

"Source file" is extremely ambiguous though.
The obvious, sensible thing to do would be to say "glad.c".
But some IDEs refer to the main program as the source file.

Plus, your solution is bad practice because it modifies the library, when someone who actually understood the IDE would be able to do it without changing any code.

fuck off triphomo

>Do you know how to change the predefined include paths?
codeblocks surely has a project setting for this. probably called "include paths" or something similar

>"Source file" is extremely ambiguous though
not really in this context, it just means a .c or .cpp file that contains implementation source code

>But some IDEs refer to the main program as the source file
uh... what?

>Plus, your solution is bad practice because it modifies the library, when someone who actually understood the IDE would be able to do it without changing any code
he wasn't talking amount changing the #include line in glad.c, he meant when you #include glad in your project header/source files

>"Source file" is extremely ambiguous though.
In the context of C, a "source file" is a .c file, and a "header file" is a .h file. What your IDE refers to things is irrelevant. I am merely using the terminology I have heard from every single C programmer I have ever spoken to.

>Plus, your solution is bad practice because it modifies the library
The only thing I am telling user to modify is his build script/makefile. If your compiler does not know where to find your header, you have to expand its list of include paths, which is done with the -I flag.

>amount
*about

>The only thing I am telling user to modify is his build script/makefile. If your compiler does not know where to find your header, you have to expand its list of include paths, which is done with the -I flag
he already made it clear he's using an IDE, so this isn't particularly helpful

What are you hacking together incompetently, Cred Forums?

>Doing 400 level networking paper
>University has some research SDN (software-defined networking) controller
>Assignment is to add a feature to this program
>Give a very sparsely explained list of feature ideas, and basically no explanation how to implement them
>My university is just trying to exploit the students for free development time
Not to mention that this assignment is hard as fuck. This assignment was due yesterday and I haven't managed to implement anything non-trivial.

>he already made it clear he's using an IDE, so this isn't particularly helpful

IDEs should have the ability to set compiler flags for the project. But I will stress my point that he should NOT be using an IDE in the first place,

>IDEs should have the ability to set compiler flags
sure, as an option for less common flags. using such a feature for setting the -I flag would be retarded, though, because every IDE exposes that functionality in UI

>But I will stress my point that he should NOT be using an IDE in the first place
yeah, we get it, you're a sperg. chill out

Any x86 assembly wizards out there? How fucked is this? This is meant to be the entry point of my program.

CPU Disasm
Address Hex dump Command Comments
00EB2000 /$ 55 PUSH EBP
00EB2001 |. 8BEC MOV EBP,ESP
00EB2003 |. 81EC C0000000 SUB ESP,0C0
00EB2009 |. 53 PUSH EBX
00EB200A |. 56 PUSH ESI
00EB200B |. 57 PUSH EDI
00EB200C |. 8DBD 40FFFFFF LEA EDI,[LOCAL.48]
00EB2012 |. B9 30000000 MOV ECX,30
00EB2017 |. B8 CCCCCCCC MOV EAX,CCCCCCCC
00EB201C |. F3:AB REP STOS DWORD PTR ES:[EDI]
00EB201E |. B8 12000000 MOV EAX,12
00EB2023 |. 5F POP EDI
00EB2024 |. 5E POP ESI
00EB2025 |. 5B POP EBX
00EB2026 |. 8BE5 MOV ESP,EBP
00EB2028 |. 5D POP EBP
00EB2029 \. C3 RETN


C++ source code
__declspec(noinline) static int main() {
return 18;
}

That's a big executable.

pretty normal for -O0

I forgot to add that it runs that it hangs on this windows nt procedure sometime after the retn.
CPU Disasm
Address Hex dump Command Comments
77748760 /$ B8 B9010000 MOV EAX,1B9 ; ntdll.NtWaitForWorkViaWorkerFactory(guessed Arg1,Arg2,Arg3,Arg4,Arg5)

Lotta extra work to move 18 into eax

>Show user how to use UI component of one IDE
>On another project, finds himself needing to use another IDE, or working with a Makefile project
>Runs into the same problem because he doesn't know how the fuck his goddamn compiler works.

Most of this code is just pushing and popping the stack frame -- a common setup and cleanup for functions. With optimization flags, a compiler might just spend the time deducing when it doesn't need to actually do this.

But I can include glad.h in the main program perfectly fine, the problem is that glad.c can't find glad.h which is why I took it as a suggestion to modify glad.c.

>Runs into the same problem because he doesn't know how the fuck his goddamn compiler works
my whole point is that preaching your autistic preferences and telling him how to set the -I flag ("knowing how the compiler works" apparently, kek) doesn't actually help him find the UI element in his IDE you fucking retard

abstracting my websocket resources and their subscriptions by utilizing rxjs cold observables published with refcount.

programmer is nice, but how do I become a Code Artisan?

...

Can I create a Dictionary pre populated with the data and then somehow save it as a hardcoded string and load it at runtime??

It's less so much autistic preferences, so much as knowing the tools that are used in the vast majority of C projects.

what's the best java ide for linux?

IntelliJ

knowing the the compiler toolchain wouldn't actually help him solve this problem, though, because it's a matter of how the IDE exposes that functionality. and christ, while we're at it, IDEs are among the tools used in the vast majority of C/C++ projects

it's posts like these that make it obvious the writer has no idea what the fuck design patterns even are

I don't think there was a single instance in my (one) software engineering class that claimed design patterns and methodologies had anything to do with execution speed or efficiency

eclipse.org/downloads/packages/eclipse-ide-java-developers/neon1rc3

Just store some data in a text file then load it into a dictionary when you run your program

dotnetperls.com/oop

It's nice your (one) software engineering class didn't even try to sell snake oil as doing anything, but you're so hooked you bought it anyway

htmlgoodies.com/beyond/php/article.php/3907521

>If you have not yet entered the realm of Object Oriented Programming, then you are at a disadvantage, and you are falling behind fast.
...
> OOP is faster, simpler, easier to debug, uses less server resources, less code, is faster loading and more logical to work with

That page claims OOP makes your shit run faster (it doesn't), but also claims that OOP and design patterns makes you design faster (it can), which is the difference.

Nobody cares about making programs that run well anymore. Just get the job done as fast as you can without fucking anything up.

It's like building cookie cutter housing instead of uniquely architecting a home for each user. Who cares that it isn't perfect for them, they'll live in it for the next few decades just fine.

>hurr durr oop in loo!

dropped

Name a benefit of OOP

Design patterns and OOP are not mutually inclusive. I don't have to name shit.
Your original argument was towards design patterns.

My education is above a single paradigm and your memery doesn't work here.

C++ projects... maybe. C projects... The vast majority I've seen use an autoconf script and gcc, or a plain Makefile and gcc.

>Design patterns and OOP are not mutually inclusive
Could've fooled me

>I don't have to name shit
*i can't name any benefits to OOP
Name a benefit to "design patterns"

>My education is above a single paradigm
Doesn't look like it.

As I've said before: cookie cutter design.
I'm not going to uniquely program something for you in C/++ unless you pay me to.
Otherwise you're probably paying me to design some shit in Java or C#, in which case I will take every opportunity to copy the designs of every other program I've written and not think too hard about the nitty gritty details, because I've worked them out already.

Nobody asked you to program anything, they asked you for a benefit to design patterns

I have no idea what a cookie cutter is, I'm not american

C++ projects *definitely*, and you're truly delusional if you think otherwise. Less so for C, sure, but that's because C projects tend to be small because it's impractical to do anything large-scale with it. That and a ton of C programmers legitimately have autism. Also, you seem to be forgetting that you can still use IDEs with makefile/CMake/etc projects (with widely varying levels of integrated support of course). Just because you see a makefile doesn't mean the author of a library isn't using an IDE to edit their code

Get the fuck out of here.
You don't even know what design patterns are
What the fuck are you even trying to do by parroting retards on /dpt/?

Here's your fucking (You)

Very good, but not perfect.

Reading comprehension is hard, ain't it?

>you don't even know what design patterns are
Specially designed canisters for storing the snake oil. Can't let it lose its snakiness.

I just realised; every time I've asked these questions, the answer has been different.
Why is that?

I say this, but more often than not they're just snake oil for the snake oil.

Still no benefits given.

Because no one can be assed to learn CodeBlocks enough to tell you how to set things up in the way you want. Read the manual.

>it's impractical to do anything large-scale with it
There are literally thousands of large-scale C projects.
Just because you can't wrap your head around C, it doesn't mean that others can't.

>There are literally thousands of large-scale C projects
there literally aren't. i don't think you know what large-scale means

>Just because you can't wrap your head around C, it doesn't mean that others can't
haha wow. that's ironic as fuck. my problem with C is that it's literally too easy to wrap your head around. C is for people who can't wrap their head around C++

What's OP's pic from?

pannekoek2012

For you.

Actually pannekeok2012
pannekoek is exclusively a channel for successful progress for the A button challenge.

I can't find which one exactly.

youtube.com/user/pannekeok2012

The channel is dead? I can't find anything.

youtube.com/watch?v=9hdFG2GcNuA

Nevermind, the spelling was wrong, it's "pannenkeok2012"

Holy fucking
SHIT.

People were memeing about the 12 hours, but he actually let the fish swim FOR 7 (SEVEN) DAYS.

There goes my night

Cred Forums here, we covered all this a few months ago

>Special. C# is special because it eliminates the hard stuff. It has a compiler that basically rejects any code that looks like it could be buggy, whether it is or not.
my sides

>No clean code by Robert C Martin.

Kinda pleb

Can anyone suggest a website that presents actually challenging (without being insane) programming challenges to users?
hackerrank.com appears to all be extremely easy shit

trying to learn how to implement and use linked lists in C, but I feel like I'm too dumb for this stuff

linked lists are just a series of nodes that point to the next (and sometimes previous) node and that have a value
What's so hard?
I'm not a C dev but it's a fairly simple concept.

I managed to implement one but I'm having trouble putting it to practical use. it's hard because I'm retarded

What do you mean practical use? Like you can't think of any use cases, or you aren't able to code the various functions typically associated with lists like append, getat, etc?

the latter

code.org. Start at middle school and adjust as needed

T. Teacher

Well, consider this:
For those functionalities, you would only need to write fairly simple functions.
For example, an append would, on a linked list made of structs that contained a data and a next field, look like this (pseudocode):

append(node n, element e){
while (n.next != null){
n = n.next;
}
n.next = e;
}

with e being a new node
I don't know C, but you're also going to have to allocate memory for each node. Beyond that, that should be it.
Remember, linked lists as a data structure are totally relational- so you're going to have to walk over each node to get to a specific node. The same works for getAt, but instead of checking if the next is null you'd have an aggregator variable that saves the step you're at that you're checking against.
Yes, it's slow, and inserting will take O(n) time and so will just about every other operation other than appending to the beginning of the list, but that's just how they work.

Thanks, I'll take a look.

user, this appears to be for very young children unless I'm looking at it incorrectly... the hardest challenge appears to be understanding the concept of functions with parameters.

let me try that again
append(node n, element e){
while (n.next != null){
n = n.next;
}
n.next = e;
}

Wait are you trying to learn how to program or do you want challenges?

If so try project euler

How bad/good idea is this:
vars,h
namespace foo {
static SomeHeavyClass* foo;
satic SomethingIDontWantToCopy *foo;
}
//main.cpp
#include "vars."
//init stuff here


Unlike class with static vars namespace should only be initialized once and wont make copies of itself, right?

okay, thanks user. should I read a book on algorithms?

Or should i use singleton for static classes i want to have only 1 instance of.

I want challenges
I'll check out that website as well, thanks!

I mean, you're not going to get very far with C without knowing algorithms. Since almost nothing is done for you, you're going to have to do it yourself.
In fact, I'd highly recommend that you start working with a higher-level language until you feel more comfortable with programming concepts (I'm assuming that you're new or new-ish given your problems- sorry if I assumed incorrectly). Regardless, I'd recommend Java, C#, or C++, then come back to C when you know more.

Instead of reading a book, take this series of online lectures, take notes, and do the coursework. You'll learn a LOT.

ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-1-algorithmic-thinking-peak-finding/

I'm still lost :-( I'm not sure where to spend my energy and time. C? Haskell? Clojure?

What sort of math should I learn to become a better programmer.

I already know how to program, but I feel I'll forever be a code monkey. It's not that I'm bad at math, it's just that I've never seen it or just forgotten most of it.

Depends on what you want to do, Discrete math is must have for algorithms. For 3D linear algebra 1 and 2. It never hurts to know calculus 1 and 2...

Stop listening to Cred Forums. If you've never programmed before you don't want to learn either of those. They'll make you hate programming. You want to start with something like python or C#.

But if you still want to learn any of those 3 pick C as it is the most useful and it isn't a functional meme language.

Every programmer should learn C, preferably as a first language. If you don't know it already, learn it.

C, C++, java

fuck off
learn C or Lisp
Or are you a fucking bitch ass pussy?

>OOP enables those of us who are not computer science geniuses to write programs that are good and fill the needs of the market.
Confirmed Pajeet paradigm

I'm writing a simple dungeon crawler in C. I tried starting off writing player.h, including structs for player, inventory, item etc - however I just end up super confused about where something should go.
Is there anything wrong with just having a single main.c file?

hi guys im new to programming and am learning c++
i just wrote a temperature convertor program. can some one rate it and give me feed back how to make it better? thank you. please dont bully me

No. Maybe we can if you actually post it.

oops
pastebin.com/dtQkNF2R

It can be hard to split everything up if you start out with it all in one file.

On the other hand I think trying to write all the structs before you know what the actual program looks like can't turn out well.

I'm a programming newbie and interested in using Linux. Is installing gentoo actually, literally just a meme or is it handy for coding and development?

i recommend tackling problems of a bit greater complexity before looking for feedback.

i dunno. maybe try implementing the chess game w/ qtcreator. for a new person it should take 10-20 hours

Can't really judge coding style as my Sepple knowledge is really rusty&limited but I don't see any major flaws.
For sane input it works fine.
Maybe you should check the input though if it actually is proper input (e.g. if the chosen mode is in {1,2}, check if the temperature input is actually a number etc).
I'd say good enough for a beginner but you don't really need us for so simple projects (see: )

ok thank you

Spent over an hour debugging. Fucking auto deduced wrong type. AARGH, thats what i get for following c++14 guidelines, use auto, yeah right

I only use auto if it's 100% obvious what type is the result. Saying that it always should be used sounds like some shit some pythonista would come up with before complaining that the language had too many features when it ends up fucking him in the ass later.

I always used to use explicit types, yesterday watched some cpp con video by herb sutter on c++14. Seemed like good idea haha. Damn im annoyed now.

>C++
>Ever
It's s h i t

Go write your ruby and nodejs you fucking code artisan.

Just a meme, especially for a beginner I'd recommend a distro from the ubuntu family (ubuntu,kubuntu,lubuntu, etc) or maybe linux mint.

*tips tendies*

How are Linux drivers for devices really written? I'm taking a course this semester but I want to know beforehand how it works.

I read somewhere that they reverse engineer the equivalent Windows drivers to see how the device drivers should work, and they port it to linux. Is this true? Isn't it a big pain in the ass, if it's true?

I hope there's still some knowledgeable people browsing this board

yes

yes and yes

I prefer the term 'code barista'

#include

int
main(int argc, char *argv[]){
printf("Hello World!");

return 0;
}


wtf why wont my cod compile???

>pastebin.com/dtQkNF2R
The indentation is a bit wonky.
At the top there is a randomly indented cout. the first couts in both the if- and else-blocks are not indented as they should be and return should also be indented.
Also your bracket placement is inconsistent: In the if-block the opening bracket has it's own line, the else-block's opening bracket doesn't.
It doesn't matter what style you want but be consistent throughout your program.

These are just visuals but wrong indentation can lead to wrong assumptions about the code, see
if (condition)
do_something(); /* only executed if condition evaluates to true */
do_some_other_thing(); /* executed regardless of the if-clause */

I don't want to send a beginner to read a styleguide, so for now just try to keep consistent and indent right.

>#include
There is no studio.h only stdio.h
STandarD Input Output

Kids dont do this it doesnt work, use singleton pattern instead....

On other hand i managed to dynamicaly setup loading resources for game engine...
in resources.lua

TEXTURES = {
main_background = {"./background.png", "main_background" },
player = {"./playerSheet.png", "player"}
}


It should be easy now to change sprites on runtime without recompiling...

top kek user

>studio

thank you user

cell[width * height] or cell[width][height]?
I'm leaning towards just using a single block of memory rather than width lots of height blocks, seems nicer and there really isn't any greater complexity manipulating the first structure over the second.
I ask because I'm so used to using multi dimensional arrays in Java, even though I think I might prefer the former example, I'm thinking maybe it's better practice to use the second.

It seems nicer to just have a single continuous block.

So I'm rather new to programming... I'm using XNA Framework 4.0 in Visual Studio 2010. It seems every sprite I draw on the screen has a box around it. I feel like the only idiot that has this problem, because no matter how I tried to look it up, I couldn't find anybody with the same problem. Any help would be appreciated.

Post pics

...

Are you using transparent pngs? It seems like your textures have white background...

heyo
i was thinking of trolling a mate of mine by ssh'ing into his macbook and playing random shit during class. i know how to, but i need is password
any way to do so without needing his password, say by using kali linux or something
i'm a complete fucking noob so yes this is stupid but ty

lol

Fuck off, retard.
Protip: I highly doubt macs have remote login enabled by default.

try Cred Forums instead

I'm not sure how to make a .png file transparent.

thats no longer programming problem and this is dpt, use google.

What font is this?

/daily retardation thread/

you need to use alpha masking

Install a more competent image creation software than paint.

So how do I get GLAD to work in CodeBlocks?

Actually, have you considered trying to make it work without the IDE, like other anons have said?

This way might learn you some new insights that might help you with wrestling with the IDE.

Perhaps, stuff would make a lot more sense if CodeBlocks wasn't adding to the complexity.

But where do you draw the line between IDE and a simple compiler?
I don't see any reason to go with a Command Prompt tool if something more user-friendly exists, but the problem is that there doesn't seem to be much stuff that is a very easily usable compiler but doesn't make things harder with IDE-controlled nonsense.

Also, if you're not using an IDE, how are #include references in triangle brackets interpreted?

#include

Compiler and IDE are to entirely different things.
The compiler is the program that translates your text files to machine code. The IDE is the program that you can write your text files in and has an easy shortcut to calling your compiler. And often has fancy extra stuff like debugging tools and other things.

Compiling from the command prompt is what you should be doing, in educational purposes until you stop getting all the basic concepts confused.

#include is a preprocessor directive, which is part of the compile chain. It has nothing to do with the IDE.
Basically before the compiler does it's thing, you have the preprocessor that goes into your code and changes some things up to make things easier to parse for the compiler.
Often we casually and informally speak och the whole compile toolchain, preprocessor->compiler->linker, as the compiler.

Alright, well what I meant is; can I get a compiler (in the informal sense) which is really just the command tool stuff using a GUI, and English names for flags?

What?

i.e. something that seems like a very simple IDE but it doesn't really do anything that basic compiling tools don't.

That's called a text editor, lad.

Notepad++ plus MinGW command line tools

A text editor with a 'compile' button is enough to qualify it as a rudimentary IDE, in my eyes.

No, I mean a GUI to take the files, link them, and compile them.
Rather than a command line tool doing that with condensed names and single-letter flags.
Last time I tried anything technical with command line I accidentally reformatted a hard drive.

kek

Now i'm wondering if you should be allowed near a compiler at all.

#include

int main(void)
{
int i = 1;
int j = 2;
int k = 3;
i -= j -= k;
printf("%d %d %d", i, j, k);

return 0;
}


why does i = 2 here?

So you're looking for a programming tool with a GUI that allows you to drag/drop and create files, and it automatically groups these files together as a project that you can easily compile and debug with a single button?

you accidentally the whole thing?

That's what an IDE is.

Cool, you can set up most text editors with the file location of your compiler/command for your compiler, and if the text editor has a "project" feature, it may even generate build scripts for you.

No, but really, the unfortunate truth for you is that you gotta learn the basics of compiling from the command line or you won't develop the understanding to set up you projects properly in any ide. Which is what you're currently having problems with in CodeBlocks.

You could always try VisualStudio. It lets you do pretty much everything without ever touching a command line, but it can also be pretty daunting for a beginner.

a list of your accomplishments, it's so difficult

The assignments operators are right-to-left associative.
So the line
i -= j -= k;
is parsed as
i -= (j -= k);
Also, the -= operator is equivalent to
i = i - (j = j - k);
An assignment operator 'returns' the right-hand side as its value.
j - k is -1. So
i = i - (-1);
or
i = i + 1;
so i = 2.

any one recommend a gnu/linux ide?

I see now. Thanks.

Not dragging, dropping, and creating; but at the very least providing a compiler-like way of adding the files without all the disadvantages that come with a command line tool.

Honestly I'm not sure how much I like the idea of using an IDE if anything far slimmer exists, because I don't see many features that I can imagine ever wanting to use.

For which language?

cpp

I don't know why you would need an IDE for the C Preprocessor.

>compiler-like way of adding the files
What the actual fuck are you talking about?

Do you understand what a compiler is?

Codeblocks is not a compiler.

I thought KDevelop was pretty nice. But a bit awkward to set up a project in.

Can anyone revommend good modern Opengl book/tutorial?

Dude, the more i talk to you the more i think you just need to get over your fear of the command line.

i meant child porn procurement

I don't know if it's actually good, but it's what i used to learn.

opengl-tutorial.org/

Thanks

Alright, well I have no idea what the fuck I'm talking about so I'll just say that want I'm trying to find:
>something that does what some basic command line tools do
>ONLY what the command line tools do
>but it's sort of like an IDE

>non-english flags so you have to go through
>have to constantly retype stuff because you don't have fields

i = i - ( j = j - k )
i = i - (j = 2 - 3)
i = i - (-1)
i = 1 + 1
i = 2

open.gl

You can technically do just about anything with the command line, so something that does "only" what the command line tools do would be a full-featured IDE.

I don't know why you have this arbitrary requirement of having a Not-An-IDE.

Try Visual Studio Code. It's a lightweight text editor with the features you're looking for. (Open source, freedom licensed)

code.visualstudio.com/

Working on a command line utility to download manga because I am weeaboo scum. Doing it with Perl because I am one of The Old Ones.

if i have a file which contains hex values like this 4b03 4b05 4b04 4b00 4b00 4b09 4b01 4b03 4b03 4b05 4b04 4b00 4b00 4b09 4b01 4b03 4b03 4b05 4b04 4b00 4b00 4b09 4b01 4b03 4b03 4b05 4b04 4b00 4b00 4b09 4b01 how can i read, convert, and assign that to a variable in python using numpy?

That actually sounds like a fun project...

can it download loli doujinishi?

Because IDEs introduce additional complexity that cannot be avoided.

As for Visual Studio Code, it doesn't say anything on how the user compiles stuff, and how files are handled, which is my main concern.

Does it create projects? Because that is something that I definitely don't want.

You bet your ass it can

whats your favorite color of panties to wear?

I work with design pattern fags and it's infuriating
>CRUD accounting application
>use MVC it's good
>service that generates reports in PDF format
>yep sounds like a job for MVC
>EDI X12 I/O service
>do you have any time to speak about our lord and savior MVC?

then you ask people to justify that shit and it ends up like the electrolytes scene from Idiocracy. is very much on the money here.

>have to constantly retype stuff
You definitely need to learn you some command line.
Even cmd.exe lets you recall previously typed commands.
Also, command line scripting.
Also also, 'make' and makefiles.

Thoughts on cygwin terminal?

Still not as convenient as fields.

Yeah, but you have bigger problems than a little inconvenience, right now.

>I want a (possibly hypothetical) X
>tell me to use Y, for no other reason than that it builds character
If the problem is that X doesn't exist, then that and only that is a valid reason to use command line tools instead.

What do you think a project is?

What you want is not what you need.

I can't say for sure that what you want doesn't exist, but it should be pretty obvious by now that now one here knows of it if it does.

But your requirements list is so ridiculously narrow and contradictory that you won't be happy until you writ it yourself. In the mean time, command line tools is the closest thing to what you say you want.

I'm trying to help you to help yourself.

nothing wrong with IDEs as long as you stay away from cancer like gradle

Wasn't this about getting GLAD to compile?

I just want to move away from feature-heavy IDEs, stopping as short of command line tools as is possible.

Rearranging the files of a project and adding new files to fit the liking of the IDE.

>I dont want IDE its bloat
>I dont want command line, not enough bloat
>i want something in between
>use text editor, its not IDE

wew lad

this This is exactly what you sound like to everyone else.

>stopping as short of command line tools as is possible.
As i said, what you want is not what you need. But fuck it. If you won't eat your veggies, then that's not my problem. I'm not your dad.

>Rearranging the files of a project and adding new files to fit the liking of the IDE.
Um, no IDE does this?
Also, that recursive definition.

zero cost abstractions goyim :^)
yes yes build your software out of a pile of half broken shit piled on top of more broken shit. this how software development is SUPPOSED to be.
n-n-no stop programming your own, uh reinventing the wheel uh uh never worked on enterprisetm softare -- fizzbuzz loser uh uh uh BAD GOY. now use this fucking library

What?

Text editors don't help you compile though.
Not that I wouldn't use a text editor, I just want a compiler with just the right amount of bloat.

How do I avoid gradle-cancer when developing native Android?

So is your point is that what I want is a bad thing, or I simply don't need it?
Because of course I don't need it, but it would be useful.

the constant slog of everything breaking, the endless frustration of nothing working how it should, the daisy chain of rube-goldberg machines designed by special ed students -- THIS IS PROGRESS.
you're not making a python angular agile web app with the boost java library? dude, come on it's 2016!!!!

You can use Geany for example to compile your code files with an external compiler without touching the command line yourself.

So, I'd implement MinGW into it and then I could use it as a C compiler able to handle whatever arrangement of files I give it, as long as I have a file which explains how my files are arranged?

No. My point is that you won't to touch the thing you need.

Welcom to humanity.

But there must be a more modern way than doing it the way it was done several decades ago!

This sounds exactly like a makefile. Or any command line script, for that matter.

Alright, does Geany know how to use makefiles?

Yes. It's called an IDE. Modern does not necessarily equate to better.

Use Google. You sound like a 15-year-old.

No idea. Make knows how to use makefiles.

I'm working on an imageboard website in my local language

That's like saying that the only way you can have a motorised bicycle is to have a car.

I mean, the fundamentals are still the same. If you refuse to develop an understanding of the fundamentals, or as you put it "build character", you will just hobble yourself in the long term and keep being an annoyance to people trying to help you.

>dns server
>in javascript

lol k

As it happens, the motorised bicycle is more modern than the car.

The fundamentals don't change by making it not all in command line, you're working with the same stuff but with a different tool.

Which is why I want a motorised bicycle but I'm told to use a regular fucking bicycle
When I honk at a no honking sign I don't want a silly little toot
I want a fucking airhorn

...

Emacs

you want emacs

This. If you're retarded enough to want to a GUI then you fucking deserve all the shit you get.

Also fuck off I am not helping any of you faggots.

numbers = None
with open('input.txt') as f:
numbers = [int(num) for num in f.read().split(' ')]


??

Name one disadvantage to a GUI.

>This. If you're retarded enough to want to a GUI then you fucking deserve all the shit you get.
>Notepad++
lol

much harder and inefficient to navigate

>he prefers navigating one gigantic column of obfuscated text

emacs is a GUI, just don't run it in a terminal

I prefer efficient keyboard driven navigation. Now that's irrelevant to the topic but jesus how mad I was when I was doing AD in networking that's beyond comprehension - you have to navigate through at least a dozen of dialogues to get anywhere.

Understanding of the fundamentals change depending on the tool. Our language affects the way we think.

You need to learn to cycle and work on a normal bike before i trust you on an e-bike. Alternatively, do what americans do, ignore bikes completely and get a drivers license.

Sub-sub-sub-sub-sub-sub-sub-menus

At first I thought you were memeing me because I thought you meant Educational Macs.

And if I understand the fundamentals in way that is correct with my given GUI, then that's fine.

Keyboard driven navigation becomes efficient when you've built the neural pathways to have easy access to the commands you need.
Keyboard driven navigation is extremely inefficient otherwise.

Which is why I don't want to learn OpenGL on fucking command line.

Yeah, but your given GUI happens to be CodeBlocks, and you clearly don't.

"my given GUI" was bad wording.
"my hypothetical GUI" is better.
CodeBlocks is a mess, you have to modify project files manually which is really tedious copy-pasting of directories.

Argh! Stop confusing the issues.
You're not learning OpenGL on a command line. You're learning basic code compiling on a command line. You've tried it with the GUI, and it didn't work for you. Now do it properly before moving on up to GUIs again.

>implying IDE compiling and GUI compiling are one and the same
My problem with IDE compiling was the way that the IDE fucked with the file structure.

True but the more you use the keyboard the better you get at it - and in the end, you'll become much more efficient so it pays off.

It's often hard to automate things

Any general purpose hypothetical GUI, ie. one you don't design yourself, is clearly going to be either too confusing or too restrictive for your purpose.
One you design yourself is just going to be a shell for the command line tools anyway.

Alright, that's a good point, but it only matters if you're a wizard.

And that's exactly what I'm looking for, a shell for the command line tools.

By learning the command line interface you might develop a better insight in to why it did that and what you can do about it.

But you still need to understand the command line tools to be able to set your shell up properly for the thing you're working on, ei. your project.

Is using null pointers in my program considered bad?
I've got a function which returns a cell, given a 2d point. At the moment I plan on making it just return NULL if I pass a point out of bounds, which I plan on using later when I'm wiring up the references to neighboring cells.
epic

get the latest version of eclipse (neon)

eclipse.org/downloads/packages/eclipse-android-developers/neonm6

they've reintroduced android support so you don't have to use android studio

>use X to understand Y because Y resembles what you want, Z
>even though other anons indicate Z exists

Not if I use an already existent shell, which is what I'm looking for.

Seriously, both of you shut up for long enough about "use command line" so that more convenient options can be discussed.

Computer Science course moved onto Java, I'm familiar with programming but not Java - What does Cred Forums recommend book-wise?

Core Java, read the entire first half of the first book and you're probably done with the course.

or i don't know the details exactly, seems eclipse isn't officially supported by google if the announcement from 2015 is still valid, but eclipse does work

>It is possible to use the Android Studio with Gradle to develop NDK projects.[24] Other third-party tools allow integrating the NDK into Eclipse[25] and Visual Studio.[26]

Would anyone be able to help with a C++ assignment.
#include
#include "Inventory.h"

// Allow the compiler to define the remaining
// comparison operators
using namespace std::rel_ops;

/**
*
*/
Inventory::Node::Node()
:data( Item(0, "Air"), 0 )
{
this->next = nullptr;
}

/**
*
*/
Inventory::Node::Node( ItemStack s )
:data(s)
{
this->next = nullptr;
}

/**
*
*/
Inventory::Inventory(){
this->first = nullptr;
this->last = nullptr;
this->slots = 10;
this->occupied = 0;
}

bool Inventory::addItems(ItemStack stack){

Node *new_node = nullptr;

new_node = new Node;


if( this->occupied == 0){
this->first = new_node;
this->last = new_node;
this->occupied++;
return true;
}

if (this->occupied < slots){
Node *it = new Node;
it = this->first;
bool match = false;

while (it != nullptr){
if (stack.getItem().getName() == it->data.getItem().getName()){
it->data.addItems(stack.size());
it = it->next;
}

if(match == false){
(this->last)->next = new_node;
this->last = new_node;
this->occupied++;
}
return true;
}

return false;
}

}
The item stacks are composed of another struct which are items. I keep getting "undefined reference to Itemstack" and "undefined reference to item". I haven't written anything all summer.

thx babes

Project Euler all the way; get better at programming, get better at math.

Do you compile the source units that contain ItemStack and Item definitions?

>/**
*
*/
Die

I didn't write it all. I am just supposed to be finishing some functions to make the adt function.

I was provided a make file that links them all yes.

I've done something stupid and made made a null renderer for Quake 1.

In C++ how can I include an assertion in a constructor?
Say I have a class Vector, and a constructor which looks like this:

Vector(int s) : size{s}, elem{new double[s]} {
//initialization for the vector
}

I want my constructor to reject negative arguments passed to it, can I just insert the assertion at the top of the function?

Quick question;

Let's say I have a method ("method1") that pushes elements onto a stack, but I want this method to ONLY do that, to avoid unnecessary complexity and allow for more modularity in the actual driver.

I want another method ("method2") to be able to use the stack that method1 has created. How can I do that? Would I have to make the stack static? As it is, this is what I have

public void method1(...){

for(...)
stack.push(elem);

}

public void method2(...){

anElem = stack.top;
....
}

I guess I could have method1 return a stack, but the stack won't be used for anything besides these two methods

I forgot to mention, but 1) this is in Java, 2) the stack is declared outside of these methods at the top of the class

Vector(int s) : size{s} {
assert(0

I think you're overthinking this. I don't see a problem.

>int for sizes

wtf spring is SO BAD

how can anyone use java, especially these "design patterns" wtf

I get errors trying to create an element in the second method and define it as the stack.top.

docs.oracle.com/javase/7/docs/api/java/util/Stack.html

Use peek() or pop().

>too stupid for Java

>needing a framework for a framework (spring boot)

It's not like Java makes things easy on the coder.

Student toycoder detected.

spring is so trash they had to make another framework on top of it, really makes you think

I see, the students arrived...
this thread is full of fizzbuzz and Cred Forums

>implying the thread wouldn't be 500% better if it actually did have fizzbuzz-tier programs everywhere

Until now i only programmed in Perl, Java and some Ruby on command line because fuck GUIs.
Now i'm forced to deal with front-end for my college courses. So here's my short question, what is best for Java 8 front-end?
I read about JavaFX, is it good? Are there alternatives? Or do i have to use AWT / Swing?

I couldn't understand shit from createDIBsection, so I copied a code I found while googling, changed it a bit and now I get around 145 FPS at 1920x1080, with every pixel changing at each loop iteration (just simple attribution).
I don't know if I can go faster.

Do you think students should be sequestered into their own thread?
/spg/

what linux text editor should i use if i want something that's not convoluted and just matches parenthesis and brackets and such for writing code?

>blind leading the blind: the general

exactly. but they'd get out of your hair.

JavaFX is fucking dogshit.
You literally cannot run a JavaFX GUI via X11 forwarding.

#include

int main() {
printf("Hello!");
return 0;
}


hello.c:5:20: fatal error: studio.h: No such file or directory
compilation terminated.

fuck this shit i've been stuck with this for fucking hours C is shit im goimg back to python

Loving this meme

So, what would be a better option?

It's fucking stdio.h. No U.

is handmade assembly programs really much faster than c or fortran programs?

hey guys for my intro to algorithmic problem solving we had to come up with a useful piece of software to make by the end of the semester and i decided to make a program that tells if another program will produce a result or if it'll keep going forever. my prof kind of laughed at me but said "ok", what was his problem? is it too trivial? i mean, its a freshman level class

they're probably slower

catb.org/esr/faqs/hacker-howto.html

Python, then C and some Lisp dialect in any order is an old piece of advice that will get you quite far.

If you can't decide which lisp dialect to learn, I'd suggest Clojure since it has a strong core library and it's community isn't fragmented.

if you want to know what problem he had with your idea.
ask him.

gtfo retard.

It seems to be a real issue, in my algorithms course where we use and learn C this was one of the first lessons, no U in stdio.h

i asked him and he called me a retard

because it stands for standard i/o, not studio

Just use swing, awt is obsolete.

>stud i/o
There's a gay joke in there.

isn't it the other way around

I'll play along. Google "the halting problem".

sue him

>sue him
Spot the amerifat.

>imouto just started learning about programming languages at collage
:3

this is legitimately the first time i notice a similiarity between "stdio" and "studio"

>tfw my teacher never told us that stdio stands for standard i/o.
>for years I believed that it was just a faggy way of writing studio

New thread:

But studio makes no sense.

it could have made sense in the head of the creator of C.

Niggr.io