/dpt/ - Daily Programming Thread

Old thread: What are you working on, Cred Forums?

Other urls found in this thread:

arxiv.org/abs/1609.04802
developingthefuture.net/disassembling-decompiling-and-modifying-executables/
robmiles.com/c-yellow-book/
youtube.com/watch?v=CNfazhgSwYM
github.com/normiesgetout/CTRbot
github.com/BobbyRaduloff/GameOfLifeC
github.com/TercioOfParma/Comp4Project
hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf
en.wikipedia.org/wiki/Shimoneta
sites.google.com/site/prologsite/prolog-problems
better-dpt-roll.github.io
arstechnica.com/biology/2016/07/japanese-animation-effects-on-brain-development-new-findings
stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118
pastebin.com/av3fXTER
cs.bham.ac.uk/~mdr/teaching/modules04/java2/TilesSolvability.html)
hackage.haskell.org/package/mtl
hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Maybe.html
gustedt.wordpress.com/2016/08/17/effective-types-and-aliasing/
twitter.com/AnonBabble

First for C.

why is programming so boring?
the only fun parts is designing a solution to a problem.

first for C++14, the best general-purpose programming language.

I want a Visual Studio extension to monitor my coding style.

StyleCop seems to have silly things (it wants you to specific "this"), while ReSharper is massively overdesigned and invasive for my needs.

Any tips?

First for QT Creator and WAMP cultism.

>want a way of printing error messages in C
>everywhere says "printf(message)"
>error: printf was not declared in this scope
what

#include
?

>tfw finally submitted to the Google botnet.

#include

>using visual studio

Did you include the stdio library?

Is C++ a good way to learn programming? I'm serious.

My background is chemistry and I just want to get into programming as a hobby.

Thanks.

CodeBlocks actually.

Now I have and it doesn't complain.

did you include stdio.h ?

(not checked)
>stdio library
>library

arxiv.org/abs/1609.04802

New image super-resolution technique for keeping outputs on the manifold of natural images. This looks like it could beat out waifu2x if trained on anime screenshots.

Of course not.
C++ not difficult, but very big, and slower than C.
So, learn C. C much simpler, easy to learn and you can read a lot of code written in C, you can join FSF, you can contribute to many interesting projects. And of course use Free Software, I reccomend Gentoo GNU/Linux. Learn how to program on Windows much more difficult.

include stdio

Thank you for help Punjab.

Would really appreciate it if someone could help me or point me torwards the right direction

>suggested I use GLEW rather than GLAD to access OpenGL
>can't find anything like the GLEW equivalent of pic related, it's just checking if OpenGL features exist and checking version numbers
wat

If you're new to programming, you'll probably want to jump straight into making functions.
If you go with a C language, you'll likely end up with a lot more setup before you can start to build programs.

BlueJ with Java is great if you're just learning, since you can start making functions straight away. It's even so nice as to lay out a basic template for you when you create a new class in your program.

C++ is old technology,
you can use wix or wordpress if you're edgy to code any kind of apps.

>point me torwards the right direction
Just follow the meme arrows.

But vs is the bes tide for c+ +programming.

I would recommend the hacker known as Cred Forums.
legend says you can find him circlejerking in the /h/ futa and scat general board at midnight PST

developingthefuture.net/disassembling-decompiling-and-modifying-executables/
This appears to be the sort of tutorial you're looking for.
It runs you through an example scenario of cracking a program.

I'm retarded. I meant C#... it gives you an idea how new I am.

As if I wouldn't already spend my whole night in futa and scat threads on /d/ and gurochan

Cred Forums? is that you?
i look up to your 1337 h4x1n6 skills

That's a hell of a typo.

Yes, C# is a fantastic language to learn on.

Here's a free book that explains programming before you actually start writing code (link to PDF on page):
robmiles.com/c-yellow-book/

desu that's what you do most of the time that you're making software. actually typing the code is like 30%

youtube.com/watch?v=CNfazhgSwYM
This video is how I view the GitHub and Python programming communities.

>he doesn't implement fizzbuzz on meme languages for a living

>while ReSharper is massively overdesigned and invasive for my needs.

You can customize ReSharper so that you're only using certain features of it. Fwiw, I love most jetbrains products (IntelliJ & CLion), but I prefer to use VS out of the box (with a few small plugins).

what do you guys think of golang?

I made a Cred Forums shitposting bot last night and it's pretty fucking messy. It compiles to 8mb. That's a fucking sin.

github.com/normiesgetout/CTRbot

stdio is a library idiot

Real high-level discussions you guys have here.

>literally woke her up, inside

So, I don't suppose anyone here actually knows what GLEW does?

pic related

int ret;
ret = do1();
if (ret) return errno;
ret = do2();
if (ret) return errno;
ret = do3();
if (ret) return errno;
ret = do4();
if (ret) return errno;
ret = do5();
if (ret) return errno;
ret = do6();
if (ret) return errno;

Hey I have a console game that I'm writing in c#. Right now I have Screens that print and process input so like, main menu is a Screen, and battle is a screen.

the process input method takes a string, which is readline from the main loop and runs it through two sets of switch statements. The first switch checks what the screen state is, so like the battle screen could have character 1 view, where the switch statement would direct it so the print and processinput methods would match to the correct screen state. It then processes input and runs the methods.

