/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

stackoverflow.com/questions/12015571/how-to-print-unicode-character-in-c
datanamic.com/support/lt-dez005-introduction-db-modeling.html
use-the-index-luke.com/
twitter.com/SFWRedditGifs

Having "fun" with monads and zippers.

I want to remove her cute shoes and tickle her feet :3

first for C++

interestingly zippers are comonads

Check your pronouns, shitlord.

They're monads as well.

Im making a text based game in vs2015, c++.

How do I output unicode block such as:

?

It would be to visually display stats/health bar but I've heard conflicting information about implementation.

Gee I don't fucking know let's try googling "unicode output c++".

stackoverflow.com/questions/12015571/how-to-print-unicode-character-in-c

Oh look there it is.

>unicode console output
not necessarily portable

Just DONT
its absolutely the most retarded project
At least go for a fucking GUI
It takes 2-3 days to get some understanding of Qt and make few windows with the text shown, maybe some background image for it.. buttons for next and previous scene, additional stuff
and doint that you are actually learning

doing text base game... your are just wasting time and you learn nothing

>reddit.gif
>stupid post

Not surprising.

I agree with this completely, assuming you're set on C++.

Something like that would be more comfy to write in C#, though.

What makes it a reddit gif?
What makes it a stupid post?

did you learn a lot writing if/else text based games

C and c++ gets so much flak in this board

c# any good?

Look at my elegant numerical integration method:

numIntegral :: (Double -> Double) -> Double -> Double -> Double
numIntegral f a b = (b-a)* (mean [ (f x) | x

well I've been making a couple different projects to refresh my memory.

I've actually learned quite a bit making this project.

No, do C or C++

[ f x | x

>c# any good?
Depends on what you're doing.

Yes, C# is a good language. It's got tons of support and it's much easier to go from nothing to a working thing.

It's silly to compare it to C, though.

Is the transition from Python to Java a good idea? Looking for my next programming language to be something actually good

>Python to Java
>looking for a good language
I like this shitpost
Very nice

What projects you made in Python?
What projects you want to make in Java?

the fact that you have no idea what to do after learning some syntax does not change with more languges

>something actually good
>Java

It's like you want to be bullied here on purpose.

>[ f x | x f list
Very nice, just changed that.

Also I might generalise this to Num a but for this module, everything is in doubles.

what's wrong with python?

What you use C# for is completely different than what you use C and C++ for

It's a girl language

What would a database schema for an imageboard look like?

is fmap

I did not know that.

You got any other interesting ideas for me to program in Haskell?

I was thinking about a function that does a line integral or something.

...

board -> thread -> reply

This. He could even keep it "text" based in the sense that he would make a GUI to manage stuff like inventory, abilities and such and a main canvas to paint "text characters" for the map.

>

so...

board containing all the current thread IDs
a table for every thread containing replies and text, image locations?

What do people use C# for?

>a table for every thread
user...

I want to get in to mobile app development, what other languages do you suggest for that?

C# = Microsoft Java

It's good if you want to work in a low skill .Net shop.

what?

Pretty much everything that isn't a driver.

For that you could go with Java, or possibly even Java.

so you can't think of anything?

cuddling

Please go research relational database design basics.

If you thing you need a table for each thread, you clearly don't even understand the basics.

C++ is almost like another brainfuck

people think it's just another programming language like others, but it's an unusable monstrosity for autists

just a friendly warning

C++ was a mistake.

Where do I look this up?

Editor, font, color scheme please?

Thanks, it just looks comfy i had to ask

>Program compiles and runs perfectly fine in g++ and clang++
>doesn't compile in VC++
>dumb it down for that retard
>still compiles and runs perfectly in all normal compilers
>compiles in VC++ but fails in some completely undebuggable way

Can't I just debug programs compiled in a normal compiler in VS instead of having to use this braindead compiler just to have a good debugger?

Type checker for simply-typed lambda calculus. Then build on top of that, polymorphism, naturals, inductive types, etc.

in terms of real life usability, creativity and performance (speed and size-wise) what is something close to C++ ?

Python is out of the way for sure, is
>Swift
>Objective C
>or Rust

Any good ?

>lambda calculus

Never looked into this. Sounds like something that'll keep me busy for the coming few weeks.

this swift, iphones
avoid android & java like the plague

(Neo)Vim in uxterm, font Consolas. colorscheme is zellner, but I think it's a bit fucked up in the console so it might look different in gvim.

Intro to database design:

datanamic.com/support/lt-dez005-introduction-db-modeling.html

Once you've levelled up in that, here's a comprehensive guide to indexes:

use-the-index-luke.com/

it's extremely simple

imagine if haskell had no values or types, just:

applications
lambdas
variables

data Λ a = Var a | Abs a (Λ a) | App (Λ a) (Λ a)

Is there an alternative to QT?

ncurses

>Program doesn't just compile and run in Visual Studio or any other IDE, have to manually compile it using "g++ -std=c++14 main.cpp -lpthread"

>Put that as a top comment of the file, send it to a fellow student, and remind him one more time at the end that it wont just compile at any of the IDE's, even the online ones, but it functionallity is what it should be, and it's matter of time to fix it and make it work, its just a temporary solution for a bigger project...

>The retard never saw any of the comments, just straight forward told me "It does not compile, please consider to debug your code before sending it, you are slowing down the group project"

I am learning a lot about programming, and stuff at the university but I never knew there is so many retarded people in this field

Motif

He very well saw that comment, user.

wx, fltk, nuklear

alright, so it would be more like
a table for all boards, a table for all threads, and a table for all comments?

Yes, exactly.

There are obviously other considerations (information for IPs, Mods/Admins, metadata, etc.), but that would be the basic gist of it.

Stumbled onto a non-deterministic bug. Now trying to figure out how to fix it. Also started drinking some Guiness.

Yeah there are a few but all of them are objectively inferior. I'm not saying Qt is perfect though it's just that the alternatives don't cut it.

Stumbled onto a compiler bug. Also started doing heroin.

But you're on Sup Forums so you (presumably) want to be a girl-boy!

which one is thread safe?

version A
ArrayList database = new ArrayList();
Dogger pupper= new Dogger("pupper");
database.add(pupper);


ArrayList database = new ArrayList();
database.add(new Dogger("pupper"));

With my code alone, the project was done, we had 3 more months, I could of fix it in 1 day or less. The end result was way way way worse.
It did compile, and all, but the final functionality was never achieved, there was many bugs... the guy was retarded normie that never stopped to talk about his dad working for a big company downtown and how after the end of the semester he is going there as intern... I never saw him again, I think he quit or transfered or somethign

Stumbled over a bug. Also, I think it was doing PCP.

WXWidgets

forgot to say, the latter is version B

neither

thanks

>calling a simple object in your code a 'database'

One table is enough for threads and posts combined.

Good that you cleared it up.

You got any good books/pdfs/youtube vids on this?

I want to do a project that puts ciphers in photos using c.

So how do I open up a photo and change the rgb in c? also I would like to create new images as well.

No, that's dumb, and you should feel bad.

So I add a column, isOP?

Why? OPs are just posts as any other, it's also much more flexible.

Something like that, or 'parent' and have that point to the OP for regular posts and NULL for OPs.

java and c# are almost pythons in their productivity compared to c++

Yes, just violate the second normal form.

Surely this will not cause performance or conceptualization issues later :^)

End your life.

comment posts cannot be promoted to OP, and if an OP is pruned, so are it's child posts, so why bother?

an OP is not a comment.

>muh normal forms
Your literally worse than OOP and hasklelfags combined

The App I am developing is pretty simple, it just needs to register the inventory items and items sold of a Shop.

The Inventory part is pretty much done, since it's basically a CRUD.

Whenever the User is registering a new Sale, he should be able to pick the items and the quantity of each item sold. To do this, I create a screen like this. It's basically a RecyclerView that shows the item name and a SeekBar where the user can select it's quantity.

To solve the "knowing how many of each item was sold" problem I thought about, for each time the user interacts with the SeekBar, adding or removing an from the Purchase Item's list. For example, if the User registers that he sold 5 Apples, the list would be filled five times with the same Apple object.

But, doing this would make it really hard to restore the items when the User is editing a Sale. I actually don't even know how to do this.

Could someone help me figure out a better solution for this problem?

Did you all agree on what you're group is going to develop on? If not you're asking for trouble. If they all are using an iDE you should also.

And then you cannot store facts about the thread itself without tying them to every single post within the thread, such as whether a thread is a sticky. Even if you only include the information in the OP post, it still allocates storage for the other posts, with some caveats.

1000 posts = 1000 extra bits denoting whether or not the thread is a sticky.

Kill yourself.

t. An actual database architect.

There's a reason why basically every single relational database meets 3NF. 4th and 5th are just wankery, but 3NF is crucial to not repeat data.

>t. An actual database architect.
keep telling you're self that

why is swift better than java? whats wrong with developing for android?

I can tell you have no experience with Java or Android

I don't which is the reason why I'm asking. Please elaborate.

So this is the basic gist of what an imageboard database would look like?

Yes, but obviously you're missing tons of information, such as timestamps.

You'll need something like a table for known IP addresses so you can do things like IP ban, etc.

it's just the basic gist
also, can I just hash their IP so I can ban them without knowing their IPs?

I have N pokemon(s), and it costs "COST" candies to evolve one. I have M candies, and I can sell a pokemon for "SELL" candies. I want to sell enough pokemon to evolve the highest amount of pokemon left.

Basically I have to optimise M/COST while keeping it >= N, but I can subtract from N to get more candies. Hopefully this makes sense