/dpt/ - Daily Programming Thread

ALL OF YOU FUCKING SUCK ASS AT PROGRAMMING SERIOUSLY AND YOUR OPINIONS ARE TERRIBLE

PREV:

Other urls found in this thread:

regex101.com/
twitter.com/NSFWRedditImage

FIRST4TRAPS!

MCFUCKING KILLYOURSELF

Who /castsmalloc/ here?

MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOODS

only tards

Thanks man.

In a Haskell S-expr parser (basically ParsecT s u IO a, I need IO to generate Data.Unique to tag objects I generate) how do I handle cyclic data? #0=(1 . #0#). I need a lazy reference to the Cons cell while it's being constructed.
Is fixIO the way to go basically?

Thank you for not using an anime image.

Heard it makes code C++ compatible

ONLY TARDS USE C

NIGGERS ARE SERIOUSLY STUPIDER THAN OTHERS, IT'S NOT RACISM OR "MUH PRIVILEGE", THEY HAVE LITTLE TO NO NEANDERTHAL DNA THAT'S THE KEY DIFFERENCE IN TERMS OF INTELLIGENCE, IT'S FUCKING SCIENCE

nope

C and Python are for people who don't know how to program.

that sour?

THIS

how would you know?

You have been visited by the crossdressing C programmer of Shimoshina Academy!

Good performance, triple indirection, and tail call optimization will come to you, but only if you post "Keep overflowing the stack, Hime!" in this thread.

THERE ARE NO SOUR GRAPES YOU DELUSIONAL FUCKTARD, C IS FUCKING EASY, IT'S ALL FIZZBUZZ TIER "PROGRAMMING" (CODEMONKEYING), I COULD EASILY PROGRAM IN C IF I WANTED TO, SAME DEAL WITH HASKELL, FUCKING DELUSIONAL TARDS THINK THEY'RE SMART FOR USING IT

#include

#define MAXHIST 15
#define MAXWORD 6
#define IN 1
#define OUT 0