I want to store the screen info externally though and have a single generic static screen that gets operated on in the game loop. Whats a good way of processing input for this? How do I direct stuff so that for example a character uses the correct attack, with the correct equipment, against the correct creature, all using a generic class thats just pulling data from text files?

>It compiles to 8mb.
The fuck?

I'm writing a C# ETL tool that's about 3,000 LoC at this point with lots of 3rd-party embedded assemblies and it's at 3MB.

What does Go automatically embed in the output that's so fat?

It seems like every fucking job in my area wants a ".NET/C# master" all of a sudden, so give me suggestions on learning materials my dudes.

see
MSDN has great beginner guides, too.

Static linking + garbage collection meme

Is your programming language programmable?

All programming languages are programmable.

>best
>general purpose
>language
this is bait

stupid moonposter, go back to Cred Forums

moonmanposter*

>I made a Cred Forums shitposting bot last night and it's pretty fucking messy.

Aside from some deep nesting, it looks alright to me. The whole 8mb executable, though, that's unforgivable.

What exactly is being statically linked?

All of Go?

there are no men on Cred Forums, just a lot of kids

int ret = 0;
for (size_t i = 0; i < 6; ++i)
if (ret = fs[i]()) return errno;

>how do i google

He is posting moonman, not moon.

moonposters are on /jp/ and Cred Forums.

>literally cant include the FIRST FUCKING HEADER ANYONE LEARNS TO INCLUDE

I wish for loops worked, user.

if(do1() || do2() || do3() ... ) return errno;

Are you retarded, or what shitty language are you using?

I'm using C. You can't use for loops if each function takes different arguments.

Okay, that might work.

So now that Java is Carmack-approved (a guy that knows more about programming than all of you put together) when will you start learning Java, Cred Forums? I think I'm going to install Android Studio and finally learn about mobile apps development.

Can't you define an array of booleans in C as results of functions? Then you'd just check if any of a value is present.

Not C, but like this:
var checks = new bool[]
{
ReturnFalse(),
ReturnFalse1(),
ReturnFalse2(),
ReturnTrue()
};

if (checks.Any(x => true)) return errno;

OH MY GOD! JAVA HATERS ON SUICIDE WAtCH! JAVA-HATERS LITERALLY BTFO BY CARMACK!

will they ever recover?

The thing is java is ok language. It has "lots of libraries" but every fucking time you try to do something all the good libraries are for c++ and java might have library for "that" but it's not maintained anymore and fucking sucks.

>Android Studio and finally learn about mobile apps development.
Why not try to do cross platform "apps" instead of locking yourself to the most retarded one? You can do it in java too...

I have design problem.

So I'm working on toy game engine. I have few instances and variables which are used by all classes, like texture manager, SDL_Surface, SDL_Renderer... etc, Currently im passing them around in constructors but its getting ridicolous.
Every time i want to create ingame object like player i have to call this monstrosity:
Object(TextureManager* tm, Animator* anim, SDL_Renderer* renderer, const std::string& textureName);


Where first 3 arguments only initialized once at start but i need to have reference to them...

How do i simplify this hell.

thats why html is the superior programming language.

you can type html -> tab and it prints out all the headers for you.

>The thing is java is ok language

java is babies first languages
who doesn't know java?

>java is babies first languages
>who doesn't know java?
Java is an abomination and if you fully learned it as your first language then you are cursed to poor programming practice

Are you saying you know more than Carmack? Post your code so we can see what authority you have to criticize Carmack opinions.

Learning Java at college or with a tutorial to do a couple of toy projects is not really knowing Java (or any other language).

it's not, ever since C++11 this language became really fucking good.

Just started with SDL. Am I doing it right?
github.com/BobbyRaduloff/GameOfLifeC

that would call all the functions instead of doing an early return

>it's not, ever since C++11 this language became really fucking good.
no, it went from being shit to being mostly shit with some half assed implementations of good ideas

what programiung langueage should i learn first?

>implying
nice meme retard

not Java and not Python

COBOL

It works just fine it seems, but i'm not too keen on your style. That's subjective though.

I wrote a much larger SDL project a few months ago if you want a look. It's far from perfect though.


github.com/TercioOfParma/Comp4Project

java

NOT python

NOT haskell

What can I use in C++ to achieve a VLA inside of an union?

True, it's the pattern I use when I specifically want to avoid short-circuting, but I suppose the OP doesn't need that.

It's a tradeoff between data and speed.

Sometimes if an item fails a check like that, you also want to know what other tests it might fail for analytics purposes.

i am learning this book hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf
is this good

Statically instance a class containing your manager classes then make a getpointer or you can use a pointer buffer. I know GLFW has it idk if SDL does

have you really used it for an extensive amount of time since '11? be honest now.

Style like my code?
I'll check out what you've done, though. Looks interesting

it's fine

Yeah, some of the things like placement of curly braces and a few non descriptive variable names.

i've used it a fair amount from 2014 ish

Java is just a language, you're not considered a good programmer if you know the entire Java framework by heart.

There are these things called problem solving and critical thinking skills.

Just looked at your thing. Holy shit man, these are the most aesthetically beautiful source files I've ever laid my hands on!

Was just about to compile it aaaaand windows.h ;-;

Thats great idea!
SDL or whatever doesnt matter, most of hell i have to pass around is of my own making. Thank you!

java has lambda expressions now

