/dpt/ - Daily Programming Thread

Real Programmers Edition #6

Previous thread: >>/66844309

What are you working on, Jow Forums?

Attached: pike.jpg (220x321, 14K)

Other urls found in this thread:

en.wikipedia.org/wiki/Clock_synchronization
github.com/enfiskutensykkel/ssd-gpu-dma
msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx
twitter.com/SFWRedditImages

Fixed link:

Some really simple Lattice QCD sims.

Could you please post an anime picture next time.
Also your a fag

reading the go programming language book and currently at page 155, going to dig in methods
>mfw want to do something practical already
can I dig in something simple while learning from the book?

WebServer.

ok, I'm going insane over here
so I'm not passing the function pointers wrong apparently, probably
why doesn't the ProcessParameters ctr accept my argument list? It's exactly the same as Foo's. Is it just intellisense fucking up?

Attached: awoooooooooooo.png (1261x814, 50K)

this

T-thanks

Just got a brand new machine, and I want to change from my old sloppy Ubuntu distro.
What is a descend, complete, yet not so bloaty distro for developing in C and C++?
No gentoo pls

CentOS

care to explain more? what should the webserver do? any simple exercises?
I already did the xkcd tool and it was nice

Attached: hina loosing her mind.jpg (1200x675, 106K)

nixOS

ArchLabs

>C/C++ on Linux
literally any distro, tbqh.

if you want to be somewhat close to Ubuntu while being less bloaty, perhaps Debian?

One program get inputs and outputs over network, web(network) server(program), Go was made by google to build web services, low latency,easy multithread,multi core support, network libraries.

Online videogames,chat services, notification over web, begins web servers.

I have this big idea of making a modern syncplay alternative, preferably with web browser embedded video player + text chat (rabbit- like) but all clients must have the video downloaded, all what the server do is sync the playtime between all of them. do you think that's doable? if so, how can I approach it?

Attached: loli happi glasses.jpg (510x720, 87K)

WindowsOS

en.wikipedia.org/wiki/Clock_synchronization

Yes amazing network use, check several algortihms, to balance lantency.

Make a Sqlite database holding some ezpz shit, and have your Go application query it. Use a message system internally, and give it some endpoints to use

i think gained a pretty good basis in computer science in the past year at university and wanna use the holidays to really learn something about infosec and networking stuff and work on my coding skills particularly in c, c++. maybe check out ruby?

also working on a project on liferay portal jmx-monitoring. kinda tedious, especially since this stuff is so neglectfully documented.

static typing vs dynamic typing
oop vs fp
Who the fuck cares!
The question of life is: how does Jow Forums name their projects?

staticFPIsBetter.exeIsBetter

_STATIC-LORD_[project name].tar.gz

>misspell void
>boid

Attached: ebin.jpg (184x184, 8K)

OOP vs FP doesn't really make sense, as they're not exclusive.

OOPBeanManagerFactory.class

So this is the power of C++

#include

