/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

tour.dlang.org/
wiki.dlang.org/Books
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes
willrobotstakemyjob.com/15-1131-computer-programmers
stackoverflow.com/questions/44491684/linker-sees-wrong-version-of-pthread
twitter.com/NSFWRedditImage

Oh my god why doesn't gtk has things like Qtcreator

what language best solves the everything is fucked and we're all gonna die problem

have*

It has glade.

Hooking up signals is a pain in the ass

Good pic.

>tfw when you're trying to program a directx12 decompiler and get a BSoD followed by fatal HDD disk error
>can't recover files with linux live USB or any file recovery tools

>fatal hard disk drive disk error

Write a function that counts the number of unique elements in an array

I'm in.

Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; she's becoming fully memory-safe; and she's super duper cute! Say something nice about her, /dpt/!

>Tour
tour.dlang.org/
>Books
wiki.dlang.org/Books
>GC
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes

ban yourself

Don't hate, user; just masturbate.

ryzen or i7-7700k @ 5 GHz for programming?

Get one of each and then shove them both up your ass and use an Apple ][ for programming

...

I took up Python 3 awhile ago and C++ about two weeks ago. So far, for C++, I've been reading
>Programming: Principles and Practice Using C++, 2nd Edition
>C++ All-in-One for Dummies, 3rd Edition
and for Python 3, I've been reading
>Learning Python, 5th Edition
>Starting Out with Python
Are there any other decent books or video tutorials that get more into the pragmatic stuff? I feel like I'm in that awkward middle stage between beginner and intermediate where no books, practice exercises, or tutorials cover.

>Python
>C++
There is no hope left for you, your brain is permanently damaged

willrobotstakemyjob.com/15-1131-computer-programmers

start worrying

Go back to your Sup Forums tier shitpost thread

Someone has to program the automation bots, user.

It makes no fucking difference. You can program on a toaster.

Wagecucks BTFO

Do you like housefires?

>linux cuck doesn't use an IDE

A low end machine with quality components and a keyboard you like. It's going to be you programming machine for the next decade.

What?

So this is the power of a wintoddler

>low-end
>quality
lmao

An Sempron on an Asus motherboard with on board graphics, a 500gb WD hdd and 4 GB of SamDisk Ram is low end and high quality.

a=['a','b','c','c','d']
history=[]
unique=0
for each in a:
if each not in history:
unique+=1
history.append(each)

>>> unique
4

>winfag needs an IDE to be able to work

To be fair, some languages are really fucking annoying to program outside an IDE, such as Java.

>ryzen or i7-7700k @ 5 GHz for programming?
no.
get a shitty laptop and learn to code right.

I regularly program java in nano, but I gotta keep the java docs open in the background tho, i know what you mean

you can use an IDE for most languages. linux C fags who aren't complete brainlets still use vim/emacs with a ton of plugins

What is an ``IDE"?

integrated development environment
a text editor with a compile button

I'm starting to get bored with this corporate webdev / application bullshit. What is some interesting stuff I can get my autism on with like Koitlin, linux system programming, assembly etc? I already know those and am looking for something similarly complex and fun

(length (remove-duplicates #(1 2 3 2)))

what language is that?

import std.algorithm: count, sort, uniq;
auto result = given_array.sort().uniq.count.writeln;

array=['1','2','2','3','4','5','5']

def count_unique(array):
return len(list(set(array)))

>>> count_unique(array)
5

write a function that determines if two integers are coprime

I'm assuming the answer is the number of elements without duplicates. So 3 for the Pythonista and 2 for the lithpfag.

C#
static int uniqueElements(T[] arr) {
return (new HashSet(arr)).Count;
}

>I'm assuming the answer is the number of elements without duplicates
Im pretty sure it means the number of unique elements ie total number of different elements

Could be. Weigh in on this,

(defun coprime-p (a b)
(declare (integer a b))
(= (gcd a b) 1))

def is_coprime(x,y):
while y:
x, y = y, x%y
return x==1
a = 158
b = 228
c = 777

>>>is_coprime(a,b)
False
>>>is_coprime(a,c)
True

ugh. I see what you mean now that you point it out

Thats vaguely worded. could go either way.

There is literally no need for garbage collectors anymore.

Please elaborate.

wow literally one bot and no person besides me viewed my question

stackoverflow.com/questions/44491684/linker-sees-wrong-version-of-pthread

dont tell that to c fags

Your existence is proof to the contrary.

ok i deleted it

i tried building from the command line and now it works

it works in eclipse too suddenly

JESUS CHRIST

>a text editor with a compile button
kek its sad how true this is

just turn it off and on again

Have you tried unplugging your router, waiting 30 seconds, and then pluggin it back in?

nvm it doesn't work to build it from eclipse, it works to run what i built from the command line but when i edit the code and rebuild from eclipse it doesn't work again

but it works from the command line even though it's supposed to be equivalent

maybe this is a sign to give up your crappy IDE

just use emacs

You should reboot your router and see if it helps, those things need to be reset occasionally

not even a function, and items have to be atomic
(compose #'length
(rcurry #'remove-duplicates :test #'equalp))

How do I convert a CPU model name, a /proc/cpuinfo file or a list of cpu flags into gcc cflags?
Let's say I want to compile a program for a large number of different machines (compilation is done on a single machine so I can't just -march=native), how do I figure out the -march etc. for each without having to look each CPU model manually?

Is there some CPU database with their preferred cflags anywhere?
Or a tool that converts shit like fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave avx f16c lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm arat pln pts into cflags?

Am I better off just installing the compiler on each machine and compiling natively? Because that seems like a waste of time.

non standard

...

stocks?

Just to be clear, you're not doing this "by hand," right?

Curious what some of my betters here on /dpt/ would do in the case of getting a computer virus. I know the best answer is not to get one in the first place, but say your sister/daughter did it or something.

Are you a bad enough dude to hack out the virus using your own coding? How do you do it?

I'm legitimately curious what people better than me at low-level/system stuff can do. Even hearing somebody's anecdotal bragging story would be interesting. Would/does/has your ability to program help you fight virii?

This is actually GBPUSD.
What do you mean? At first I hand coded the data just as a proof of concept, but then I wrote a quick and dirty Python script to scrape real data off a broker's website.

No. Don't even bother. Wipe it and reinstall.

>but then I wrote a quick and dirty Python script to scrape real data off a broker's website.
Oh thank god

You might laugh though because the Python script just prints out the data as C source code for an array which I then compile, so the OpenGL program is using a static array of data, so in a way it is kinda like doing it by hand.

Some of these are legitimately retarded. Good luck replacing TA's until you design a robot with AI that can walk around a lecture hall and act like a secondary professor.

...

>text editor with a compile button
>what is integrated documentation
>what is refractoring helpers
>what is integrated version control
>what is context aware code completion

emacs can do all of this and more.

I'm still supposed to help her with her CS homework tomorrow.

What's a good java one-liner to fuck up her macbook air running under default privileges?

i made a shitposting discord bot but nobody wants to use it ;c

butthurt IDE kiddie detected

It's called calling her on a telephone and telling her to fuck off.

Nah, I'm at least going to try to recoup my losses by getting some fun out of this one.

Is there anything emacs can't do? Hell, it can pleasure a man nowadays.

Assuming I'd find the file, I'd probably check it with IDA, but I doubt I could do anything meaninfull

you're being used, you ain't getting anything back

just alias java to something like rm -rf ~/*

That won't run without root on OSX, will it?

C here. What type of array?

~ is shorthand for the home directory.

count_uniques = lambda x: len(set(x))

Amd howany hours do you have to spend on configuring all that, then learning hoe tonuse emacs efficently?

I can programm fine without an IDE, but I don't see why shouldn't I make my job easyer.

How many hours do you have to spend on configuring all that, then learning how to use an IDE efficiently?

OSX and linux both use bash

You're a fucking retard.
>3DPD

A heterogeneous one.

y tho

it's retarded but depending on how you look at it, students are already using bullshit tablet/chromebook apps as "teaching" aids