Give me reason to learn Go.

Didn't stop me from getting a D in it somehow, in spite of writing a 300 page report on its development.

its super simple, takes 20 min to learn and can be used as less annoying version of python.

Make a struct that contains all the arguments for all functions and then pass it to the functions? Each function uses only the members they need, leaving the others alone.

Messy, but it's just one struct.

hasn't it had them for a few years?

Remove the lines relating to moving the console in main.c and then remove the windows.h stuff and linking and it should work

What are you using for creating levels?

There's no reason to use Go.

So I've started and stopped learning programming many times over. I understand the basics and feel I'm pretty handy with C (not perfect, but can get quite far).

My OO is pretty shitty though. I want to learn iOS/Android app development. I've followed tutorials and guides and started them many times but lose focus after a few weeks.

What do?

In glfw it's called a user pointer. It's globally available it just needs to be casted from void.

>300 page report

probably because no one wanted to read a 300 page report

We had to write that, mine did have the highest word count in the class by about 4 thousand words though (not really saying much when most people were around 35k).

I'd like to document my code in such a way that a non-programmer could understand what it's doing.

Are there any graphic tools to accomplish this?

I'm almost thinking a programming-specific Visio or Draw.io, but not for class-diagram.

No. You don't have to know it "by heart", but you should be very familiar with the fundamental libraries. A programmer that reinvents the wheel because he doesn't know some built-in function does already what he wants or that needs to google how to do *everything* is an unproductive programmer.

Please tell me that there's a better way than this:
std::size_t longSize = sizeof(long);
union {
long value;
char bytes32[4];
char bytes64[8];
} block;

To get this in C++:
std::size_t longSize = sizeof(long);
union {
long value;
char bytes[longSize];
} block;

you can always use google, if you're familiar with programming in general you would know what to search for and get on with your day.

Well I will go with java then.

most people don't even know the language and the basic concepts properly, and it's not even a big language, it's a simple language on purpose

Avoiding learning Java is a reason to learn Go

t. hater of Go

this meme really isn't funny

Nobody asked you rajesh

How to multithread game engine? I cant figure out how to put it on more than 2 thread one main and one on everything else. All examples i found are contrived and too basic...

>in such a way that a non-programmer could understand what it's doing
Are you teaching someone?

You might want to actually use Visio/Draw.io and just slap code snippets inside of flow chart boxes.

Showing off the project to a non-technical manager.

I'm actually the only semi-experience developer at this company, so I'm trying to convey what actually is happening.

The issue is that draw.io and the like are difficult to map out timelines when things get multithreaded.

i never got the update then. my minds mildly blown

>2 thread one main and one on everything else
this is generally how you should do it. maybe one more for input.

multithreading in general is a meme. if you overdo it you tend to get a ridiculous amount of latency because you can't travel back in forth in time.

and for "truly concurrent" tasks you should probably run them on the gpu not the cpu, the cpu only has a few cores anyway

and one thread for audio

That explains alot. Thank you.

>The issue is that draw.io and the like are difficult to map out timelines when things get multithreaded.
Unless you want to write out multithreading in English, you're probably gonna have to map out your threads. Can I ask what your project does?

Replace longSize with sizeof(long).

also
>camelCase
pooInLoo

If you need to google everything you're not better than someone that just got his CS degree or is still at school. No offense meant if that's your case.

>PascalCase ftw

/s

It's a Windows service with scheduled Quartz jobs based on day of week, time of day, and jobs that run every x seconds/minutes/hours.

These jobs do various things, but they are mostly for pulling information from on-premise databases and cloud APIs and staging that data into a local database for warehousing purposes.

The application also has utilities that can scan a MySQL or SQL Server database (only ones supported right now) and re-create temporal staging tables with system versioning so that the service and jobs have a place to ship and store their data.

Now, this is just the C# part of the project. There's also other components to map out, such as the table schemas within the staging layer, and physically where all the components are located.

I don't know, either way it's going to take a few meetings to get this through, but at the very least it helped to organize my thoughts by writing this post.

Jobs.

Right, that makes sense since it's gonna be a compile time constant and I can just use the variable later for memcpy, thanks lad.

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

pipeline

>"fully specified C"
i have found a major flaw in the java specification.

Why one for input? That sounds stupid. You're asking for input lag caused by cross thread communication. Also don't see what the point of a thread for just input is.

A USB authentication daemon for Linux. Prompts user for a password every time a USB device is connected to the computer, it only authenticates the USB if the password is correct.

What cartoon?

en.wikipedia.org/wiki/Shimoneta

Jesus I wonder what you consider a big language then

If you're explaining code to a non-technical person, you want to keep everything in chunks. Threading is easier to explain when you're dealing with as few specific boxes as possible:

[x] section pulls information from other databases and our cloud services and stages it in a local database here. [y] section will scan the (My)SQL database.
etc.

If someone asks for further explanation about a certain chunk, you can get into the details from there. Don't be like the China at my job who starts off talking about programming specifics and tests to COMPLETELY non-technical people when they ask him what the general process for something looks like (it's as much of an abstract type of hell as it sounds like trying to salvage meetings, especially since I'm not even semi-experienced).

that's how it is on android you have a UI thread and a rendering thread i guess on pc it's different if you just poll the mouse input and don't do any prediction, but you have to process keystroke events don't you?

Consider a one-time dosage of Parabellum.

