/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

this is ridiculous

just make a freaking programming section, admins

Thanks for using a non-anime picture

Thanks for not using an animu image, OP.

(defun goy ()
(loop do (princ "what are you?: ")
(format t "~a~%~%"
(if (string-equal (read-line) "a good goy")
"indeed you are!" "not correct"))))

Most programming-related discussion on this board is limited to the three generals and the twice daily Sup Forums shit kid asking how to learn hacking.

I've seen whole days where /dpt/ received less than 20 posts the whole day, a whole board isn't needed.

Reported :^)

Post your Sup Forums resume:

Technologies:
Java, Javascript, HTML, CSS, Spring, MyBatis, Struts 2, Oracle, MySQL, Linux, SVN, Git

Experience:
5 years of Java development
Team Leader for 3 years for 5 projects, 3 of which are ground-up

>Professional Fizz-Buzzer
>Can write Hello World in over 20 meme languages
>7 year experience of shitposting on a taiwanese basket weaving forum

Please recommend books or other resources for learning x86 assembly. :[

= typedef struct {
= int re_magic;
= size_t re_nsub; // number of parenthesized subexpressions
= const char *re_endp; // end pointer for REG_PEND
= struct re_guts *re_g; // none of your business :-)
= } regex_t;

defend this

Where do you live? I can teach you if you agree to watch anime with me

You posted a troll thread after I posted this just so you could bait people with an anime picture. Why did you do that?

Wales. And sure, but I'm an ugly guy.

>Wales
oh... are you one of "them"?
>but I'm an ugly guy.
so am I

>less than 20 posts the whole day
That's still faster than a lot of boards we have here.

"Them"? The Welsh? I'm English.

Technologies:
Monads

Experience:
FizzBuzz
Averaging Two Ints

No, you just came here knowing this thread was made first to deliberately post links to the other one. That too is trolling.

>hidden
I want newfriends to leave

but there isn't even that much to talk about
you're gonna have a whole catalog full of homework questions

And silly poorly-worded challenges.

>"Them"?
Well, yeah... "Them"
>I'm English
Which is what I'm worried about. at least you aren't Scottish

>
>Where do you live? I can teach you if you agree to watch anime with me

Wtb anime watching, assembly writing group. Plus

Post what you're reading!

what command do i use if i want to set the cmd location to users/user_name_here? i dont know what the user name is for each computer tho so i cant just type it in

cd \ goes to C:\ which i dont want

Based.

cd users
dir

Granted, Now I remember why I don't like visiting Sup Forums.

Should I be implementing a queue as a vector of pointers and simply memmoving everything 1 space to the left when taking out the first item in the queue?

no, use a hashmap instead

>memmove
can't you just swap the pointers themselves? Also, std::queue is probably more your speed.

What do you guys think about smart pointers in C++ (std::shared_ptr and std::unique_ptr)? I've been using than a lot in my recent projects after bashing them for a very long time, and I've found that it really does help to keep my code much more maintainable and flexible and the performance is still much better than using a GC.

Use a circular buffer instead.

Hey guys, do any of you have a recommendation of projects to do for beginners in java? Could be a website or an infograph, I have a busy semester and want to get ahead of the curve so I can focus on other classes as needed

ransomware

...

As a follow-up I'm using Eclipse primarily

Nice meme

Saved thanks

you could do a basic CRUD app. find a random db to play with

minecraft

Why do people still defend imperative programming for any reason other than performance and efficiency?

whoops wrong thread

how 'delete' should be actually implemented in c++ compiler?

Nice meme pal but literally everything of any worth ever written was created with imperative programming

Could you elaborate a bit?

Got it thanks

>What are you working on, Sup Forums?

App dev. Really regret not taking this class in college

Whats a must read book for programming beginners ?

find a db file or create your own and read/write/update it through your app

gonna need to know how to do this if you ever work with

DATA
A
T
A

friendly reminder that in C
foo[42]
is the same as
42[foo]

ok

And?
You missed one of the other funny C quirks anyway:
puts("hello world");
(************************puts)("hello world");

heresy

This code doesn't print out the correct number of factors.
Can someone please explain why.


#include

int summer(0);
int getVal(int max) {
for (int a(1); a

what's the logic behind this?

You wrote it in C++.

foo[42] becomes *(foo + 42) internally
so 42[foo] would be *(42 + foo), which is identical

Here's a better one
struct a {
int one;
int two;
};
...
struct a *some_func(...);
...
if (some_func(...)->two > 0)

literally everyone uses c++, get out with your useless meme languages

foo[42] is just syntactic sugar for *(foo+42)
seeing as + is commutative so they are the same

In C, a[10] is exactly equivalent to *(a + 10).
Since the order of the arguments doesn't matter, it's just as valid to write *(10 + a).
Going from there, that makes 10[a] equivalent as well.

Install gentoo

Stop projecting, you fag.
Get some taste.

>Write a function that takes a list of lines from the user, stopping at the first empty line.
>Then print out every word from every line (space separated) but sorts them from longest words to shortest words.

Python example:

def sort_lines():
lines, separated = [], []
while True:
entry = input('Enter a line: ')
if not entry:
break
lines.append(entry)

for line in lines:
words = line.split()
for word in words:
separated.append(word)
separated.sort(key=len, reverse=True)
print(' '.join(separated))


Example Input:

>This post was made to the Sup Forums technology board called Sup Forums
>What is Sup Forums's favorite language?
>install gentoo

Example Output:
technology language? favorite install called gentoo Sup Forums board Sup Forums's This post made What was the Sup Forums to is

Is it difficult for furries to get jobs in software engineering?

so the [square brackets] are basically pointer addition?

Yes. In C, arrays and pointers are very closely related.

yeah basically

i've used arr[-1] many times and it pisses people off when I do it yet it's syntactically legal

why would you do that anyway
dont you risk a seg fault?

How about an actual explanation now

It's even more fun to do:

int array[2];
0[array] = 1;
1[array] = 2;


This is also perfectly valid syntax.

Wondering if anyone would have an idea of how to even go about doing this, any language really, windows:
have a gui window, that can interact with another gui window (offscreen, or unfocussed). I want to have a gui that does what another gui does but on a smaller scale?

WTF I hate C now

>I want to have a gui that does what another gui does but on a smaller scale?
And the prize for the most vague description ever goes to user.

Boys we are making progress.
Still has some really ugly flickering on it and the 'off' parts are not really off, but we will get that fix on some point later. Atleast it kind of werks.

whats the diff between a bat file and sh file?

Can this be done for multidimensional pointer arithmetic?
how about arr[x][y][z] that expands to *(*(*(arr + x) + y) + z)?

One is a bird and one is quiet

bats arent birds you dumbfuck

Windows vs. GNU + Linux

they are just extensions. bat is commonly associated for windows shell scripting, sh is for linux

GUYS GUYS GUYS GUYS cmon man im serious just tell me

It's even more fun when you mix in variables.

int off;
int arr[2];
for (off = 1; off < 3; ++off)
{
(off - 1)[arr] = off;
}


>Can this be done for multidimensional pointer arithmetic?
Yes

The expression a[b] is simply expanded to *(a + b). As + operator is commutative, it doesn't matter if it's a + b or b + a.

Notice how no one responded?

The fuck does that mean anyway? And more importantly, what do you expect the behavior is?

i'm not gonna tell you
you don't deserve to succeed

ok thanks anons

.....Until now

Because I also implemented the shift-in method kind of decent we can also use this to display values.
Next up will be a light barrier, I guess. But not today

Is that a clock you're making there?

Who is pic related?

WTF?

I thought we made fun of JavaScript for shit like this?

A hero

Hey there, Ahmed. Cool clock. Want to bring it to the White House?

He's an expert clockworker, in fact he's the best in the entire united states despite only being 10 years old

>none of your business
Encapsulation in C everyone.

C has simple rules.

x[i]

is the same as

*(x + i)

That's all.

It's the clockmaker

Sure, just let me finish soldering up my CPU first.

>we
javascript is a perfectly good language for it's intended purpose of client-side scripting

fuck off meme boy i bet you think naked pointers are a bad thing too

What is a naked pointer? What is a clothed pointer?

Can someone please help me out.

Just run getFactor(getVal(3));

You will get 6 as a value but 24 for the number of factors.

>defend this
Against what? Faggots who can't write their own RE engine from scratch?

Yes.