/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

en.wikipedia.org/wiki/Xorshift
en.wikipedia.org/wiki/Compound_interest
twitter.com/AnonBabble

first for blacks are not human

what kind of skirt is best for programming?

...

>Creating threads before the bump limit just so you can post your literal faggotry
Delete this thread and kill yourself

plaid red pleated

A nuclear war is eminent. Your neighbor has a fallout shelter/bunker and he lets you in. Inside the bunker is every programming resource you could imagine, however you have no internet connection. All you have is your laptop and whatever you carry with you. There is enough supplies in the bunker to feed 10 people for 100 hundred years.

What do you program on your laptop?

FizzBuzz

Cool. I would try and program a virtual 3D world of some sort.

Red green tartan kilt.

try to form a super computer to run a simulation to repopulate the earth

>food for 10 people for 100 YEARS
>implying any food would last that long
>implying your bunker is large enough to hold 100 YEARS OF FOOD FOR 1 PERSON TIMES TEN

About to make a perlin noise generator in glorious C and interface it to more glorious scheme.

This is all theoretical user. Besides I'm pretty sure dried food that is vacuum sealed could last pretty long. Alsa maybe there is a greenhouse in the bunker?

You mean create an AI to try and figure out how to go about doing it, the logistics of it all?

>implying any food would last that long
You'd be surprised how long certain canned foods can last. Not to mention alcohol is a reasonable nutrition strategy and lasts forever too. There's a reason why beer is big in Germany with its evil frosty winters.

And the bunker might be the remains of some missile silo the neighbor's house was built on top of. The root poster might be living in a place with tons of silos like the midwest.

None. You should program without any clothes on.

Video games. Something to keep myself and the neighbor entertained.

Honey will last thousands of years.

Dried foods, stored in a cold enough environment, will last a damn long time, although not 100 years.

If you have the materials to grow your own food underground, you could last as long as you can generate electricity for heating lamps and such... presuming the soil doesn't get irradiated, that is.

>and the neighbor entertained.
Uhhh about that... You rape and kill him.

Whoops

Honey
Glucose
The neighbor's children
Pop Tarts

All of these could last 100 years

>Video games
You think you could program a video game like Oblivion by yourself in 100 years? From scratch.

I wonder if you could survive of that and vitamin supplements

...

what the hell is Cbase?

I never said I'd make a game like Oblivion. It'd probably be 2D.

Source? Is it Himegoto?

Why does Xcode take so fucking long to install?

Souce, plox.

sub-species of human

Does anyone have some resources on pseudorandom number generation techniques? I need to write a weird pseudorandom number generator and I can't seem to find what I'm looking for.

en.wikipedia.org/wiki/Xorshift

>a weird pseudorandom number generator
use the digits of pi, you can compute the n-th digit in O(1) time
they seem pretty random to me

This is getting somewhere...

Basically I am looking to deterministically generate a random looking number n from a vector [n1,n2,n3.....nk] in such a way that traveling through that vectorspace is still randomized. I don't need it to be cryptographically secure.

If anyone has some ideas or resources about anything like that, that would be pretty dope.

If I wanted to create a new file in c++ by copying an old file how would I do that.
A getline while loop seems way too slow. There has to be a better way like just setting the files equal to each other.

>write app code in C++
>need to make it callable from Objective-C
>using Objective-C++
iOS is a mess

FILE *in = fopen("input.txt", "rb");
FILE *out = fopen("copy.txt", "rb+");
fseek(in, 0, SEEK_END);
long len = ftell(in);
fseek(in, 0, SEEK_SET);
fwrite(in, len, 1, out);
fclose(in);
fclose(out);

Xorshift is one of the best if not the best not cryptographically secure prngs. It's fast, yet it's also high quality.

>raw pointers
disgusting

So I don't know much about vector spaces, but you could use this as a basis for your prng.

//interest rate calculator using simple interest
#include
using namespace std;