>that's how it is on android you have a UI thread and a rendering thread
neither of those are input threads.

all input goes on the UI thread

the UI thread in an opengl es game is mostly just used for input

>multithreading in general is a meme.
>mobile developer
Why should anyone listen to you?

not an argument.

>all input goes on the UI thread
yes, but also a shitload of other stuff. Almost nothing happens on the render thread on android.

>the UI thread in an opengl es game is mostly just used for input
I don't understand why this would be done.

the render thread is the main thread in the context of a game, and then you would have a game logic thread, as well as the UI thread

>I don't understand why this would be done.
this is android101, you're not supposed to do any significant workload on the UI thread for responsiveness reasons

I really doubt OP cares about Android.

do you think input events on windows are sent to the render thread? lol?

Why would handle all input on a thread called the "UI thread"? Why not call it the "input thread"? Do you do UI shit on this "UI thread" too?

>you're not supposed to do any significant workload on the UI thread for responsiveness reasons
You are confused at fuck. You keep going back and forth between android UI and openGL games.

OpenGL games almost always just use one thread, and maybe more if it's some kind of pretty decent game engine.

You've been talking about having an input thread that only handles input, and not explained why the fuck that would be useful. Nothing does that to my knowledge.

To elaborate on :

You have your main thread, and cores-1 worker threads. A job is just a chunk of work that executes on a single thread, potentially in parallel with independent work. You can have a central queue that all threads take work from, or more efficiently, a queue per thread with threads stealing work from other queues once their queue is emptied.

An API like futures is pretty good for this. You just async a function, a job is created, and you can wait for it to finish, map it, bind it, join multiple tasks, wait for the first of a set of tasks to finish, etc. The whole threading scheme is abstracted away.

Most windows apps don't have a render thread.

you're fucking retarded

the thread is called the UI thread on android, that's where the input goes, so you have a thread for input whether you like it or not, and you have a separate thread for the opengl context whether you like it or not

kill yourself

I really doubt anyone cares about OP.

>the thread is called the UI thread on android, that's where the input goes
It's not a dedicated input thread. It is the thread for everything. Hardly anything happens at all on the render thread in Android. The render thread didn't exist until they added the material design stuff.

>kill yourself
What is wrong with you? Most windows apps use GDI, which doesn't have a dedicated render thread. WPF does, but fuck all apps use that.

>fully specified C

Yeah, if you include the sun.unsafe libraries.

You could use C# instead, which has all that an more. :)

i'm done wasting my time on you i'm closing this tab, this entire day has been a waste of time on useless idiots like you, you can choose to understand

>what's the best way to do X in a game engine
>here's how you're mandated to do X in Android apps anyone not talking about Android should kill themselves Android Android Android

Goodbye you useless shithead.

And it's an open spec. Less chance of getting sued for using it.

I should do some daily programming. I want to, but at the same time i'm feeling lazy, and i don't have a clear idea of how i want to proceed.

just do it faglord

Here, I rolled a task for you:


Custom markup → HTML converterbonus: without using any regex longer than 10 characters

Invent your own markup and write a converter from it to HTML.

Who /react/ here?

sites.google.com/site/prologsite/prolog-problems

Try and solve them in your favorite languages.

SCons is pretty good.
Thanks to the user who mentioned it to me earlier.

What made you think of this task?

Literally nothing

better-dpt-roll.github.io

To reply to since the topic got archived;

Noted! I'll take a look-see. I've tried googling stuff before but normally they'd be written in a different style so implementing it, I find, to be hard. Not sure why but either I didn't understand or the way I had learnt was clearly not good enough for me to properly understand the material.

Naw man, no one's offended 'round here I'd say. Normally when someone is quoting someone else there'd have the post tagged to show who they're quoting.

If it's just greentext like I did, then has it right on the mark.

How can I draw the star of David insise a console program?

I thought about using a two dimensional array which I could fill in with a given char in the right places, but there has to do better way to do it..

>star of David
it's literally just two triangles.

Like what? Any raster graphic is fundamentally dealing with a 2d array.

I found another problem on that list that was very close to what i should be working on anyway.

noob question about C

i have some structs and functions in a file and need to make a header to use them in another file

but in this other file i will only use like three or four of 20 functions, but these 3 or four do call some of the other 20 functions

will it suffice to declare only those 3 functions or do i have to declare everything

i hope you know what i mean

more anime usenet stuff

OCaml

You only 'need' to declare the functions you are using. Just make sure that the 20 functions are defined in the right order or declare all of them at the top of your .c file to be save.

Do you have a link?

anizb dot org
There's probably a lot of broken shit

Added a save dialog that prompts you if you try to close the program with unsaved changes.

I like it, never heard of .nzb before, cool

What do you use to navigate? Look nifty

It's a pretty decent way to download anime, but it does cost money just to connect to a provider. Usenet mostly sucks for western content though.

Post quoting works now!

home-row h,j,k,l or pgup/pgdown

What program?

90% of what I've been doing the last week is writing stuff that shouldn't be written in awk in awk and then promptly deleting the scripts when they work.

My productivity has never been negative before.

Can anyone tell me what's going on here? I'm making an arduino motor controller with 'presets'

I use the interrupt pin so when the button is pressed, a count increments, then the if statements in the main loop reference that count to determine which preset to run

