/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

better-dpt-roll.github.io/
pastebin.com/gBYZCij7
pastebin.com/7pyVbsqB
pastebin.com/cPZYFhUi
twitter.com/SFWRedditVideos

Thank you for using an anime image

First for java master race

Working on an xml to object reader required for work

>java poster is slow
poetry

>java master race
>xml to object reader
>for work
I can't tell if this is a good troll or naive pajeet who genuinely doesn't know he's nailing a brutal stereotype, and that's pretty terrifying.

I don't get it?

xml to object is the most retarded cancer ever created by humans

so it must be bait

same, bro, but in python.
also, trying to use only the standard library and, god, Tkinter does suck.

Functional shit brings it's own problems though. C#'s main goal was to make programming easier, so it was basically just improved Java. If they heaped on loads of functional shit it would have become more of a meme langugaes.

Of course there's always F#. Which any serious programmer should be using over C# anyways. C# is for employment, F# is for productivity and fun.

How do you actually engineer solutions on building software. Let's say I have a p2p network Should peers be placed just into a simple list and looped through to get say 'status update' then refine a new list based off status update.

Or should peers be ina dictionary, can i update keys on each peer for their 'status'? Or should I somehow make a class that makes things more layered.

connected to 210.54.33.17

connected to 188.118.158.34

connected to 45.72.234.244

connected to 84.106.111.243

connected to 186.241.39.126

connected to 125.33.16.11

connected to 104.244.74.139


we have a connection wit heach one of these. Now let me say I want it to where I get the status of each one?

You probably shouldn't post your IP addresses on Sup Forums.

Yes tehy're not mine they're peers on a torrent.

When you run torrent software your ip is visible to everyone regardless.

o shit. bad ass hacker detected

Please use an XKCD image next time.

>ip geolocation
>accurate ever
pick 1

google thinks I live in a different city every time I restart my router, the information you get is about as useful in tracking someone down as their flag on Sup Forums is.

Randall pls...

>C#'s main goal was to make programming easier
>make programming easier

I feel like I've already heard it somewhere

Rate my haskell fizzbuzzer

fizzbuzz n = concat (map (\n -> " " ++ if n `mod` 15 == 0 then "FizzBuzz" else if n `mod` 5 == 0 then "Buzz" else if n `mod` 3 == 0 then "Fizz" else show n) [1..n])


Am I allowed to post in /dpt/ now?

Just bought a prehistoric word processor and noticed it supports external applications.

It's an LW-810ic.

I want to see if I can make an application for it and have no God damn idea where to start.

>Scroll bar
Fuck off, indent it properly or go die.

>having a scroll bar

" ".join("fizzbuzz" if i%15==0 else "fizz" if i%3==0 else "buzz" if i%5==0 else str(i) for i in range(1,101))

Join the python one liners club.

>I feel like I've already heard it somewhere
where?

> conditional logic
> Haskell fizzbuzz
Keep studying.

Not a troll nor pajeet,its just part of a bigger project. But yeah its pretty boring

Its one of those generic programming things you do at work, xmls and schemas and shit

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (r/IAMA)

>tfw no question

Thank you for using an anime image.

You've failed.

Why put it on one line when you can make it more readable on many?

Range(1, 100)
.Select(x =>
x % 15 == 0 ? "FizzBuzz" :
x % 5 == 0 ? "Buzz" :
x % 3 == 0 ? "Fizz" :
x.ToString())
.ForEach(WriteLine);

>he needs code to be readable
I feel bad for you.

F#ified:
[1 .. 100]
|> Seq.map (fun i ->
match i % 3, i % 5 with
| 0,0 -> "FizzBuzz"
| _,0 -> "Buzz"
| 0,_ -> "Fizz"
| _,_ -> string i)
|> Seq.iter (printfn "%s")

>he doesn't write readable code
I feel bad for you.

It's the burden of being a good programmer :(

Who's got that rolling chart

better-dpt-roll.github.io/

Elixir'd.

0..100
|> Enum.map(fn(n) ->
case {rem(n, 3), rem(n, 5)} do
{0, 0} -> "FizzBuzz"
{0, _} -> "Fizz"
{_, 0} -> "Buzz"
{_, _} -> n
end
end)
|> Enum.each(&IO.puts/1)

senpai how can I free myself from the boundaries of finite intelligence?

>readable
Its like you want to be replaceable at your job

What anime?
Is it good?
Does it have lewds?

