/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtube.com/watch?v=hk9SYguokjE
strawpoll.me/12426079
tour.golang.org
twitter.com/SFWRedditGifs

decompiling gentoo linux

>an honest mistake
Let's wait for C defense force's official response

"LUL U MADE A MISTAKE U CAN'T EVEN HANDLE C XDXDXDDDD THOSE SECURITY BUGS ARE FROM PEOPLE JUST LIKE YOU :DDD"

I asked in the last thread, I will ask here in the hopes that someone will answer. If someone could kindly tell me where I might find the netbeans for java in pdf form, I would greatly appreciate it.

setting up visual studio to remotely connect to gdb in a VM.
still have no idea what i'm doing really.

Textbook, I should say.

...

ask netbeans forums

>tell me where I might find the netbeans for java in pdf form
>pedofile form
No thanks.

>holding on to old and deprecated retro trash
'c' users, everyone

And no, C compilers don't check for many preventable errors

There's a lot of errors that can't be detected easily, but undefined macros or identifiers are trivial to detect.

Did a C programmer cuck you, or something?
Why are you so salty?

C stands for cucks

He's been samefagging for quite some time now. It's rather entertaining to be honest.

So you were cucked by a C programmer, then?
C stands for Cuckolder, apparently.

this is you

youtube.com/watch?v=hk9SYguokjE

C also stands for communism, so it makes sense if C means Cucks

>want to order pizza online
>can't go online without using an operating system written in C
>tfw the Cnet wants me to starve

Whatever you say, you literal cuck.

>c.uck
I'm not

I browse Sup Forums with my Lisp Machine.

Jokes on you I use Redox.

Okay so can you anti-C shills explain why this isn't a good way to average two integers?

long double average(const signed long long a, const signed long long b)
{
register const auto long double c = a + b;
return c / 2.0;
}

>const signed long long a, const signed long long b
God I hate C

learning how to use PostGIS to make a routing network, and how to add new nodes to it and connect them as the user wishes. so far i can only make it work by recompiling the whole topology, but maybe that is necessary.

after that i need to write a python wrapper class for it so it can be automated for some guy's thesis

>God I'm retarded
We knew ;)

If I was retarded I'd still use C(ancer)

it should return an integer you long double nigger

>register
>auto
>Two storage class specifiers
That's not valid.
Also, a + b overflows on LLONG_MAX + 1.