the issue is that I appear to be getting feedback from the motors when they're turned on. If the motors are disconnected, the button increments fine, but when the motors are connected I get a lot of random interrupts

Here's the expected serial output:
0
incrementing cycle
1
incrementing cycle
2
incrementing cycle
3
incrementing cycle
4
incrementing cycle
resetting count
0


and here's what it looks like when the motors are connected:
0
incrementing cycle //this is the only time I hit the button
1
incrementing cycle
2
2
2
2
2
...


I'm thinking it must be something with how I have it physically hooked up

will programming help me understand what the fuck is going on in Mr Robot?

and here's the code 1/2:
const int buttonPin = 2;
const int rotorMotor1 = 7;
const int rotorMotor2 = 8;
const int rotorPwm = 9;
const int vibMotor1 = 10;
const int vibMotor2 = 11;
const int vibPwm = 12;

volatile int count = 0;
volatile int setPwm = 255;

void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(rotorMotor1, OUTPUT);
pinMode(rotorMotor2, OUTPUT);
pinMode(rotorPwm, OUTPUT);
pinMode(vibMotor1, OUTPUT);
pinMode(vibMotor2, OUTPUT);
pinMode(vibPwm, OUTPUT);

attachInterrupt(digitalPinToInterrupt(buttonPin), cycle, HIGH);

Serial.begin(9600);
}

code 2/2:

void loop() {
if (count==0) {
Serial.println("0");
analogWrite(rotorPwm, 0);
analogWrite(vibPwm, 0);
delay(2000);
}

else if (count==1) {
Serial.println("1");
digitalWrite(rotorMotor1, HIGH);
digitalWrite(rotorMotor2, LOW);
analogWrite(rotorPwm, setPwm);
digitalWrite(vibMotor1, HIGH);
digitalWrite(vibMotor2, LOW);
analogWrite(vibPwm, setPwm);
delay(2000);
digitalWrite(rotorMotor1, LOW);
digitalWrite(rotorMotor2, HIGH);
digitalWrite(vibMotor1, HIGH);
digitalWrite(vibMotor2, LOW);
delay(2000);
}
else if (count==2) {
Serial.println("2");
digitalWrite(rotorMotor1, HIGH);
digitalWrite(rotorMotor2, LOW);
analogWrite(rotorPwm, setPwm);
digitalWrite(vibMotor1, HIGH);
digitalWrite(vibMotor2, LOW);
analogWrite(vibPwm, setPwm);
delay(2000);
}
else if (count==3) {
Serial.println("3");
digitalWrite(rotorMotor1, LOW);
digitalWrite(rotorMotor2, HIGH);
analogWrite(rotorPwm, setPwm);
digitalWrite(vibMotor1, LOW);
digitalWrite(vibMotor2, HIGH);
analogWrite(vibPwm, setPwm);
delay(2000);
}
else if (count==4) {
Serial.println("4");
analogWrite(rotorPwm, 0);
analogWrite(vibPwm, 0);
delay(2000);
}
else {
Serial.println("resetting count");
count = 0;
}
}

void cycle() {
static unsigned long last_interrupt_time = 0;
unsigned long interrupt_time = millis();
if (interrupt_time - last_interrupt_time > 500)
{
Serial.println("incrementing cycle");
count = count + 1;
}
last_interrupt_time = interrupt_time;
}

No, for that you need to study existentialism and deep math

Ive learned all the java syntax but have barely done any actual programming so I only know stuff in theory, how do I go about learning how to actually code?

You could try writing programs that solve specific problems.

anime kills brain cells

i watch anime and i have a 3.9 gpa

How do I into vim? I try to use it but I end up spending all my time in insert mode and occasionally using the replace command.

try doing problems on websites that give you test problems, like hackerrank. i need to get used to not using an IDE since apparently they aren't allowed in google interviews

That doesn't even contradict his point. Maybe you would have realized that if you hadn't killed so many brain cells.

arstechnica.com/biology/2016/07/japanese-animation-effects-on-brain-development-new-findings

make a program that you will use

it could be porn related, or some simple game youd like to have

i made a scraper once to download images from a sit ei liked, or i made a program that splices two porn pictures together

i like tetris so i made a clone of that too

whatever im sure you can find a functionality you can implement in your particular way, if so tell whta it is i might like to make it too

9/10
made me click

obligatory info: vimtutor for learning vim

>I end up spending all my time in insert mode
Does that mean you're navigating with arrow-keys? You should learn to move with h,j,k and l keys.

Also if you want to learn useful vim comments take a look here: stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118

$ vimtutor

>i made a program that splices two porn pictures together

But.. why?

...

after roughly 18 months of writing business quality code in C#/.NET I am decided

I will spend the remainder of my career avoiding it like the motherfucking plague. even if it means I can't find work.

I would rather flip burgers then work with this fucking trash build system ever again. fuck all this and fuck microsoft.

learn some other langs, code stuff for android/linux/ios, etc. would help, I suppose

Why? For me it's been kinda fun, since C# is comfy.

just make websites lmao

So the only reason you hate .NET is because of the build system? There are alternatives like FAKE for building .NET projects.

FUCKING HELL, I keep procrastinating ;_;
how the FUCK do you guys not get distracted when doing your own projects? this shouldn't be difficult, at all. FUCK.

>tfw you get better at a language and you refactor your old code, to make it more readable, shorter, more easily adjustable, and sexier

