/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: Brauer.jpg (350x499, 32K)

Other urls found in this thread:

docs.oracle.com/javase/tutorial/
stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
en.wikipedia.org/wiki/Information_hiding
godbolt.org/g/RbjR5m
developer.apple.com/documentation/metal
gigamonkeys.com/book/
twitter.com/NSFWRedditVideo

I have a long python numpy script for some numerical simulation. nothing vectorized because it's just a proof of concept for a later C implementation
Pretty CS grad meme trier but anyway.
What's some good practice for this kind of simulation?

Thank you for posting an OOP picture.

You can write perfect, idiomatic C++ using only c-style structs. Read From "Mathematics to Generic Programming" to see the beauty of the (best subset of the) language and where it's headed. The syntax may look ugly at times, but so will a research paper to the uninitiated. Java style classes in C++ is a red flag that the author does not understand the language.

guess I'll post again
How do I contribute to to FOSS projects when I'm not very good at programming?

I know basic concepts, I've taken a college course on >>>""""VB.net"""", and I'm taking a java course next semester.
However I actually need something to work on to get better, right?

But I don't want to commit garbage code that no one asked for to a project

OOP in loo

Attached: (You).png (521x520, 403K)

What could cause a properly created and relocated RMI registry started via code with locateregistry.createregistry to not export the server's classes, giving random class not found exceptions on connecting clients?
Keep in mind this only happens at some boots and not others and I can't reliably reproduce it.

contribute to a repo of a friend who is willing to help you if possible
it will help you get over the anxiety

first, go look for some project with pretty small and/or easy to understand code
install it and start using it, maybe you'll find something (small) missing
if that's the case, fix/add it and contribute your fix
otherwise go look in the issues tab on github or whatever site you're on and fix those issues
starting out with contributing can be hard but slowly you'll get used to the codebase of the project and fixing things will get easier on the way

Anyone have any experience with Metal? If I have a mac should I learn this or OpenGL?

Attached: metal.png (678x256, 18K)

Metal obviously.
You do want to make games and sell to become rich, are not you. So why waste time in OpenGL.
For Windows, do DX12.
OpenGL is meme now.
Vulkan will become OpenGl in time.

OpenGL is the best GPU API to learn because webGL, OpenGL ES and OpenGL all use the same basic API calls

If your mac can't run OpenGL, consider doing your project in WebGL. It is actually quite powerful.

I'd use Vulkan. This ties to Apple technologies so no one will use it, and it will be an unmarketable skill.

Attribute parser for an html like language.

t.academic beta cuck professor.

Im working on this Student Information System using VB.net, and I dont kmow what to do I want to die for being noob

How realistic would be a project to use computer vision to unblur mosaic in videos?
Let's say there are some censored videos I would like to uncensor for practical purposes :^) 8==D--

The intuition is that since there are a lot of "different" mosaics for the same object, something like least squares could give an accurate approximation.
On the other hand, the object is not still (rather periodic instead lmao) so it's challenging.

an RMI reg that hasn't been properly shut down maybe?

I was thinking the same thing, but the life cycle for an RMI reg which is created inside code should end when the JVM dies, and I do execute a System.exit() at the end of my server's lifecycle.

good post

>This ties to Apple technologies so no one will use it, and it will be an unmarketable skill.
wat is iOS dev

If your looking to make games for consoles or high-end PC titles which take several years to make, I wouldn't bother with OpenGL. Metal or Vulkan or all the way on those platforms.

If your doing stuff in-browser, learn WebGL. For phones and other mobile devices, you've got OpenGL ES, Metal, or Vulkan.

Once you transcend to graphics programmer, you won't care which API is the best. They're all shit trade-offs.

I guess this is a pretty silly question, but I'm having some trouble with Prolog.
countAux(_, [], 0).
countAux(D, [H|T], N) :-
D >= H,
DR is D - H,
countAux(DR, T, N1),
N is N1+1.

I'm trying to count the number of times (N) that I'll be able do subtract D from the elements of the list while D is greater the element H of the list.
For example, let's say I have countAux(300, [100, 190, 220], N).
N is supposed to be 2, because 300 - 100 = 200 and then 200 - 190 = 10, but 10 - 220 is less than zero so it should stop here.
The problem is that the code above is just returning "true" or "false" instead of the value of N.

Why does GNU code use so many more macros than most C code bases?

When I look at things like glibc it's like I have to dig through five layers of macros sandwiched between each bit of actual code.

Their minds are plagued by Lisp.

M A X I M U M P O R T A B I L I T Y
but also because GNU people are autistic

A-at least it's not C++

kys retard
C++ classes are a zero-cost abstraction. they're just a struct with extended functionality like non-trivial constructors, member functions and private fields. a class could be as little as a type-safe wrapper around a bitflag/mask or a wrapper around an index into a private lookup table. separate the implementation from the interface, fucking Ctard.