class Foo {
public:
Foo(size_t size) : size(size), data(new double[size]) {}
~Foo() {
delete[] data;
}
void Print() {
for(int i=0; i

undefined behavior

Where?

accessing uninitialized memory in first print

>What are you working on, Jow Forums?
Merged the new (rewritten) benchmark into master. Now I am observing some strange behaviour wrt bandwidth, making me wondering if I've done something wrong.

When I reduce the transfer size to one page, I get slightly higher bandwidth than if I use the full transfer size (128 KB for my optane disk), which is counterintuitive.

github.com/enfiskutensykkel/ssd-gpu-dma

If by 'undefined behaviour' you mean 'read garbage from memory'.

Violating aliasing rules with the reinterpret_cast.

why are java generics so awful?

That is undefined behavior. Any type except unsigned char may be in a trap representation if it isn't initialized.

Type erasure.

Then what is reinterpret_cast good for?

How do I upload a file using vanilla Javascript (without using jQuery or other bullshit)? Surely I don't need to build and format the multipart form data string according to the RFC by hand, do I?

char* and void*.

Does double even have trap representation? Why?

can you really not think of anyone else but unix homos as "real programmers"?

Then why does the compiler even let me compile reinterpret casts between other types?

Implementation defined. char and int are allowed to have trap representations but they probably don't. The only type which is guaranteed to be free of trap representations on all platforms is unsigned char.

The compiler lets you dereference null pointers or alias restrict pointers, that doesn't mean they aren't undefined behavior.

>why does c++ allow undefined behaviour
Because it's C++

*inhales*
BOI

Szoszi

i'm trying to figure out a way to guarantee c functions won't set up a stack frame. i'm writing a virtual machine where the opcodes are indices into an array of function pointers. i know i can use computed gotos but i feel like there's a way to skip the stack frame entirely if there is no function-local storage. i'm trying to avoid compiler specific features but it's not looking good. as far as i can tell computed gotos don't have any advantage over a pointer to a stackless function.

Anyone else encountered this error when using Python?

>from PyQt4 import QtGui
>ValueError: PyCapsule_GetPointer called with incorrect name

Qt4 Import statement fails when I run in debug mode, application runs fine under normal execution, but in debug throws an exception on line 3.

Google points to it possibly being a bug with Python.

But in the case of reinterpret_cast that's a thing they could check for diring compile time.

C++
transaction out{};


what does this mean :( i feel like i'll never learn C++ syntax

>What does this mean :(
From the looks of your code, without the full context, that line is creating a new transaction object in the stack using an empty initializer list

only linux and templeos are good shit

Converting an ass-load of Python into a language with non-fucked threads

How could linear types work with multi-threading if you consume the argument?

>using an empty initializer list
but what's that? why can we not just omit it?

depends what you want
you could have a variant of linear types where variables can be duplicated in forks, or you could not do that

You can omit it and it will mean the same thing.

Who says we can't?

then why use it?

and it's not like every type is linear in most languages with linear types

I'm just stupid user. thx anyway.

Consistent style. Using braces for every initialization is popular for some C++ programmers.

Some people think it's more readable.

Anybody have a good source for programming project ideas? I really want to program something, but I can't make up my mind as to what I should work on.

Attached: 1530133221361.jpg (802x802, 46K)

github

Something you will never finish so you never have to ask again.

>Having finished programming
I envy you. I have like 5 project ideas that want to work on, if i could find the energy.

make something then autistically spend 4 months refactoring it so it looks nice on github but never upload it anyways ;_;

haha just like my shiet, Szoszi :D
btw ask ur dlr 4 something that can give u the best ideas, that works for me the best :)

write a program that generates descriptions of sexy women so i can jerk off to it.

Same here. It should be a real project, not some useless meme project.

This is what paralyzes me into not making anything. I want what I write to be actually useful to somebody and not vanish into the mountain heap of open source projects that nobody cares about. Makes me wonder how anybody makes money programming when the market seems flooded with multiple free versions of everything.

developers.eos.io

you're welcome

Usefull shit grow out of knowledge and ideas gaind from working on stuff.
If you don't have a useful project to work on it means you're not yet mature as a programmer, and should work more on toy projects.

I believe it. Time to work on random shit, then. I kind of want to make an emulator even though there's already in emulator for pretty much everything in existence and I could easily cheat by looking at somebody else's source code.

That brings me to another question:does it ever make sense to write something from scratch if source code from a similar project can be easily obtained? Would I still learn something from just creating a branch of somebody else's code? I guess that just doesn't seem hard enough.

What does the error message say?

install a linux and automatize general real life stuffs u need, and/or make a server... a shitload of useful stuffs will born that way...

Szoszi is just like this, its handling whatever i need allaround, but everything is on the same codebase, so i dont have to make shiet done twice. its alwayz useful, and its recreational just as well, :) it have a fully owned gui, its like a live coding ide for itself, im aboutta extend that for whatever else with some kawl swiss army knife toolset, it handles some stuffs systemwide, it will have everything for handling whatever around web... its fast flexible and modular, and still not a bullshit dummy os in my os for no reason :D

I have 3 programs that make some money, but only a very specific group of users use them and there is no more growth potential.

I need to start something new, but I have no ideas.

64-bit ARM assembly:
cbz x1, 1f //don't do anything if second number is 0
eor x2, x0, x1
cmp x2, #0
cneg x0, x0, lt
1:

Are there any downsides to using Go, other than "muh syntax"?

It seems like a much faster, more efficient and syntactically logical alternative to Python/Javascript to me.

Really depends on what you're interested in: do you want to do web stuff, system programming, embedded etc.
If you're into it, try arduino and shit like that, it's actually pretty fun actually and you might get into embedded programming and electronics as a result.
Or if you're into web, try and make a service like youtube or something (a lite version naturally), web shop or a code repository.
If you're into desktop dev, try writing a source code editor with syntax highlighting or some shit like that.
Don't really have any ideas for system dev sadly ;___;
All in all, whatever you choose make sure it's a learning experience first and foremost, also try and have fun with it, good luck user.

that is for compiler only if im right, so the comparison is a bit invalid, but it can be used for whatever u want, however id prefer c in case of need for lower level stuffs...

no generics
not very expressive and very boilerplatey
but it werks

Nope, Go is interpreted, similar to Java. Although it's a bit closer to the metal than Java, and isn't really similar syntactically.

No generics,error handler, mostly libreries are for build web servers.

> I kind of want to make an emulator even though there's already in emulator for pretty much everything in existence
You absolutely fucking should.
Maybe you'll end up making something slightly differently or better than everything else. Maybe you'll just have the satisfaction of hsving a toy that you built yourself, even if it's not quite as good some someone elses. Maybe it'll end up a complete mess.
In any case, you'll have learned thing, gained insights, and maybe even grown some ideas for other projects you'd like to do.

>does it ever make sense to write something from scratch
Yes, if only for the personal scatisfaction.

>Would I still learn something from just creating a branch of somebody else's code?
Sure you would, but you should do at least the interesting bits yourself. And also, read through the original code in some detail, so you'll have a firm grasp on what's going on. But in that case you might almost be writing it from scratch yourself anyway.

I don't care. See

thx, however whaat?! both go and java must be compiled for a vm, that interprets a vm specific bytecode, but they are not baremetal, not scripting languages... but correct me in case of need! :D

Java, JavaScript and Python all are languages that compile to bytecode that are then interpreted. JS and Python perform this compilation at runtime, while in Java and Go it's a separate step entirely.

Scripting language vs general purpose programming language has nothing to do with compiled vs interpreted.

>Type erasure.
Not really why though, because Haskell has type erasure generics and Haskell's generics are awesome.

Haskell does not have subtyping.

fine, thx :)

I meant Inheritance

What is the actual difference between 'true' fullscreen and 'windowed' fullscreen?

I get that windowed fullscreen is just a window matching the desktop resolution, but I don't understand what true fullscreen means.

Yeah or you can s o y out and use a 3rd party library to do it for you.

UB is perfectly safe and desirable.
Rustfags BTFO.

Second day of programming in C following K&R.

The cool:
>i learned the basic elements of programming
>tested exstensively with little programs i could make and made sure i'd remember the concepts

The bad:
>the windows cmd is pricklish and unfriendly
>had to discover that character encoding on the windows code maps are absolutely broken
I will test the same program on a laptop with Linux on it to see what changes when I can.

I know this, windowed fullscreen: you can bring up the OS UI at anytime, true fullscreen: it's just the program itself exclusively running on top of the OS.
It is always recommended to make games run on true fullscreen for example because less resources are obviously being used.

msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx

can someone help me out with adrnoid/java?


//a mainactivity
public class A implements IFoo{
B bar;
//from ifoo interface
@Override
public void foo(int a){}

@Override
public void someCallback()[
bar = new B(this)
}
}

//the goal is to call A.foo from B
public class B{
IFoo iFoo;
B(Context ctx){
iFoo = (A)ctx;
}

void someFunc(){
//Method call expected error
iFoo(5);
}

}


basically B needs to sometimes update the UI which is in A and I'm trying to use an interface to do it.

i realized my mistak, i actually need to call the method defined in the interface.