if you're not enjoying it you're doing it wrong

I enjoy programming so I will generally do some each day or read about a new language/technique

not getting paid to write those sadly

C# is actually pretty good but VS and .NET are total dog shit

n-no

Try out Mono.

>VS and .NET are total dog shit
why
>inb4 muh bloat

there's absolutely nothing wrong with being a web developer

haskell?

yes friend

post code

It could be better when I get more adept with monads but it's far nicer than it was before I changed it

pastebin.com/av3fXTER

M A Y B E T I O
A
Y
B
E
T
I
O

How do I get:


A certain 'status' to be the color green? The output is from sql 2008.

this looks interesting, thanks, I will look into it

>case (maybe) of
>nothing
>just (perform action)
You can use mapM or traverse here too, maybes are containers

in handletags I think there's a possible fmap?


You could use monad transformers too, so rather than switching from monad to monad you can just do

valueInsideJust

Whenever you see something like IO (Maybe a)
or State s (Reader r (Either a b)) or whatever you should look into monad transformers.

hello dpt

im looking for a c++ projects lists sorted by difficulty level any one know any good resources

>literally be first year in IT study
>college degree and shit
>learn Python as first
>C# and HTML and others later years

I am fugged am I?

>if you're not enjoying it you're doing it wrong
I want to make useful things, but, seriously, why is it so difficult to even FIND information? let alone useful libraries. all the "technical" meme speak in different languages just obscures information. it's like people don't even care about those who are trying to learn anymore. or perhaps I'm the one who's too flustered and wrong, I'm trying to do things the easy & fast way, and end up confused and doing nothing at all
I dunno what to think anymore. also, my social status (poor NEET) doesn't help me at all

I met a qt grill in college and now think that girls (and other normies) won't give a shit about how good you program if the UI doesn't look really good. If the ui is just generic (like ligthly styled Bootstrap for a website), then your program is just nerdy shit.

if ($row['status'] == "OK") {
echo "" + $row['status'] + "";
} else {
echo $row['status'];
}

Thanks user

>literally
You're already going to drop out and flip burgers, it doesn't matter what you start with.

(No. Any school that doesn't have its head up its ass will go head over heels to not teach you anything extremely language specific as you go through the degree. You're supposed to learn more of the critical thinking and problem solving aspect from each course. Language wars are just bikeshedding (look it up) for the most part.)

Yeah, people are superficial. Surprise. Idea is that it doesn't matter unless they are there to give you money.

Protip: companies don't hire graphics and UI designers because programmers/engineers enjoy their presence

*for the most part in college/uni

>VS and .NET are total dog shit

Lies.

Feels quite good because my course will teach me network engineering, hardware building and maintanance, software engineering (I gonna choose this speciality) and IT bussiness managment in four years.

If this wont give me a job I will kill myself. Python is fun though.

this is obvious. people don't understand how the technical stuff works, they just want it to work. for them, you are the "guy who knows about computers", and computers work magically.
your efforts don't really matter to anyone, it's the end result that matters.
even more... marketing and even brainwashing matter as much, if not more, than technical stuff, at least for businesses. you have to CONVINCE people that your shit is useful.

>If this wont give me a job
Degrees don't automatically give you jobs - you get yourself a job by putting in WORK.

We need to study and work at the same time, some kind of merchant school. Fuck I really dunno how to explain. We'll get detached to companies and therefore learn how to work for a company and learn to program at the same time.

I tried this, and it just shows a '0' in front of the status I need.

This is in PHP right?

>We'll get detached to companies and therefore learn how to work for a company and learn to program at the same time.
Oh that's cool, kind of like work/study (where you get a part-time job somewhere on or near the school campus to pay part of your bill) but actually beneficial. Just don't lose your mind about falling for memes and you should be ok.

Yeah like that.

This is because he used + instead of .

Why does some people always to use the private keyword for members in C# classes, don't they know that's the default visibility for them?
>inb4 explicit > implicit

why should i not use
using namespace std;
and use std::cout instead?
some one told me not to use namespace but dident explain why

Consider what happens when you have two libraries that have the same class name or a variable contained within their respective namespace and then you use using namespace ;

Who is this cutie patootie?

megumin from bakemonogatari

IDK man, looks like a ship girl (kancolle, judging by the thing of her hair).

gotcha, thank you senpai

That did the trick! Thanks both of ya.

Because it's easy to tell immediately if it's intentional or not.

Also, different languages have different defaults, so it's easier to read for someone who uses many different languages.

i love tight anime butts

Because they are stupid fucking retards.

Working on this 15 piece sliding puzzle atm
Does anybody know whether you can randomly distribute all the puzzle pieces and still have it solvable?

took me a while, but I managed to do it now. There weren't many examples to use as reference, I guess it's not used that much. Monads are confusing

Any random arrangement is solvable (cs.bham.ac.uk/~mdr/teaching/modules04/java2/TilesSolvability.html)

Also you have 16 pieces in your screenshot.

Thanks
I also DO realize that there are currently still 16 pieces

Should I use my real name on github?
I want to include my github in my resume, having a nickname seems kinda unprofessional.

I used my initials as words as I'd rather not use my full name

example: Tea Be for initials T.B.

>mfw I use a nickname and anime avatar

Is there a way to validate a SecureString? Like, I just wanna the user doesn't enters whitespaces.

