/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: maxresdefault.jpg (1280x720, 141K)

>Re-posting for attention.
What's the comfiest language lads? I'm tired of caring so much about memory management and algorithms, I just wanna to relax with some tea and build stuff.

Attached: 1517094039892.jpg (1920x1080, 512K)

I just started a job as a remote contractor.
Working from home feels good.

Attached: 1420229460495.png (485x354, 300K)

It's Haskell.

i don't even code and i know its haskell

Common Lisp

C++17

Lua.
It's cute and fun.

HTML unironically

C++ does it for me. There's nothing more satisfying than creating a million little points on the screen and having them bounce around.

we all know it's Python

Anyone know the name for the pattern formed in base 10 when you multiply by a prime number, and the last digit of the product follows a cycle of fixed size? Like 0 - 3 - 6 - 9 - 2 - 5 - 8 - 1 - 4 - 7 - 0 - 3 - 6 - 9 for 3, and 0 - 5 - 0 - 5 - 0 for 5, or 0 - 2 - 4 - 6 - 8 - 0 - 2 - 4 for 2. I'm going to fuck around with it in higher bases with bigger primes and see what I get, but I wanted to know if there is more information about it first.

Depends what you want build and whether or not you want it to learn a useful language.
I’ve been learning Go and it seems pretty comfy desu, but python and lisp are also comfy.

>0 - 3 - 6 - 9 - 2 - 5 - 8 - 1 - 4 - 7 - 0 - 3 - 6 - 9
add 3, modulo 10

Smalltalk.

Yes, but I mean do the cycles produced have a name?

...

periodic sequence

It's just an arithmetic sequence, starting at 0, adding 3. Addition is modulo 10.

Honestly, either Haskell or Crystal depending on if you prefer functional or imperative.

Nim. It just gets shit done.

He said comfiest not bat shit craziest.

Go with Phix.

HOW DO I LEARN EMACS GOD DAMN IT

D

You stop caring what others think of you and hence stop forcing yourself to use an editor you don't like and then start using a sane editor.

everyone enjoys writing in ruby. the point is to make programming for humans and not machines.

Follow the tutorial
Writing style rules for a programming language of your choice is a good first step too

I'm not doing it to impress anybody. It's just the standard editor for lisps and I want to learn CL and Clojure