Rusted.
fn main() {
for i in 1..102 {
match (i%3, i%5) {
(0, 0) => println!("FizzBuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
(_, _) => println!("{}", i)
}
}
}

nothing you can do can make haskell """"readable""""

Based Elixir. I should pick it back up. But Clojure is just too nice.

now post the brainfuck version

Why didn't the 2nd animuu catch the first animuu before she fell off the bridge? She had plenty of time..

Also, why did the first animuu explode when she hit the train tracks like a bean bag filled with blood?

These are important questions.

What are the best practices the order of functions in a C program?

What's the best C++ IDE on Linux?

Notepad++.

CLion

Vim + terminal.

int main(){ for(int i = 0; i

Doesn't produce the expected output, try again.

>not using json
>not just doing json.deserialize

I fed up with this worl

Technically, one line. But it's multiple statements.

Also
>printf("%s\n"
You could have saved a lot of trouble by using
>puts("fizz")

That's not a "one-liner", in that it is more than one statement.

What plugins should I use?

>pajeet == someone employed

any text editor, terminal, make and optional cmake.

> plugins
For what purpose?

>xml
>not json

Please tell me you're not a pajeet

>pajeet == someone employed
Welcome to /dpt/, where you're ridiculed if you make money in any way other than sending thirsty arabs pictures of your hairy legs covered in thigh-highs, and the points don't matter.

Getting actual work done efficiently, I'd assume.

>trips
The point is most jobs require you to be useless

Based on what?

Why would you have a job where you're useless?

Why would you want that, and why would any employer want that?

Are you assuming that the vast majority of software development shops are managed by bumbling retards who don't have to worry about costs, profits, and getting projects done on time?

Government shops, maybe, but not private sector.

I've yet to see a genuinely useful Vim plugin.

Newfags not knowing what the pajeet and code monkey memes mean. It's OK, since Sup Forums will shutdown soon.

Do you recommend using linters?

F# is so cool.

Haskell is better.

Elixir is cooler.

Haskell has literally never been used for anything useful

At least ML has a ton of industry used interactive theorem provers

Every HLL release

C# is going to devour it soon.

I can see it now; you'll just use a functional keyword and then you can use F# within a code block or something.

public void FizzBuzz(int max)
{
functional
{
[1 .. max]
|> Seq.map (fun i ->
match i % 3, i % 5 with
| 0,0 -> "FizzBuzz"
| _,0 -> "Buzz"
| 0,_ -> "Fizz"
| _,_ -> string i)
|> Seq.iter (printfn "%s")
}
WriteLine("FizzBuzz is done!");

"izzBuzz is done!".ForEach(WriteLine);
}

>Haskell has literally never been used for anything useful
F# has literally never been used or anything useful.

Depends how much work the compiler does. Some compilers do what linters do as well as compile. If it doesn't, you should use a linter too.

Once you learn Haskell syntax you realize it couldn't be more simpler.

Is it weird I pre-plan all my hobby projects for the year, finished all my projects for this year so no programming till next year anyone else do this?

Wrong.
F# programmers get paid.

Haskell programmers get paid to write Java

F# programmers get paid to write C#

I'm helping out a friend with his code. I stumbled upon this piece of work
cout

Someone said Jet.com's backend was written in F#. I thought that was neat.

This is hilariously true.

ObjectMapper.

Never roll your own shit when you can avoid it.

Nothin personnel, kid. Come back when you've passed CS101.

main(){for(int i = 0; i < 100; ++i % 15 ? (i % 3 ? (i % 5 ? printf("%d\n", i) : puts("Buzz")) : puts("Fizz")) : puts("FizzBuzz"));}

What do Erlang programmers get paid for?

I'm trying out splint for C. So far, it's getting on my case for ignoring return values of functions like fgets and not checking for null values. I might try out sparse, too.

Demonstrate to him why streams are worse than printf for your given use case or project.

Staring into the abyss.

Those are important things to check if you want robust software.

Writing C++

json is fucking ass and its syntax is even dumber than xmml.

Made an exploooosion sweeper as a light breather from my big harvest moon ncurses clone project.

Source (A tad bit messier this time): pastebin.com/gBYZCij7

Can someone tell me what I'm doing wrong with my AoC day 1 solution?
It wants me to get the coordinate of the first location I visited twice, but does it want the distance from the origin or from the final point?

It already blocked me for getting the answer wrong too many times, but I just want to finish this shit.

pastebin.com/7pyVbsqB

Oops, forgot about the curses warpper: pastebin.com/cPZYFhUi
Same one as usual.

nice

are you guys even trying?

python 2.7
for i in range(1,101):print"FizzBuzz"[i*i%3*4:8--i**4%5] or i

That's slick.

>concat (map f [1..n])
think, how can you reduce the code here?

how do

unreadable/10

>Uses baby scripting language
>Insults others
LMAO'ing at your life right now rn desu