int main()
{

int c, i, nc, state;
int len;
int maxlength;
int ovflow;
int wl[MAXWORD];

state = OUT; // INITIALIZE
nc = 0; // VARIABLES,
ovflow = 0; // ARRAYS &
// STATE
for (i = 0; i < MAXWORD; i++) //
wl[i] = 0;

while ((c = getchar()) != EOF)
{
if(c == ' ' || c == '\n' || c == '\t') // CHECK IF OUTSIDE OF A WORD
{
state = OUT;
if (nc > 0)
{
if (nc < MAXWORD)
++wl[nc];
else
++ovflow;
}
nc = 0;
}
else if (state == OUT)
{
state = IN;
nc = 1;
}
else
++nc;


maxlength = 0; // CHECK THE MAXIMUM LENGTH
for (i = 1; i < MAXWORD; ++i)
{
if(wl[i] > maxlength)
maxlength = wl[i];
}

// if(c == '\n')
// break;

} //end while()

for(i = 1; i < MAXWORD; ++i)
{
printf("%5d - %5d : ", i, wl[i]);
if(wl[i] > 0)
{
if((len = wl[i] * MAXHIST / maxlength) 0)
{
putchar('*');
--len;
}
putchar('\n');
if (ovflow > 0)
printf("There are %d words >= %d\n", ovflow, MAXWORD);

}
return 0;
}


The current output of this word histogram is the following for some random input:
1 - 1 : ***
2 - 2 : ******
3 - 3 : *********
4 - 4 : ************
5 - 5 : ***************


The challenge here is to modify it so the output is in a vertical orientation instead of horizontal, but I have no clue where to begin. Can anyone shoot me some ideas?

Java and C# are for indians.

>675

How could one even get a score so low?

C is great

Keep overflowing the stack, Hime!

please go newfags

DELETE THIS

I'm not sure if I'll get scolded by posting this in here, but would you all be able to help me with the issue within this SQL statement?

SELECT c.customer#, c.lastname, SUM(b.retail-b.cost)
FROM customers c
JOIN orders o USING (customer#)
JOIN orderitems USING (order#)
JOIN books b USING (isbn)


I'm supposed to be showing all orders for all clients and the amount of profit gained from each client.

>Create a view called CUSTPROFIT with three columns that includes the total profit (retail-cost) of all orders by customer name. (columns: customer#, name, totalprofit).

Sorry to bug you all with this nonsense

So are these threads always 8 shitposts per 10 posts?

your mom

That's what happens when you don't post an anime image.

>ALL OF YOU FUCKING SUCK ASS AT PROGRAMMING SERIOUSLY AND YOUR OPINIONS ARE TERRIBLE
>standardised tests to measure intelligence
Yeah, no

It's usually bad, but today is certainly an anomaly.

I was there, I watched the debate. Now fuck off, La Sup Forumsogne aux Sup Forumsacs!

>COULD
but you actually can't because you don't know how, right? but you sure "could" if you "wanted to"; can't be harder than html, right? :^)

where is "GROUP BY" ?

>C is great
>he doesn't know C
user...

>Can anyone shoot me some ideas?
Understand the code you've been given, how it generates the stars horizontally. Study it. Meditate, and Enlightenment will come to you

I have a name you don't know

it's literally fizzbuzz + memory allocation + structs + function calls and that's about it

Okay, but what does this have to do with programming?

>about it
called it! :^)

females, niggers, spics and any sub-110 IQ people are the shittiest programmers

I think he's trying to shitpost at me.

Fuck off! KDE 4 LYFE!

I tried attaching the group by c.customer#, but get the same error as when I leave it off.
SELECT c.customer#, c.lastname, SUM(b.retail-b.cost)
FROM customers c
JOIN orders o USING (customer#)
JOIN orderitems USING (order#)
JOIN books b USING (isbn)
GROUP BY c.customer#

>ORA-25154: column part of USING clause cannot have qualifier

But your attraction to black women is based on their aesthetics, not their intelligence...

>JOIN orders o USING (customer#)
Stop this.

SELECT c.CustomerNumber
,c.FirstName + ' ' + c.LastName AS 'CustomerName'
,SUM(b.Retail * (b.Discount-1)) - SUM(b.Cost) AS 'Total Profit'
FROM Customers c
JOIN Orders o ON o.CustomerNumber = c.CustomerNumber
JOIN OrderItems oi ON oi.OrderNumber = o.OrderNumber
JOIN Books b ON b.ISBN = oi.ISBN
GROUP BY c.CustomerNumber

Well, sort of. I know quite a few of them who are smart. One helped me with calculus during my freshman year.

>b.Discount-1
Backwards, meant 1 minus the discount.

Keep overflowing the stack, hime!

Parents income isn't the only 'nurture' factor.
Who your friends and where you live also shapes your academic choices in life.
And of course there's the issue that you know whether you're black or not (i.e you can't eliminate personal biases).

what's a good resource for learning IT stuff?
I'm finding it would be useful to know how OS security policies, server virtualization, and stuff like that works.

spin up a server
if it get pwnd by russian hackers, fix the hole and bring it back up
repeat

>who your friends and where you live
Which is 99% decided by income, you illiterate man-monkey.

...

Learn about Active Directory and you're already hireable.

Consider doing baseline certifications in virtualization, networking, and domain controllers.

Find an entry-level cert and use the study materials recommended for the test.

I do appreciate it, but still get an error with this.
>ORA-00923: FROM keyword not found where expected

When I down-format what you said to
SELECT c.customer#, c.lastname, SUM(b.Retail - b.Cost)
FROM customers c
JOIN orders o ON o.customer# = c.customer#
JOIN orderitems oi ON oi.order# = o.order#
JOIN books b ON b.isbn = oi.isbn
GROUP BY c.customer#


I then get...
>ORA-00979: not a GROUP BY expression

I'm pretty sure that octothorpe is fucking you up. (#)

What DBMS are you using?

You'll need to encase 'customer#' in `` or [] if it's MySQL or MS SQL, respectively.

its oracle.

how do russian hackers even operate, where are the holes

>how do russian hackers even operate

On Vodka and strong cigarettes.

Has anyone done any quantum programming / know anything about quantum paradigms?

meme

Yeah, I'm using Oracle Application Express. It's for one of my classes.

Sorry, user.

I've got instances of MySQL and MSSQL set up and ready to test against, but I'm not super familiar with OracleDB.

Brief research shows that Oracle is find with # in an identifier, so that's not your issue.

Try grouping on both the customer# and the last name:
GROUP BY c.customer#, c.lastname

>is find
is fine*

file.replaceAll("[^a-zA-Z]", "");

this removes everything but the letters a through z, right? I'm dumb and having a hard time understanding regexes

regex101.com/

I'll spend more time on theory than practice to get good.

Then you will only know the concept of programming instead of how to program. And the concept of programming is simply a logic tree, which your brain already does by default. Stop slacking and take that theory into practice!

love this website. to the other guy notice you have to put in a "g" in the 2nd field to make it global.

Yeah, that's what it was.. hmm.. I didnt know that GROUP BY /requires/ two parameters.

>regex101.com/
wow, this is so helpful! thanks user
polite sage

Depends on the DBMS.

In MS SQL and apparently Oracle, you must explicitly state everything that's not in the aggregate expression.

MySQL (what I was writing for at first) assumes everything not in the aggregates to be grouped sequentially.

In this case, you had to group by all of your columns that were not the aggregate (the SUM).

I tried practice but when someones gives you something you never programmed before your practice goes out the window and becomes all problem solving first and foremost the the little details of practice are done on the spot.

if you have an aggregator like sum(), you must group by all non-aggregate columns. this requirement makes sense if you think about it.

>using globals

Yeah, makes sense now. I kind of regret always browsing Sup Forums while I was in my sql class now. But i appreciate you all helping out. Now time to finish the rest of it.

>muh globals r bad

>the filter is half the cigarette

I bet the gommies did this.

>using chink toons reaction images

>having a position that even cuck moot BTFO

Does adobe allow for form filling a pdf file easily? Essentially I'm trying to build a system that will go through a database by last name/birth year and grab old forms to update, or if you're not in, making a new form. The pdf form itself is just an image, so I basically need some type of form filling software that can type in this info, tab and go to the next section to fill in further.

On top of that I need the signature panel to work as a written digital signature. When all this is said and done it will send the form to a different computer to be filed into the system.

tl;dr, Is there already decent software for filling forms like these?

Yes, they did, in the most literal sense.

they might still be "good" though, fuck diluting your drugs

However, I've heard they're pretty good if you like very strong cigarettes, and are a fucking disgusting commie.

can't you just use the state monad and do some name mangling?

kill self

Keep overflowing the stack, Hime!

Go drink bleach you sack of shit.

Is it true that crossdressing makes you a better programmer or is it a meme?

it's a shitty forced meme/delusion

Oracle guy is back again with a quick question:

What would I use to change a selected row value from "N" to "North"?

I'm not saving it as an update to the table, just for a simple select statement.

TO_CHAR?

>SQL

Oh.

I'm going to try it anyway, I already bought the clothes.

Actually no. I find I program best when I'm not wearing any clothes at all, or when I'm just in my boxers.

It's true

Newfag

you get increased dopamine levels from sexual arousal from wearing the skirt and that might increase mental clarity i think

fag

>dopamine
>mental clarity

That's not how it works.

Answering my own question here.

DECODE

How can I average 76 ints in C?

How does CUDA/OpenCL work? Can it help with 2D effects?

int avg(int *arr, int count)
{
float avg = 0.0f;
unsigned i;
for (i = 0; i < count; i++)
avg += (float) arr[i];
avg /= count;
return (int) avg;
}

>using a float
Don't do this