you = ("Are you OP? ")
if you == ("OP):
print("{0} is a fucking faggot!".format(you))
else:
print("At least you're not {0}.".format(you))

>I'm not doing it to impress anybody.
Then why are you putting yourself through trying to learn LISP?

What language is that? It's hideous

I'm still lrning

you = input("Are you OP? ")
if you == ("OP", "op"):
print("{0} is a fucking faggot!".format(you))
else:
print("At least you're not OP.")

if you == ("OP", "op"):
print("{0} is a fucking faggot!".format(you))
else:
print("At least you're not OP.")

Ruby is hands down the comfiest. There are better languages, but when it comes to comfiness, NOTHING beats Ruby.

Attached: e6c.png (1200x1800, 1.3M)

The absolute state of programming general. It's fucking python 3, faggot.

import tweepy
from tweepy.streaming import StreamListener
from tweepy import Stream

auth = tweepy.OAuthHandler(api_key, api_key_secret)
auth.set_access_token(access_token, access_token_secret)


class StdOutListener(StreamListener):

def on_data(self, data):
print(data)
return True

def on_error(self, status):
print(status)

if __name__ == "__main__":

listener = StdOutListener()

stream = Stream(auth, listener)

stream.filter(track=["trannie", "MTF"])

>Book on go
>Author low-key shills Rust and Swift
Is this a sign?

Attached: Screenshot from 2018-09-18 12-24-56.png (1972x1694, 327K)

No, rust, Swift have different goals/purposes than go. Probably just wants you to see the intention of those languages compared to go

lol

>PHP
also does anyone have a translation for this?

Attached: 1535305863649.jpg (633x758, 67K)

>6.5 Now be glad Go exists.

Career advice?

I'm planning on moving to Pittsburgh soon. Want to get job asap in software something-or-other-ANYTHING doesn't matter.
Me:
>2 Bachelors in Electrical Eng. and Biometrics
>just graduated last year (in May)
>plenty of computer science and computer science accessories classes
>also did comp sci track in high school, in gifted&talented autist program...fwiw
>so, been programming for a good long time

Thing is, I've been "casually coding" since 6th grade, but only ever fucked around.
My portfolio consists of essentially all the assignments I did solely for school classes that ended up kinda rushed and half-finished once the deadline was past; and one or two pet projects that I got bored of or abandoned after finding another similar, sufficiently-working implementation of the same thing.


Work experience:
>RF technician grunt at a respectable gov't contractor for 6 months post-graduation
>got heavily into crypto/bitcoin and eventually quit to see if I could support myself daytrading
>ended up learning Solidity and freelance writing ethereum smart contracts on Upwork
>charged like $80/hr and made a small killing

And of course, programming exp:
>mostly Java
>some Python
>bit of C (from school)
>minimal experience from dabbling in many other minor areas like webshit (Meteor, Node, general HTML/CSS...) but honestly it's like 1 or 2 codecademy tutorials' worth

I think despite my fucked up focus in specializing my skills, I have at least passable chops to land a babby's first code monkey job considering how long I've been staring at code. Any tips? Am retard? Kms?

Attached: assdrive.jpg (610x814, 102K)

Shh shh we “hate” python here

>def on_data(self, data):
>on_data(self,
>self
How is this tolerated in $currentyear

If you practice your algorithm questions you should have no problem getting some sort of programming job somewhere.

I'm still learning the basics, I copied it from some youtube fgt and I'm not yet sure what it means.

Pretty good for a non-CS major. Brush up on churning out basic algorithmic puzzles on one of the code interview websites. If you can do medium difficulty ones without too much trouble, you should feel ready to interview with pretty much anyone.
Also, Pittsburgh is a great choice! Safe city, cost of living isn't insane, and tech is growing.

>the absolute state of $CURRENT_YEAR programming

Ah fuck I was gonna start EECE in 1 year, am I doomed?

Attached: Blowing-wind-clip-art.png (1024x768, 19K)

Why is this supposed to be a bad thing?

self / this is a special variable that refers to the object it's in

If you have a function in a class that references itself, calling that function changes that instance of the object.

I don't know what he's complaining about. I'm not sure he does either

An object should know itself in a oop lang

It... does? That's what the keyword is

I don't understand what else you think should be happening

Cool thanks goys! I've definitely been slacking hard on actually putting fingers to keyboard coding lately, so I'll brush up. I figured the core principles & logical type of thinking are really what matter.

I'm mainly wondering how to get noticed by employers when CS isn't really how I market myself by default? Online job searches are good for fuckall. Should I go straight for recruiters?

maybe because it's passed as a parameter?

i think I once found it funny when I moved from Java to Python

Lads, LaTeX or Indesign for resumes/CVs?

Python objects are too brainlet to remember their own identities
java:
void clear() {
while(! this.isEmpty())
this.pop();
}

ruby:
def clear
pop until self.empty?
end


There are lots of latex templates for resumes. I don't know what Indesign is or does sorry.

absolute garbage language design

About how many recursive calls can you make before a stack overflow Jow Forums?

"It depends".

On what exactly? I'm only passing an int

- How the recursive function is used (i.e. is it a tail-call)
- How many functions are already on the call stack
- How large the stack is (depends on OS and local configuration)
- How many stack space is used for a call
Aside from the first, there is no reliable way to work this out and anything you come up will be very unreliable.
Basically, don't create deeply recursive functions. If it scales any worse than logarithmically, it shouldn't be recursive.

The exception is if the function can be tail-call optimised, meaning that the compiler will actually transform it into a loop and it can recurse forever.

a couple
>> def ree(n)
>> puts n
>> ree(n+1)
>> end
=> :ree
>> ree(0)
0
1
[...]
9339
SystemStackError: stack level too deep
from /usr/lib/ruby/2.1.0/irb/workspace.rb:86

int i, j, k;

i = 1; j = 1; k = 1;
printf("%d ", ++i || ++j && ++k);
printf("%d %d %d", i, j, k);


yields:
1 2 1 1, instead of 1 2 1 2 like I expected. I understand that j isn't incremented because the logical or short-circuits once it evaluates ++i and returns a 1, but why wouldn't k increment as well? && doesn't short circuit unless the left expression is 0.

undefined behavior

&& and || have different amounts of precedence.

++i || ++j && ++k is equivalent to ++i || (++j && ++k).

Java
public class Ree {
public static void main(String[] args) {
ree(0);
}
public static void ree(int n) {
System.out.println(n);
ree(n+1);
}
}

score: 7400

C
#include
void ree(int n) {
printf("%d\n", n);
ree(n+1);
}
int main(char** argv, int argc) {
ree(0);
return 0;
}

score: 523776

Shit, thought they were the same.
thanks

>char** argv, int argc

Attached: 1376908007763.png (318x318, 133K)

Fodder control system. Drain, fill of main water barrel. Schedule for water {solenoids} & lighting

comfy langs are best langs
>comfy practical
Ruby, Kotlin
>comfy elegant
Scheme, Standard ML, Smalltalk

Thank you anons

I don't know C ¯\_(ツ)_/¯

Any resources for android dev? Just following the official tutorials atm.

Attached: Thumbs-up.jpg (626x480, 45K)

based kotlin user

Attached: kotlin-chan.jpg (521x800, 247K)

for num in range(10):
# do_stuff

print(num) # 9


Am I the only one that finds this counter-intuitive? Does Guido understand lexical scoping?

Bamp for advice on scoring an entry level job?

Right now I’m just grinding on monster and linkedin job search but I don’t expect that to go anywhere at all. Speed is the key here. I don’t care where the fuck I end up as long as someone, anyone offers me a regular ol’ coding bitch boy job in scripting or webdev or whatever, with a salary anywhere north of >$50k.

Attached: 1508983525979.jpg (1560x2048, 302K)

Oh yeah and related q, are those skeevy recruiters like Cybercoders or Randstad worth paying any attention to or are they total shit that exist only to spam up job boards?

i have to learn C++ for my data structures course, and all I know is C, and people are telling me that knowing C makes it even harder to learn, since C++ and C are nothing alike and C++ isn't just C with classes. How fucked am I? Would Accelerated C++ be a decent book to go through? I only have until the 28th.

C++ IS C with classes and the people you spoke to are asshurt C++ elitist shills mad about their disgusting language. It'll be trivial to learn.

When people talk about C++ they talk mostly about two things besides being an OOP C, templates and the STL. Neither of which are all that hard.
Templates are just functions that happen at compile time, they can be standard or variadic. Nothing too complex, but very verbose. I'm talking Java-tier verbose.

The STL, forget it. Takes a lot of time to master. But I seriously doubt they're expecting you to know it.

You will find yourself extremely disgusted by C++ and how anybody could possibly take that language seriously.

Holy moly the spineless tagless G-machine is really cool.

1. Learn about classes. Polymorphism, encapsulation, inheritance.
2. Go through each revision and see what changed on each one.
3. Get used to lambdas, range based for loops, list initialization
4. Learn a bit about the STL. If you don't have time I would at least suggest you to understand smart pointers.
5. Learn templates if you can. At least the basics.

Extra stuff if you have time
6. Variadic templates
7. static asserts and how they are used to make templates type safe
8. RAII

PHP

Doubt it

no, go with times new roman .doc, nothing fancy

i tried doin some bullshit like write it in .html and send it as .pdf but .doc will always get more hits for some reason

>Mom calculated the Tukey's ninther

Attached: 1536636142019.jpg (322x640, 21K)

As a licensed fizzbuzz expert, I'll have to say Haskell

Look at those old hags

Lisp

Matlab, obviously. Please don't tell me that you aren't using programming to run simulations or do math.

Gauss did not have Matlab and he discovered more than all people who use Matlab combined

>7. static asserts and how they are used to make templates type safe

Someone hasn't learnt his enable_if

if __name__ == "__main__":

What the fuck is that? Get your fucking toy language out here.

I wish I was alive with all of that low hanging fruit

>use gdb's remote debugging on qemu
>press ^C to pause
>qemu receives SIGINT and quits
i fucking hate programming

If you were actually worrying about those things, you would've made your own personal library in your preferred language by now.

go

get a real computer user :^)

i do not own this extremely expensive discontinued arm development board

Windows 7 Ultimate doesn’t have this problem

What a retarded comparison. The yuse different stacks izes, and are eglibile for tco (java doesnt do it though)