/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

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
commons.wikimedia.org/wiki/File:Blank_whiteboard.jpg
youtu.be/WjOoC6bzMCk?t=205
twitter.com/SFWRedditGifs

Python doesn't use braces, time to move to python

re-writing WASM in JS

...

>"pointless" braces
dropped xD

i see the Lisp fags are riled up again.

>enter the room
>see pic related
Your move, user?

Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; 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

Draw a penis

>Unlike RAII. Which is a a massive overhead.
Explain

rdmd is kewl to bee honest
ability to write small nifty "scripts" in a non-retarded language is neat

Dub is also really handy.

*sums the reciprocal of primes over 20 million*
*get a finite result with the zeta function*

Yeah, it was actually one of the reasons I started learning it. After reading some stuff on dlang-chan, I learned it was designed to pretty much handle any situation--hence "general purpose".

once upon a time on the interview I summed up infinite natural numbers series to -1/12, guys were baffled lol

Damn. that picture.

In between that guy's skin complexion and the light on his face.. he already is a painting.

I know this is like First Grade stuff, but first time try-er here

How to I position Images as same Height (next to each other) while Also scaling

So far I set the Image height 1500px but it just scratches the image... looks ugly

/wdg/

hi /dpt/ i need life advice, should i get a job after graduating or apply for masters programs at prestigious universities and get into a lot of debt? should i keep going and get a phd after that? should i aim for masters programs that are research intensive, or coursework intensive if i do that? should i work for a few years and then get a masters? work for one 1-2 years? not get a masters at all? help me

Do you really want to spend the rest of your life in academia?

>and get into a lot of debt?
Jesus christ no. If you want a Masters or PhD, try getting funding for it via grants or similar. If you can't, then get a job.

modules ruin all fun, my own recursive folder scanner is so much slower than glob ree

def copytree(src):
for item in os.listdir(src):
src_item = os.path.join(src, item)
if os.path.isdir(src_item):
print(src_item)
copytree(src_item)
elif os.path.isfile(src_item):
print(src_item)

# TIME
# real 12.62
# user 1.12
# sys 1.45

def globby(src):
for item in glob.glob(src + "/**", recursive=True):
print(item)

# TIME
# real 2.77
# user 0.80
# sys 0.68

They're both horribly slow

education in _good_ places >> anything else, if you ask me
networking, skills, prestige, options, you name it

not an American though so I don't really understand your debt shenanigans

>doing grad studies without funding
Can't think of a more cucked thing.

how can I make it faster?

>recursive
Found your problem

all the affordable universities are 90% foreign students. it spooks me a bit, as if they're just selling degrees for the money. i really do want a masters degree at some point, but i've also heard from professors that if you're not doing research in a masters program it's worthless, while seeing that top schools have masters programs with zero research and all coursework

Write it in C. Multithread it and make a bunch of speculative system calls in a separate thread and process the tree you've saved in memory.

You probably don't care that much.
If you're asking how to make your version as fast as the library just look at the library.

>I'm afraid of foreignites
>.t American
Surprising..

>C
Garbage.

Why are you re-inventing the wheel?

>anything else
Garbage.
I'm hoping for JAI. Or D. Doubt D will be all that great though.

>foreignites

I'd just like to interject for a moment. You appear to be using an element from this image in your post: commons.wikimedia.org/wiki/File:Blank_whiteboard.jpg
You may have done this accidentally, but you've violated the terms of its copyright license. This is a serious offense and I hope you take it as seriously as it deserves.
Not to say that you're not allowed to create derived works from this image, you are, but this picture is released under the Creative Commons Attribution-ShareAlike 3.0 Unported license. Therefor, you are free:

to share - to copy, distribute and transmit the work;
to remix - to adapt the work;

Under the following conditions:

attribution - You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
share alike - If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

In this case, the attribution requirement is resolved simply by including the following in your post:

Photo © BrokenSphere / Wikimedia Commons, CC BY-SA

Now that you have read this, I hope you have a better understanding of your rights and obligations when remixing and sharing this work. They will let you edit, now be nice and credit~

disgusted and foreigners are the words you're looking for, pajeet

>not an anime image
REEEEEEEEE

Oh user you're not even using TCO!


Ohwaityoucan't. Rewrite it in C.

If they are selling degrees for money, what's wrong with it, are you against free market?

the figures i look up to have masters degrees and phds. but i don't feel like they got them because they needed them to get a decent job, i feel like they got them because in those days it was prestigious and you did cutting edge research

youtu.be/WjOoC6bzMCk?t=205

pics or it didn't happen

write it all in assembly

dumb implicit frogposter

C doesn't guarantee TCO either. Of course, a real programmer can optimize their own tail calls and doesn't need a compiler to do it for them.

is there any way to block indian programming tutorials on youtube?

Stop searching for information on youtube.
Avoid language specific searches.

>C doesn't guarantee TCO either
Sure, but it's a low-hanging fruit that any compiler would take.