i'm trying to make a booru crawler. there are existing ones but they're in python and i'm alergic to python so it's C or bust. but i don't get this damn libcurl. i have this CURLcode (probably) extracted, what can i do with it now?

If you have it on your resume then yeah.

I use a random name... I guess I should change it, lel

I use my fill first name and the first 3 letters of my second name.

are you downloading a page with your tag of choice, then trying to extract links from it?

The program's gotta look good AND work good. Users don't understand the difference.

Listen nigga, I don't know shit about programming in C (Javascript pleb here) and even I know you have to include stdio.h in your code to have most basic shit like printf() working.

xddd

You guys really should have some kind of sticky.

Anyway, my only "programming" experience is Javascript (and mirC script). I want to try something more advanced, but I don't know what to choose. I was thinking about either Java/C# or Python. Any recommendations?

i'm trying to extract a full link from json file and put it in the string so i can parse it properly but i'm not sure what this damn curl is actually doing
KYS

C#. Time to learn the power of Static Typing.

>Java/C# or Python
Just throw your keyboard away.

>I refuse to use the right tool for the job, instead I am going to use the wrong tool for the job while not knowing anything about the tool.

And yet you're telling others to kill themselves, very interesting.

You can always consider plain old C.

Im working on a web app, made on Ruby On Rails for 6 months, in my new job. They have 15 programmers for a single easy app, and they have ZERO tests.

I have no fucking idea how to convince them to do it anymore. Always the "there is no time" excuse.

>what is learning
choke on your spoon

who here /osdev/?

and you can shove CURLcode up your butt :^)

Somehow, I want to dynamically create passwords based on your progress in this game that I'm making.

Your progress is checked simply with:
level1_complete = True
level2_complete = False
level3_complete = True
level4_complete = False
level5_complete = False
#game is not linear


Passwords need to output to Integer-filled arrays like [1,7,9,16,22], as an example, based on what's True and what's False. They always need to be different. Them being different is the biggest thing, does anybody have any idea how I can do this?

just admit that you have no fucking idea how to do it
> :^)
die

Write a program that stores the values 'X' and 76.1 in separate memory cells.
Your program should get the values as data items and display them again for
the user when done.


How do I approach this in C? Do I declare a char with a value of X and a double with a value of 76.1 then just printf them to the console? I'm not too sure what theyre asking

I can't say I've used your library, but I believe curl just downloads the page same as any other way. I did something similar to this in hasklel for rule34.paheal. Just pop your url into curl, and save it into a file, then open the file and start parsing. It might be easier if you have a library to help you with parsing, I used tagsoup, it looks like there are libraries for C as well.

You might want to open the downloaded page in a text editor so you can find out an easy way to get your links out by filtering between tags, etc

Hope that helps, idk exactly how you're trying to do it

bit flags.
level one is bit 1, level two bit 2 etc.
so: 01011 is binary code for having completed level 1,2 and three (counting from right to left in binary)
then just convert it to an integer, maybe add a prime to make it less obvious what you're doing if that is important.

I mean if the concept of using a package manager to install a library and then passing an option to the linker is too hard for you then maybe you should get back to the basic before attempting to use the wrong tool for the job.

>maybe add a prime to make it less obvious what you're doing if that is important.
that is a major thing that I neglected to mention, it should be unpredictable so that passwords can't be easily guessed.

I don't get how to do binaries with Python, so I will read up on some things based on your advice.

first person to respond to you had a good idea, the other way is generating random numbers with a fixed seed, and taking the nth number to be the nth level password

This would only work if you do the levels in order though

>it should be unpredictable so that passwords can't be easily guessed.

Why does it matter so much?

C#

might try saving to the file, why not. i have stuff ready for parsing

>using a package manager to install a library and then passing an option to the linker
nice job, pulling things out of your ass and completely missing my point. kudos to you

It's a video game and it's tradition that video game passwords can't be guessed so easily.

Been a while since i've used C, but I think you could just run
system("curl "www.website.com" > file.txt");

or something like that. Not sure why you had to install curl from source though, didn't you already have it on your system or at least in your repos? Or are you using windows

I mean the point doesn't really have any signifance here when I'm discussing with a person that cannot even open the documentation which thrououghtly explains it.

You could make it fun by having the password be a string of words, and each level has its own magic word. Then the order of the words wouldn't matter, and it'd require a lot of testing to determine which word is actually the password.

Monad transformers are all over the place.

I meant just the maybeT, I didn't get many results searching, and the documentation was sparse. Maybe it's because i'm using cuckcuckgo

>calling curl instead of using libcurl

puking_anime.png

magyar?

I'm not a C fag, idk how they do it

user, plz...that's the easy way
pic related or learn to read properly

I already have designed this wonderful password input system. You click on black squares and it appends integer values to an array based on which square you clicked and then the square turns green (graphics are work in progress).

I am adamant on doing a password system because it's something I really want to see in a game again, but it really is a huge hassle. Modern "save data to harddrive" systems are WAYYYYYYYYYYYYYYY easy.

You beat levels 1, 2, and 3? Well, let's just say that verbatim to your harddrive. No password algorithms involved.

You could use ExceptT from
hackage.haskell.org/package/mtl

if you want interesting error values (n.b. ExceptT () is like MaybeT)

or just this:
hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Maybe.html