Starting from scratch as far as learning, work with C or Java as my starting language? And what resources should I utilize? I've been using Cave of Programming with success.

>anti-OOP tards are useless weebs
Why am I not surprised?

Attached: 8ccf1b75283ed4b73687c35f74f065ce_w640_h360_cp_sc.jpg (640x360, 55K)

java definitely. maybe C++, but not C. C is for stupid ass dinosaurs and sperglords.

docs.oracle.com/javase/tutorial/
stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

>they're just a struct with extended functionality like non-trivial constructors, member functions and privaconstructo
rs
And none of those are good

Attached: 1483528151331.gif (512x288, 2.85M)

Constructors are shit
Member functions suck
Private member's are useless without the above

Prove any of this wrong

Do we have source code for C++ I would like to inspect myself.

en.wikipedia.org/wiki/Information_hiding

i'd recommend OpenGL or Vulkan since they work on the most platforms (including yours). DirectX won't work on a Mac unless you dual boot with Windows or run a probably wonky Wine version of it or something. but for the love of god, anything but Metal. it's similar to Vulkan in design but has the major downside of only working on Apple shit. you do *not* wanna limit your job options to that sector, my dude. every programmer i know who's had to work on iOS shit for their job has fucking hated it. you'll end up working on the hundred thousandth "clash of cunts" shovelware shitpile until you wanna blow your brains out

godbolt.org/g/RbjR5m

On terminal
when command chaining
(comand1 && command2) ----> exit code?
(comand1 || command2) ----> exit code?
(comand1 ; command2) ----> exit code?

how does exit codes here work?

if I run (comand1 && command2)
comand1 returns 0 which means OK but in general "logic" terms 0 means "false" and
"A&&B" means that if A=false then B will never run? but it does run if you run it in the terminal? so WTF?

you finally discovered how trash exit codes, and error codes are in general, gz.

so how do they work, what key word can I search on google?

>implementation from the interface, fucking Ctard.
C++ encourages putting implementation in header files, and using C doesn't mean not separating implementation and interface.

Attached: 1460647393269.jpg (793x494, 49K)

then you're just using each source+header combo as a clunky way to emulate classes. you can put a class straight into a source file and have it be encapsulated from the rest of the source file as in .

writing some garbage ass c# api for uni that's supposed to compute proffitability on current data, every question I google has 10 different answers and I have no idea which one is the correct one from a perspective of not fucking me over later on

Yes, I can, but I prefer not to. Your point was separation, not separation that matches your specific taste.
Or define clunky, and prove that the C method results in clunkiness.

Attached: 1462215738154.jpg (1300x1734, 255K)

Welcome to software development. Enjoy your stay.

Attached: 1477352101072.jpg (768x768, 143K)

struct Ass;
void shitAss(Ass);
nice, you just polluted the global namespace with Ass and shitAss

Well, yeah, except no competent developer would forget to write static at the start of those lines, if they did not want them to be seen outside of the translation unit.
You know what static means in C, right?

Attached: 1424907070422.png (808x343, 201K)

>api
Literally the easiest thing to build in any language and they gave you fucking C# which is the second easiest after python to build this stuff.
Show example question you brainlet

that: would be in a header retard
inside the translation unit you would not have any encapsulation, you would have access to all the struct's fields and supporting functions and data structures

Oh. Should have mentioned that.
I just do:
[Filename]_Ass;
and
void [Filename]_shitAss(Ass);

Since most of my files only export one or two functions and structs, it is no big deal. Plus, why would I have files with identical filenames?

>inside the translation unit you would not have any encapsulation
That is right. It was implied that the encapsulation is between files.

Attached: 1444218645703.gif (256x195, 2.99M)

Easiest way for me is to test. $? is the last exit code. true is an executable that always exits with 0. false is an executable that aways exits with 1.
$ true && true; echo $?
0
$ true && false; echo $?
1
$ false && true; echo $?
1
$ false && false; echo $?
1
$ false || true; echo $?
0
$ false || false; echo $?
1
$ true || true; echo $?
0
$ true || false; echo $?
0

Use another API level or unreal/unity engine if not
developer.apple.com/documentation/metal

Maybe take some book OpenGL explain computer graphics.

OOP is fucking retarded
books about programming are too
programming is just typing who needs a book to do it

>cluttering your dependency graph with a bazillion little files just to get some semblance of encapsulation
and that's why every freetard C project is a shitshow

"polluted" lol u mean populated

If I learn lisp real good will that make me a better C++ programmer, if I focus on only using the modern C++ features for metaprogramming and pseudo functional shit?

Or is it true what they say, that lisp is the ultimate and no other language will ever compare....

