Post Your Code Thread

Last one died

What are you guys working on or learning?
Share your pretty, pretty code.
Have a simple full port range TCP service scanner I just wrote, on the house

Attached: slashgwizz.png (1366x768, 85K)

Other urls found in this thread:

doc.rust-lang.org/1.5.0/book/patterns.html
twitter.com/AnonBabble

Any particular reason to stick with the old test, when you explicitly write a Bash script?

Something something portability
But in all honesty, I just don't like using double brackets.
If I wanted to do some wildcard matching or something, then I'd probably use the new test

learning fullstack webdev for my personal projects
working with c#/php/mysql irl

Attached: Screenshot from 2019-09-22 01-04-57.png (1557x761, 216K)

What sort of personal projects do you do need it for? Also, classy language choices

i am doing sicp but i know nothing about lisp so the code is bad

>Share your pretty, pretty code.
Let me show you my ugliest code instead

Attached: Screenshot from 2019-09-22 09-12-43.png (3840x2160, 508K)

>uni makes us use svn
>uni makes us javadoc comment everything

Attached: 2019-09-22-091308_1920x1080_scrot.png (1920x1080, 217K)

For now, a spotify clone but using legally correct sources so I don't have to delete my site.
For example, scrapping youtube would be nice
Otherwise, I have other ideas, but it's far too specific for me to talk about here.

Why dont you have syntax highlighting?!

Is syntax highlighting too mainstream?
Also, any language that considers => a valid piece of syntax is retarded imo, Mozilla-approved or otherwise

What font is this?

Iosevka

Javadoc comment everything sounds like good practice, if you intend on doing it as a career

>any language that considers => a valid piece of syntax is retarded imo
That's a pretty retarded opinion to have

But, what the fuck does it mean?

Syntax highlighting is distracting.

-> is a very sane syntax. I'm glad C++ understood it back in the C++ days.

I don't have a problem with ->, but what is => ?

what happens if any of those args are passed as nulls?
your object will be left in an uninitialized state, leading to runtime errors somewhen and somewhere later.
please sir consider throwing an exception.

oh, that
it's just a part of pattern matching syntax
doc.rust-lang.org/1.5.0/book/patterns.html

Is your uni making you write junit tests too? Lol

Look up how ML deals with that (as in, Meta Language), and you'll see why I thought it was retarded.
This is honestly the first time I've actually seen Rust code; I thought it was supposed to be like the replacement for C++, but it seems a bit too declarative for that ... how well can you do low level stuff functionally?

>Look up how ML deals with that (as in, Meta Language), and you'll see why I thought it was retarded.
Doesn't ML just use "->"? That's basically the same thing. Are you really going to be that nitpicky about the similar-but-slightly-different characters any particular language uses to implement a specific syntactical construct?

ML uses -> for types.
ML uses => for the case pattern matching too, and also for defining functions because having symbols mean different things in different contexts couldn't possibly make the code any less readable...

To be fair, if Rust only uses => for the pattern matching, then maybe it's not so bad.
But ML ruined => for me forever

Yes, using JUnit 4

your tabulation is hideous my friend. 2 or 4 spaces at most, please.
also just learn vim, everyone knows nano is for people who are too stupid to learn vim.

We're not allowed to throw any non-runtime exceptions that aren't in the spec

>implying I use spaces
Those are tabs, my friend.
Also, it's 24 lines, I could write it on a post-it note, scan it through my printer, get an AI trained to my handwriting to interpret the scan; paste it into a proprietary text editor, and then change the file extension to .sh faster than I could install and learn to use fucking vim.

T. babby

This is a Post Your Code thread, not a 'Promote carpal tunnel' thread. Post code or gtfo

I don't know anything about ML. What does ML do to for you to think => is retarded?

> but it seems a bit too declarative for that
It is, same thing in C++ would require many more STL boilerplate.

> how well can you do low level stuff functionally?
I don't know how to measure wellness in this context

Attached: Screenshot from 2019-09-22 10-06-33.png (3840x2160, 476K)

Attached: scriptkiddytime.jpg (1280x720, 122K)

...

In command mode:
i - to enter insert mode
:w - to write to file
:w /path/to/file - to write to /path/to/file
:q - to quit

In insert mode:
- to enter command mode

Other simple things that change your life:

In command mode:
dd to delete line
dw to delete until end of word

p to paste something that you just deleted or copied (consider d like cut for cut and paste)

All you really need is :q! though.

If I gave that much of a shit, I'd use an IDE

Attached: wifiscript.png (1366x768, 84K)

Apparently I used the new test here, so discard everything

based powershell, so proprietary that it even has anti-screenshot capabilities

I laughed, dig at Microsoft, Powershell, and my screenshot. But it's opensource and written mostly in C#.

I don't think your screenshot software can C#

who #cudagang?

Attached: workingcode.png (1884x942, 78K)

lol you don't need to use env for bash. it's pretty ubiquitous that bash in /bin.

>Something something portability
Then use /bin/sh

IllegalArgumentException is a runtime exception

>having symbols mean different things in different contexts couldn't possibly make the code any less readable...
No wonder ML is such a symbol hell. I'm happy to use * for de-referencing and multiplying.

>Share your pretty, pretty code.
i dont have one i sucks
but its werck!
ARRAY=()
while read p; do
if [[ " ${ARRAY[*]} " == *" $p "* ]]
then
echo "$p"
echo "already scanned"
echo " "
else
echo "$p"
ARRAY+=("$p")
echo "adding to the array list"
echo ${#ARRAY[@]}
echo "!!found something!!"
host "$p"
nmap -T5 "$p" | grep open
whois "$p" | grep country
whois "$p" | grep Address:
whois "$p" | grep City:
echo " "
fi
done