>how they do it
>implying this is correct in any language

If you are using any language (shell scripts excluded) where its idiomatic to call processes like that instead of using a library or module, just stop.

#include

int main()
{
char x;
double t = 76.1;

printf("This is a test for the char %c and the double %f");

return 0;

}

another thing to make it less obvious, leave bits out:
Level: 1 2 3 4 5 6 7 8
0 0 1 1 0 1 0 0 1
Do something like:
Level: 1 2 _ 3 _ 4 5 _ 6 7 8
0 0 0 1 1 1 1 1 0 0 1
The advantage is, the unimportant spaces '_' can be generated randomly and still be decryptable.

that is overly comlex, do you really evpect the average gaymer to be able to remember which cells in a 5x5 grid are filled? Thats way harder than say 4 or 6 hex characters, which is what many old games did.

Alright, well then my suggestion wouldn't work. Would be neat, though. You could've had level 3's password be "hippo" and then generate strings like "hippo parakeet deer moose", "groundhog deer hippo aardvark", etc.

That'd require quite a bit of probing to find the actual password.

>didn't give the arguments to printf

This is a complete shot in the dark, but perhaps you didn't include stdio.h

I'd be more worried that he didn't actually store a char with the value 'X'

between those, go with C#. and please don't say "Java/C#", you're triggering me. they're similar in a lot of ways but there are some major differences, and C# is better in basically every way. it's not fair to lump them together

I mean whatever, good luck anyway, you'll need it.

A custom iterator for permutations of elements in a single container and a contexpr LookUpTable for signal attenuation of neural signals for a strong AI that can ASK QUESTIONS and fucking DREAM...

Envy me.... ya SQL deadbeats!

I do not comprehend this, but I am reading up on bit flags. Thank you for this.

It's actually more than just "I want to see passwords again," the real reason for it is that I feel modern save systems ruin your experience with a game. I kind of WANT you to not bother with a password so that you'll play through the game from the start again. I don't intend the game to be super long, you're supposed to beat it in a single sitting, but if you do absolutely have to put it off for another day and really want to continue from that point, you use the password system.

those wonky lines are triggering my ocd

Can you guys point me in the right direction please? Sorry I'm still learning and I'm unsure what it is the book is asking me to program exactly. Any help is appreciated

How far in are you? Have you done pointers?
If not it is probably literally asking you to declare variables and printf them

This code sounds like what it wants
#include

int main()
{
char a = 'x';
double b = 76.1;

printf("The character a = %c, and the double b = %f\n",a,b);

return 0;
}

When it says store them in separate memory cells it sounds like just an odd way to mean two different variables.

Printf uses formatting strings to show variables, %d is for an int, %c for a char, %f for a float/double, etc, and the \n prints a newline in your terminal

thanks
Ah I see thanks. Still getting used to the way the questions are asked.You used %c in the printf statement to show that it's a character stored in char a and the %f to show it's a decimal stored in double b.

who needs pointers anyway? aside from forced usage in some functions, they're pretty much the goto's child

>who needs pointers anyway?

I want to make a multiplatform map app. would it be too ugly, for the mobile platforms, to simply have the a webserver running in the background (serving the tiles), and use a webview to display it?

no, seriously. they're pretty much useless in the early stages of programming

NEW THREAD!

As soon as you move from your fizzbuzzes and toy programs, they become absolutely essential.

If you don't have at least 3 layers of indirection between your pointers and the originating memory address they refer to, you don't know shit about programming.

Bjarne's book on sepples told me to write a function with no return value using void. So I tried this in Visual Studio:

void write_sorry()
{
cout

nonsense. you can easily skip them without losing anything big. modern languages did everything to reduce the neccesity of using them to bare minimum because everyone was sick and tired of moving the pointer every single damn time

The printf function can display data differently.
For example
int var = 3847;
printf("%d - %f - %X - %c\n", var, var, var, var);
Will print the same variable 4 times but interpret/display it differently each time.
the output will be:
3847 - 0.000000 - F07 -
>3847
the first is obvious, we declared the int to be 3847 and %d displays it as a decimal, so it outputs 3847

>0.000000
the %f will interpret a value as IEEE754 floating point number, which var is not. This doesn't generate any errors but will display var in a way we didn't want to. It's like binary and decimal 1001 can be both, a binary or a decimal number, depending on how we interpret it.

>F07
the %X will display our var as hexadecimal. If you convert 3847 from decimal to hexadecimal in a calculator it will also result in F07, the value is still the same, just the way we display it has changed.

>
The %c tries to display our var as an ASCII character. Since 3847 is way out of ASCII range there was nothing printed.

Any good resources for learning Swift?

Hi guys, a total newbie here.

Is Eclipse a good editor? I'm not searching anything fancy just something that it works how I would like it should work.

I'm initiating in programming with Java and I'm doing some curses for unemployed persons that my country offer. The only one I did used Eclipse in class and seems cool, but I don't know if I should stick with it.

Opinions?

its not an editor, its an IDE. Its okay I guess.

Sorry, I'm very new still. And IDE is like an environment to work with one or some languages, right?

In case I'm right, is Eclipse any good?

If you really need to do this, use a union, please.

gustedt.wordpress.com/2016/08/17/effective-types-and-aliasing/

I'm just explaining how printf works.

You could just use different data types instead of doing dangerous silent casting with a value.