You need to understand algorithms and abstract ways of dealing with problems(books are better than wiki in this regard) so that you can solve any future problem using your brain and not google.
It doesn't matter if you are just writing fizzbuzz though

no, polluted. you shouldn't need to risk shadowing something important or having globals fuck up your auto-suggestions.

Nice meme

That is strange, because in my experience, the corporate software bases are the ones with too many files for base classes, inherited classes, class factories, that have a minimal amount of code, and are essentially boilerplate.
All my C files are 500 < lines, with the headers being relatively small.
Although, obviously, the final file and line count depend on complexity, and number of features.

Attached: 1458500188258.jpg (255x197, 11K)

Oh
command1;command2;

Always gives the exit code of command2. A semicolon is a newline equivalent most of the time.

turn off auto suggestions so that when u do a = b u dont press enter and have it turn to banana
because every fucking ide is retarded enough to do that

Y-you too?

it can be useful to activate it manually like if you actually want banana you type ban and press auto complete.

gigamonkeys.com/book/

google works better than books and books are harder to download
real books dont have ctrl f to find what you are actually looking
ppl shouldnt be re-problem-solving the [wheel]

it usually OVERRIDES UP AND DOWN KEYS TOO. FUCKING HOW CAN THEY NOT SEE THE PROBLEM WITH THIS IT MAKES ME SO CONFUSED AND ANGRY.
a = b
ENTER
a = BANANA
FUCK
a = b
*press down*
*SCROLLS AUTOCOMPLETE LIST!!!!!!!*

Shut up rajesh aka Pro SO-copy-poo-er.
I am glad you are just a retarded college student who is soon to be a NEET

i will just do whatever works to complete a project. fuck you and your rules.

but usually everyone else's code is complete shit and needlessly overcomplicated so i have to write my own

It couldn't be you are the poo java "programmer" who went to a python job interview, right?

*has performance issues because he didn't bother thinking about what algorithms he's using*

>in general "logic" terms 0 means "false"
According to shell conventions 0 means success. 1-255 means failure. Ideally that exit code tells what kind of failure but as far as && and || are concerned 1-255 are handled identically.

If $? is 0 when a && comes up then the next command is executed. So

date && command_with_long_runtime

doesn't bother executing the second command if date somehow fucks up. The opposite is true for || so

[ "$number_of_eggs" -eq '12' ] || handle_error;
only runs handle_error if there's an error.

python is slow.
java is object disoriented.
theres no good language.

actually all my code is fast and efficient but im bad at memeory i'd rather use loads of memory than have a slow program.
giant lookup tables.

A good language is the one you can use to solve problems without having to google an answer.
Surprising.. I know!

*doesn't care because normies will make him rich anyway.

lol but thats every language
it needs to be very fast and not verbose

New to programming and I had a question about Java. In a package, could I initialize a class in one class, then in another, refer back to that class where I actually run the application? So initializing the Lizard class in one class, then in another class within the package, calling on that class for the actual application? Or does the application and class need to be in the same?

dont use java unless ur being forced to use it by ur skool

this desu, java is slow and outdated

have you tried watching wholesome american-made porn instead?

Not sure where else to start as far as learning goes, someone else asked earlier and recommended it.

>lol but that is every language
Ding ding ding we have winner! Any PL you master is a good PL. Sometimes you have to master two or many but that is another issue (best tool for the job).
Your second sentence is subjective.

>i'd rather use loads of memory

Fucking knew it.

you'm dumb
performance is more important than memory usage imo
inb4 >"you'm"

If C niggas want encapsulation they use a forward declared structure

Even better, you get a stable ABI for free

C++ classes a shit

encapsulation is pointless, why hide data from urself?

yes you can have different classes and use them in different files

I never understood this too. Maybe when writing libraries perhaps?

>why set it up in beforehand so you have a button to launch nukes when you could build the warhead and the missile from scratch every time you want to launch a nuke

i hate it when i have to modify other people's libraries because i want to change their hidden spooky values.

{do {{i 1 {+ i 1}}}
{{> i 100}}
{display
{cond {{= 0 {modulo i 15}} "FizzBuzz"}
{{= 0 {modulo i 3}} "Fizz"}
{{= 0 {modulo i 5}} "Buzz"}
{else i}}}
{newline}}


this is now a curlybraces thread!

Wrong
C++ only encourages implementing functions that use a trivial amount of memory in header files. Header file implementations called in-line while other methods are referenced.

get and set functions are bad if u do them u will go to jail

Who is this? Kotlel?

>memory usage isn't a component of performance

Jesus the memes are real.

Attached: 1523820329578.png (800x600, 171K)

the exact memory usage literally doesn't matter as long as it's within some reasonable upper bound for your application

duude electron lmao