/dpt/ - Daily Programming Thread
Old one approaching bump limit.
What are you working on, Jow Forums?
Discord: discord.gg
/dpt/ - Daily Programming Thread
Old one approaching bump limit.
What are you working on, Jow Forums?
Discord: discord.gg
Other urls found in this thread:
bookofzeus.com
twitter.com
all non discord niggers gtfo
The official /dpt/ drink!
kys
>not drinking Monster
post your code
nice shit language
starting with nested loops in java need explanation on this, what´s going on here?
int x = 20;
while(x > 0) {
do {
x -= 3;
} while (x > 5);
x--;
System.out.println(x+"\t");
we /sec/ now boys
idk lol
>determines if there are back-doors
lol
Who are some good programmers that make youtube videos of themselves live coding
instead of insulting me you could help me
>what´s going on here?
syntax errors
Firewall(){
printf "\033[1;31mSetting up firewall...\033[0m\n"
#--------- Setup Firewall ----------------
# Flush/Delete firewall rules
iptables -F
iptables -X
iptables -Z
ufw enable
ufw logging full
ufw deny 23 #Block Telnet
ufw deny 2049 #Block NFS
ufw deny 515 #Block printer port
ufw deny 111 #Block Sun rpc/NFS
#Disables IPV6
sed -i '/^IPV6=yes/ c\IPV6=no\' /etc/default/ufw
# ?lock null packets (DoS)
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# Block syn-flood attacks (DoS)
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
# Block XMAS packets (DoS)
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
# Allow internal traffic on the loopback device
iptables -A INPUT -i lo -j ACCEPT
# Allow ssh access
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
# Allow established connections
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow outgoing connections
iptables -P OUTPUT ACCEPT
# Set default deny firewall policy
iptables -P INPUT DROP
#Block Telnet
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 23 -j DROP
#Block NFS
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 2049 -j DROP
#Block X-Windows
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 6000:6009 -j DROP
#Block X-Windows font server
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 7100 -j DROP
#Block printer port
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 515 -j DROP
#Block Sun rpc/NFS
iptables -A INPUT -p udp -s 0/0 -d 0/0 --dport 111 -j DROP
#Deny outside packets from internet which claim to be from your loopback interface.
iptables -A INPUT -p all -s localhost -i eth0 -j DROP
# Save rules
iptables-save > /etc/iptables/rules.v4
#If you ever need to block an IP address - bookofzeus.com
printf "\e[1;34mFinished Firewall() function!\e[0m"
echo ""
}
SUPER SECURE
holy shit this is good, saved, thanks user
could you at least fucking explain WHY?
Why don't you just use a code editor and see the big squiggly red lines saying "hey retard you forgot a closing bracket"
i just use implicit deny on my ufw rules.
i don't know anything about IP tables does this really stop DoS?
search "do-while" loop and learn to use [{code] tags
oh
ok here´s the whole thing:
public class What {
public static void main(String[] args) {
int x = 20;
while(x > 0) {
do {
x -= 2;
} while (x > 5);
x--;
System.out.println(x+"\t");
}
}}
it returns 3 0 but i just don´t know why...
ask stackoverflow
not even at bump limit and the discord fag makes a new thread, what a shocker
welcome to Jow Forums, now, fuck off!
use code tags and actually indent your trash so it's readable and easy to spot problems with braces
how have you not picked up on this crap from looking at code examples
I don't know how to format it can you send a screenshot please
is this bait or are you genuinely retarded?
How the fuck am I supposed to know how to just use "code tags" without any example? I'm pretty pissed at how ignorant some people can be
lmao this
it amazes me how people just refuse to read the sticky and have the gall to demand answers that are found in it
lmao this
>multiple threads advertising the same discord "server" with different join links to bypass spam filter
>trolling this hard _all_ Jow Forums generals
kys
stupid fucking animeposter get off of my website
most unhelpful /dpt/ thread to date, this board has gone to shit.
what the actual fuck are you talking about
learn to
use
code tags
then
f
a
g
g
o
t
My web framework is coming along nicely. The syntax is lisp, instead of some stuff piled on top of HTML or JS. Compiler is programmed in C. The end goal is that I will be able to rewrite my website in it, and never have to use HTML or CSS ever again. It has everything necessary to be turing-complete, I just need to add something like a def expression or similar. It can be used as a CGI script, and I can precompile it to itself so the scripts are faster when called.
gib font
The inner while loop decrements x like so- 18 16 14 12 10 8 6 4.
The inner while loop ends when x is 4, because 4 is less than 5.
Then you subtract 1.
Then you print.
x is 3, and 3 is greater than zero, so you repeat the outer while loop.
you subtract 2 again. 3-2=1
1 is less than 5, so you don't repeat the inner while loop.
Then you subtract 1. 1-1=0
Then you print
x is 0. 0 is not more than 0, so the outer loop doesnt repeat.
thanks user for contributing to the thread
bump
the state of C++
struct Foo
{
Foo() = delete;
};
Foo bar{};
Why do people still use this grandpa language?
C++ is the future, it's such a powerful language.
why the fuck are there 3 /dpt/ threads
the absolute state of Jow Forums
You mistyped bloated
kill yourself faggot
instead of anime vs non anime image its now discord vs normal people
seconded
what's the best place like project euler where I can do some practice problems? need to git gud at python
>inb4 shit language
Don't bump your shitty attempt at /dpt/. Nobody posted here because of your faggy discord thing and because you didn't even link it to the past threads.
Using DPT.png does not exempt you from being a newfag.
bumped
type code in square brackets []
almost done with a "tagging" CLI app in Ruby I've been working on all day.
One question, though. Is the way I'm mapping from a key to a function correct? I want to avoid having a huge nested if statement, and I think this should work, but I'm not sure.
why would you even need to link it to past threads? what the fuck even is the purpose of that.
Often, people have questions towards the end of the thread, and you want to be able to follow the entire conversation across threads. If you don't link it, you can't do that.
ill make sure to do that next time then thank you
Lisp is the most powerful programming language.
>not scripting in bash
bumping just because of this