Quick question, Java:public class Person {
private String name;
private int age;
private int weight;
private int height;

public Person(String initialName) {
this.age = 0;
this.name = initialName;
this.weight = 0;
this.height = 0;
}

public void setHeight(int newHeight) {
this.height = newHeight;
}

Why do they use this.variable every time? Wouldn't it work the same if they just type height? Is it just a conventions thing or is there a functional reason? For example: public void setHeight(int newHeight) {
height = newHeight;}
would do the same thing, wouldn't it?

Yep, that would be the same. However, one can argue that using this.height makes it more readable, however bullshit that claim may be.

W-what happened to Dlang-chan? She looks different.

Also doesn't it help with disambiguation between constructor/setter arguments and instance variables? Or does Java not allow them to use the same name?

She finally looks like how the language looks: like trash.

The autist got bored of her previous incarnation and moved on to the new hot thing, much like how people (rightfully) moved on from D.

Alright Sup Forums, you have 10 minutes to name what features your ideal language would have. Then I'll tell you how dumb you are.

t. Rob Pike

dlang-chan v1 wan't cute enough for how D makes me feel. Also, and more importantly, the first iteration of her was too influenced on what I was watching at the time. Decided to separate the two.s

post yfw this works
setHeight (int height){
height=height;
}

read macros

...

Natural language-like syntax; none of this _();}; malarky.

its like go but good

You don't have to in most of these language. Can't recall Java specifically.
But yes you could have the scope of a member function import member symbols without a this pointer/reference.

I've been thinking about a programming language design for a while now, but I can't really be bothered explaining it.
It's really just C with legacy cruft removed, and a better type system which could allow for better optimisations.

...

alright I made a similar one without recursion, and it was significantly faster. recursion really sucks, I'll never listen to recursionfags again.

def norecursion(src):
folder_list = [src]
while len(folder_list) is not 0:
src = folder_list.pop(0)
for item in os.listdir(src):
src_file = os.path.join(src, item)
if os.path.isdir(src_file):
print(src_file)
folder_list.append(src_file)
elif os.path.isfile(src_file):
print(src_file)

real 4.85
user 0.93
sys 1.30

you're right I don't care too much right now, but I'm interested in how I could maybe optimize it (in Python). I'll try multithreading another day.

I was just making something simple to sync two folders and wanted to compare my own method to a module 4fun

There is that language that does that, I don't remember the name. Plot twist: it's in French.

A high level way to deal with the low level details of hardware that's more productive for what I do with low level details.

I don't know what that'd look like. Sounds pretty messy.

There's not much else that's needed.

>recursion really sucks, I'll never listen to recursionfags again.
It's because there's no TCO. Recursion is gonna be slower if you don't have TCO, that's a given.

It's often easier to write recursive versions of things though. Even if handling the stack often is a very straightforward translation.

who started the recursion meme anyways? The guy who got me into programming taught me to always use recursion. I mean it's cool looking I guess.

I'm going MAD

With Flask_sqlalchemy, how do I convert an entire database table to json?

The best I've managed is to make a

var = Table.query.get(1) variable with only one row in the table. Then I can jsonify like
jsonify(username=table.username,
profilepictureurl=table.profilepictureurl,
city=table.foo,
gym=table.boo)

and when I print(var) I get

when I set var to var = Table.query.all() I get
[, ] when printed instead, and when I try to jsonify the var it just says the table Model isn't serializable

I'm begging you, I've looked all over for hours.

>case insensitive
>goto labels and functions are interchangeable
>operator overloading as syntactic sugar for function calls
>standardized name mangling/ABI
>member functions (but they're really just pointers to regular functions with an implicit first argument)
>optional gc

>guy: what kind of frames for your spectacles are you after?
>baldlet: i wanna make elton john look straight
>guy: say no more!

oh, and destructors/RAII

It started in mathematics, which is disgusting left-wing trash.

i did a lot of java in high school/college a couple years ago and i'm trying to get back into some coding. is java still relevant or should i try something new? also, does anyone have that project idea list? i'm feeling distinctly unoriginal today on project ideas

...

>meme

Math is a form of anime. And anime is strictly right wing.

Still relevant certainly. One of the biggest languages.
I don't like it though, same with many other people.

Working on a mobile App. Making it offline first. Hard as fuck because it has a lot of legacy code, half-way reactive implementations, not fully MVP architecture.

>recursion really sucks
This. Turing complete languages are garbage.

Can someone explain the purpose of function prototypes aside from making things less confusing or w/e.

They are useless.

>mobile App.
Not programming.

They make the compiler know how to call function from other translation units without needing their full definition.

Oh golly gee, looks like the gate keeper is back. See you bois after 9 hours!

good to hear. i guess i just need to get some creativity lol. thanks!

Right. It can be shown that the category of anime is equivalent to the ω-category.

Write down a quick proof of the Collatz conjecture.

Mathematics isn't programming.

Why is that not programming?

Do not respond to bait, user.

Why does larry wall look like a pedophile?

He says that because he's retarded.

All men look like pedophiles to lolis, right girls?

Hai oniichan uguu~

Weebs get out

Programming (not to be confused with c*ding (what most """people""" here do)) is a form of mathematics. Which means it's a form of anime.
And category theory itself is a form of anime.

are mobile apps proofs?

Its onee-chan! Just because I like sports doesn't mean I'm a guy!