Since you stupid faggots are STILL posting your dumb integer average meme, I'm going to post my solution yet again:
/**
* Averages an array of integers.
*
* Averages an array of integers, without overflow or conversion to a larger type.
* It is equivalent to the sum of the array, divided by the array's length (rounded towards zero).
*
* @param n Number of array elements. Must be greater than zero.
* @param arr A pointer to an array of n integers. Must be non-null.
* @return The mean of the array's elements.
*/
int iavg(int n, const int arr[static const n])
{
int avg = 0;

/* A buffer of values that are lost to integer truncation.
* It should always be in the closed interval (-n, n).
*/
int error = 0;

for (int i = 0; i < n; ++i) {
avg += arr[i] / n;

int loss = arr[i] % n;

// error + loss >= n
if (error > 0 && loss > 0 && error >= n - loss) {
// error = (error + loss) - n
error -= n - loss;
++avg;

// error + loss 0 && error < 0)
--avg;

return avg;
}

>(((C))) productivity

>Posters
You're even changing the way you write C to make it more obvious :^)

It's an averaging function that works on an array of fixed-width integers, and only works within that domain.
There is nothing inherently "C" about it. This is close to the solution you would use in any imperative language, you stupid cuck.

test


for(int i = 0; i < Vagina.Lengthl i++)
{
vagina[i]++;
m += 2*i;
}

Class Nigger{

public Nigger(int j)
{


}
}

QUALITY SOFTWARE

Fixed :^)
signed long long average(signed long long a, signed long long b)
{
long double c;
if(a < (LLONG_MAX / 2) && b < (LLONG_MAX / 2) {
c = a + b;
c = c / 2;
if((c - (signed long long)c) >= 0.5) {
return((signed long long)(c + 1));
else return((signed long long)c);
} else fputs("kys", stderr);
return 0;
}

THAT WAS GNU QUALITY!

java or c#

java is more portable compared to c#.
Also fuck microsoft.

Remember when Microsoft was good?

When?

...

Around this time

I started C a week ago and I find this function pretty cool. thanks for sharing user

Wait, does QT's connect function require the Q_OBJECT macro to work? Is there any way to create a button with a callback in a local function scope?

Because QT devs suck.

was Bill Gates a good programmer?

Forget Gates. Program in Lisp.

No, he was a good business man

How are you supposed to choose your own base and prime numbers for modulo operations for the Rabin Karp string matching algorithm? Should I use base 127 (because of ASCII, is this wrong?) and prime q:

PS MY ALGO ONLY WORKS WHEN I USE BASE = 26 (size of alphabet), PRIME = 17, AND when I shift the ascii char values with -96, so a = 1, b=2. c =3...z=26. I dont want this!

my algo:

//precompute hash of first window and pattern
for (int i = 0; i < patternWidth; i++)
{
uint windowChar= Text2[i] - 96; //note the shifting with -96. I dont want that
uint patternChar = pattern1[i] - 96;

//current window in text
textHash = (textHash * _base + windowChar) % prime;
patternHash = (_base * patternHash + patternChar ) % prime;
}

//do the rolling hashes with window sliding
for (int i = 1; i

Daily Reminder

OOP is better than functional programming

Java is better than Lisp and Haskell

You're funny.

t. pajeet

#include
#include

template
constexpr std::size_t countof(const T(&)[N]) noexcept
{
return N;
}

template
std::size_t countof(const T& container)
{
return container.size();
}

template
T average(const Iterable& iterable)
{
return std::accumulate(
std::begin(iterable), std::end(iterable),T())/countof(iterable);
}

int main()
{
auto numbers = { 1, 2 };
std::cout

>Haskell
>not the industry-proven OCaml
pleb

"OOP".reverse()

...

>15 mins of building all this templated shit later
Also I'm still mad about how templates don't allow for any kind of auto-completion.

literally java

C# is literally a cargo cult design where they've imitated java and altered it without understanding it. it's literally a pajeet'd java.

Nothing Found

is this real life?

people on /dpt/ actually defending java and thinking Java is better than a language?

kys ms shill

is shilling ms any worse than shilling orcl though?

Only redditors would defend languages like C# and Java.

averaging two ints in C is actually a good interview question

a smart person should be able to deduce the solution

unemployment would skyrocket

Lets Solve this once and for all

strawpoll.me/12426079

this

You forgot the 'neither' option.

it's simply impossible

>implying Sup Forumss opinion is worth shit

and the both

samefag butthurt microcuck

And the "don't know".

And the "can you repeat the question"

"I'd like to phone a friend"

alright I tallied up the results

6 for Java
6 for C#

Confirmed /dpt/ cannot agree on anything and just shit on any language for no reason at all

...

>alright I tallied up the results
lmao micros**t is getting desperate

Wrong again, shit for brains.

"I'd like to use 50/50, Chris"

sure sure hahaha

>average
Nice try.

There is literally nothing wrong with Microsoft

>ask Sup Forums to vote java
>they all vote C#
>epin

>tfw #c
the C people are extremely ill, they must have serious self esteem issues and suffer from anxiety for some reason.

hey "elite" fizzbuzzers, how have you been?

I've got a question for you:
how do I learn to love programming?

Sure thing goyim

program in C#

I fucking hate having to use an IDE (under Windows, no less) to have a good experience programming stuff. also, C# is OOP, and mostly for Windows. so, fuck it

I like Go, though, which reminds me...

Learn Go: tour.golang.org

either you have it or you don't. you're born with autism.

>Go

IDES are the only way to properly program though nowadays you should try Windows

>le nature argument
kys

actually, java (with its retarded error messages, and useless IDEs) made me hate programming a bit

is "The Practice of Programming" a good book?

Go is nice
Rust is nicer

C is the nicest

Java has really well exception handling what are you talking about?

Netbeans and Eclipse are actually pretty good IDES

I really, really, really like this image!

>C
C stands for cancer and it needs to die

>really well exception handling
Nice English, Pajeet.
Also
>Checked exceptions
>Good

>really well exception handling
oh nvm, I see what's happening here
later pals