int main()
{
float princ, rate, spent, balance, interest, time;
cout

import math
# Largest Prime Factor
# The Prime Factors of 13195 are 5, 7, 13 and 29.
# What is the largest prime factor of the number 600851475143 ?
factors = []
prime = []
number = 13195
#number = 600851475143

i = 1
j = 0

while i < number:
if number % i == 0 and i !=1:
factors.append(i)
i+=1
print(list)

for j in factors:
for k in range(2, math.sqrt(j)+1):
if j % k != 0 and j not in prime:
prime.append(j)
print(prime)


I can't seem to figure out why this doesn't work, I have a feeling my second loop doesn't even need to be there.

>interest = princ * rate * time;
lel

How would you have done it?

en.wikipedia.org/wiki/Compound_interest

The exercise said use simple interest, but I could do compound or continuous compound.

How would you express the constant 'e' in C++ though?

You're suggesting smart pointers, right?

Don't give a shit about crypographic security.

It's clearer if I post a non-working attempt I think

float rand_3d_determ(unsigned int x, unsigned int y, unsigned int z, unsigned int w) {
y = y

It's 2016, you shouldn't have to juggle pointers.

I'm a dumbass. Should have done F's instead of 1's on those bitmasks. Well it works now.

are there any decent all-purpose IDE's?
having to switch when working with different languages is a pain

>inb4 vi(m)/emacs
i like GUI's thank you very much

>What are you working on, Sup Forums?

Just trying to average these ints over here...

...

I'm not recommending vim. I'm recommending
>vim
>automake
>gdb
>valgrind
>screen
>rlwrap

>running a debugger in cli
noty senpai

so /dpt/ why don't you stream your programming work over twitch.tv? There's so few streams everytime

Why run an IDE when you can cobble together a shit-ton of nonsense?

I don't like making software, I like making complex processes.

Say what you will about gdb but
>hating on valgrind

twitch.tv is video games only you get banned for non-video games

valgrind, automake, rlwrap, and screen are braindead easy to use. that leaves vim and gdb.

Nobody ever said anything about 'easy' or 'hard'. What is it with Sup Forums? Anytime someone criticizes a choice, Sup Forums comes back with some shit response that tries to imply that the other said it was too hard.

>twitch.tv is video games only you get banned for non-video games

uhh..?
twitch.tv directory/game/Programming

>shit-ton of nonsense
>complex processes
>i wasn't saying it was hard or anything

Jetbrains, Atom, VS, NetBeans

But you're still recommending vim so your opinions are invalid

Enjoy your placebo editor. The greatest programmers in the world use emacs, acme, and IDEs because they are intelligent enough to see beyond themselves and understand that they are not actually more efficient when actually programming with a modal editor.

FACT: 99% of "efficient" vim users just re-arrange config files all day
Vim is a great text editor but a disappointing program creator

>sees the word complex
>thinks it means hard
>doesn't consider fragility
>doesn't consider time spent on configuration
>doesn't consider long-term engineering costs

Fucking idiot.

>directory/game/Programming
>game

>twitch.tv is video games only
/directory/game/Programming

GET REKT! *Blows Airhorn*

You can stream your codeing on twitch and have bots spam your empty chat with links to other streamers and websites where you can talk to hot grills. Kappa

games and programming then

The fact that there's "game" in its url doesn't mean you can't stream non-games programming. Is there a rule? Because I see a lot of streams not related to games (like people programming twitch bots).

...

>implying half those things need configuration
>implying all of those things need regular configuration
>implying hard can't be a synonym for laborious

Did you just say emacs users spend less time than vim users editing config files and more time programming?

Top kek. You clearly don't know about emacs.

Nobody will watch you stream tho.
How many people do you think venture below the fold of twitch's homepage?
How many do you think actually click past the first page?
Nobody.
How many would want to watch you write code?
zero.

hey /dpt/

Can somone show me a great recourse for learning C/C++? I am familiar with Python thus know how languages work and such but just a nice place to get started

Except that's not true. If you are good and do interesting stuff, you'll get viewers. See people like Casey Muratori.

Programming your text editor in a desperate bid to make it as good as a real IDE is still programming.

Since vimfags don't use lisp, they can only ever script.

The C++ Programing language

>How many would want to watch you write code?
>zero.

>You can stream your codeing on twitch and have bots spam your empty chat with links to other streamers and websites where you can talk to hot grills.

PREEMPTIVELY REKT

BRUTAL

SAVAGE

*airhorn*

Does he constantly commentate what he's doing?
that's probably why.
nobody watches streams for the video games, they're there for the personality

>I am familiar with Python thus know how languages work

;^)

This is literally all you need. (Besides G++)
www.cplusplus.com/doc/tutorial/

I don't need vim to be an IDE when I have a terminal mutexer though foolish emacser. All I need it to be is a text editor.

Meanwhile emacsers try to make emacs their IDE, email client, web browser, version control system, text editor, and end up having to configure EVIL mode anyway.

>mutexer
uh

On my will

terminal multiplexer*

i'm learning opengl, but slowly, because this superbible book is shit and every online tutorial is even worse

also why is that boy wearing a dress?

I don't even use emacs. I use acme. And you're full of shit. I've never seen a real emacs user doing real work use more extra shit than gdb, shell, and slime.

>terminal emulator multiplexing
>not using the display system
Harmful, and also bloat. That's way too many layers of abstraction. What's the point of making fun of emacs users when you have to deal with a similar clusterfuck that's just split into different programs?

And why aren't you at least using neovim?

>this superbible book is shit
Why did you write the word shit twice?

RTFM read the manual, wiki and the spec, don't read tutorials they're fucking shit

should I read the red book then?
because it looks like a reference text more than anything else

consider my fedora tipped

i haven't read it but it's probably fine, just get a recent edition with modern opengl stuff not just the deprecated fixed function pipeline stuff

...

goodnight australia have fun with acme
also i recommend upgrading to a computer that can handle screen its a little strange yours cant

please don't post regressive left propaganda thanks

>Making your own game engine
>Not using one of the millions that already exist.
Why?

Probably because he just want to _learn_ and not make actual games?

kys

I'm trying to build an iOS app with Xamarin, but when I go to launch the iPhone Simulator it just gets stuck on launching forever.

>Launching app on 'iPhone 6s Plus iOS 9.3'...

I'm using Visual Studio and SSHing into a Mac with all the right stuff installed.

Spending hours _learning_ how to do something he will never need to know or find useful is just... oh wait I'm talking to an Arch user.

kill
your
self

>obtaining knowledge is bad
why am i not surprised it comes from a worthless weeb

kill
you're
self

fuck off to if you want to make shitty shit games using someone else's shitty shit engine

...