[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 40
File: 1461226306431.gif (48 KB, 2034x1491) Image search: [Google]
1461226306431.gif
48 KB, 2034x1491
ALL OF YOU FUCKING SUCK ASS AT PROGRAMMING SERIOUSLY AND YOUR OPINIONS ARE TERRIBLE

PREV: >>54406109
>>
FIRST4TRAPS!
>>
>>54410346
MCFUCKING KILLYOURSELF
>>
File: trop.png (1 MB, 1280x720) Image search: [Google]
trop.png
1 MB, 1280x720
Who /castsmalloc/ here?
>>
>>54410370
MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOODS
>>
>>54410370
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.
>>
>>54410379
Heard it makes code C++ compatible
>>
>>54410379
ONLY TARDS USE C
>>
>>54410387
nope
>>
>>54410323
C and Python are for people who don't know how to program.
>>
>>54410391
that sour?
>>
>>54410431
THIS
>>
>>54410431
how would you know?
>>
File: K&R himegoto waifux2.png (1 MB, 1000x1400) Image search: [Google]
K&R himegoto waifux2.png
1 MB, 1000x1400
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.
>>
>>54410435
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 <stdio.h>

#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)
len = 1;
}
else
len = 0;

while(len > 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?
>>
>>54410431
Java and C# are for indians.
>>
>>54410412
>675

How could one even get a score so low?
>>
>>54410391
>>54410431
C is great

>>54410459
Keep overflowing the stack, Hime!

>>54410377 >>54410379 >>54410384 >>54410391 >>54410412
please go newfags
>>
>>54410459
DELETE THIS
>>
File: related.png (30 KB, 614x448) Image search: [Google]
related.png
30 KB, 614x448
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?
<code>
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)
</code>

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?
>>
>>54410492
your mom
>>
>>54410492
That's what happens when you don't post an anime image.
>>
>>54410412
>ALL OF YOU FUCKING SUCK ASS AT PROGRAMMING SERIOUSLY AND YOUR OPINIONS ARE TERRIBLE
>standardised tests to measure intelligence
Yeah, no
>>
>>54410492
It's usually bad, but today is certainly an anomaly.
>>
File: pologne.png (76 KB, 1696x2840) Image search: [Google]
pologne.png
76 KB, 1696x2840
>>54410412
>>>/pol/73167726
I was there, I watched the debate. Now fuck off, La /Pol/ogne aux /Pol/acs!
>>
>>54410460
>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? :^)
>>
>>54410479
where is "GROUP BY" ?
>>
>>54410475
>C is great
>he doesn't know C
anon...
>>
File: ddh.jpg (595 KB, 1945x1140) Image search: [Google]
ddh.jpg
595 KB, 1945x1140
>>54410462
>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
>>
>>54410530
I have a name you don't know
>>
>>54410518
it's literally fizzbuzz + memory allocation + structs + function calls and that's about it
>>
>>54410412

Okay, but what does this have to do with programming?
>>
>>54410556
>about it
called it! :^)
>>
>>54410562
females, niggers, spics and any sub-110 IQ people are the shittiest programmers
>>
File: 1462415709304.jpg (211 KB, 750x746) Image search: [Google]
1462415709304.jpg
211 KB, 750x746
>>54410562

I think he's trying to shitpost at me.
>>
>>54410544
Fuck off! KDE 4 LYFE!
>>
>>54410520
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
>>
>>54410586

But your attraction to black women is based on their aesthetics, not their intelligence...
>>
>>54410479
>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
>>
>>54410604

Well, sort of. I know quite a few of them who are smart. One helped me with calculus during my freshman year.
>>
>>54410611
>
b.Discount-1

Backwards, meant 1 minus the discount.
>>
>>54410459
Keep overflowing the stack, hime!
>>
>>54410412
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.
>>
>>54410757
spin up a server
if it get pwnd by russian hackers, fix the hole and bring it back up
repeat
>>
>>54410754
>who your friends and where you live
Which is 99% decided by income, you illiterate man-monkey.
>>
>>54410757
>>>/g/
>>
>>54410757
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.
>>
>>54410611
>>54410624
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
>>
>>54410811
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.
>>
>>54410846
its oracle.
>>
>>54410770
how do russian hackers even operate, where are the holes
>>
>>54410878
>how do russian hackers even operate

On Vodka and strong cigarettes.
>>
Has anyone done any quantum programming / know anything about quantum paradigms?
>>
>>54410905
meme
>>
>>54410846
>>54410860
Yeah, I'm using Oracle Application Express. It's for one of my classes.
>>
>>54410860
Sorry, anon.

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
>>
>>54410932
>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
>>
File: Fo4wSa0.png (33 KB, 1638x309) Image search: [Google]
Fo4wSa0.png
33 KB, 1638x309
>>54410957
https://regex101.com/
>>
I'll spend more time on theory than practice to get good.
>>
>>54410994
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!
>>
>>54410986
love this website. to the other guy notice you have to put in a "g" in the 2nd field to make it global.
>>
>>54410932
Yeah, that's what it was.. hmm.. I didnt know that
GROUP BY
/requires/ two parameters.
>>
>>54410986
>https://regex101.com/
wow, this is so helpful! thanks anon
polite sage
>>
>>54411053
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).
>>
>>54411021
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.
>>
>>54411053
if you have an aggregator like sum(), you must group by all non-aggregate columns. this requirement makes sense if you think about it.
>>
File: 91i328.jpg (142 KB, 740x740) Image search: [Google]
91i328.jpg
142 KB, 740x740
>>54410986
>using globals
>>
>>54411069
>>54411079
Yeah, makes sense now. I kind of regret always browsing /g/ while I was in my sql class now. But i appreciate you all helping out. Now time to finish the rest of it.
>>
>>54411090
>muh globals r bad
>>
>>54410900
>the filter is half the cigarette

I bet the gommies did this.
>>
>>54411090
>using chink toons reaction images
>>
>>54411247
>having a position that even cuck moot BTFO
>>
File: html_form.png (106 KB, 1683x1073) Image search: [Google]
html_form.png
106 KB, 1683x1073
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?
>>
>>54411150

Yes, they did, in the most literal sense.
>>
>>54411150
they might still be "good" though, fuck diluting your drugs
>>
File: mgbcx.jpg (161 KB, 700x525) Image search: [Google]
mgbcx.jpg
161 KB, 700x525
However, I've heard they're pretty good if you like very strong cigarettes, and are a fucking disgusting commie.
>>
>>54410380
can't you just use the state monad and do some name mangling?
>>
File: 1414983536656.png (956 KB, 1280x720) Image search: [Google]
1414983536656.png
956 KB, 1280x720
>>54410431
kill self
>>
>>54410459
Keep overflowing the stack, Hime!

>>54410478
>>54410501
>>54410581
>>54410589
Go drink bleach you sack of shit.
>>
Is it true that crossdressing makes you a better programmer or is it a meme?
>>
>>54411726
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
>>
>>54411739
Oh.

I'm going to try it anyway, I already bought the clothes.
>>
File: buttserver.png (171 KB, 800x600) Image search: [Google]
buttserver.png
171 KB, 800x600
>>54411726
Actually no. I find I program best when I'm not wearing any clothes at all, or when I'm just in my boxers.
>>
>>54411726
It's true

>>54411739
Newfag
>>
>>54411726
you get increased dopamine levels from sexual arousal from wearing the skirt and that might increase mental clarity i think
>>
>>54411748
fag
>>
>>54411774
>dopamine
>mental clarity

That's not how it works.
>>
>>54411743
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?
>>
>>54411807
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;
}
>>
>>54411839
>using a float
Don't do this
>>
>>54411848
why
>>
>>54411848
he wants ints
if he wanted double precision, he would have used some long long values.
>>
>>54411855
A float cannot hold the maximum possible value of 76 ints summed together
>>
>>54411872
happy now?
int avg(int *arr, int count)
{
float avg = 0.0f;
unsigned i;
for (i = 0; i < count; i++)
avg += (float) arr[i] / count;
return (int) avg;
}
>>
>>54411807
you cant C can only handle 64 ints
>>
>>54411909
No. I'm never happy
>>
>>54411910
you mean 64 bits

C can only handle 64 bits of an integer, that's not even a full integer
>>
>>54411909
no

try kahan summation but i'm not sure that will worth either
>>
>>54411909
>2016
>using float, ever
>>
>>54411931
int is 16
long int is 32
long long int is 64
>>
>>54411971
int and long are both 32 bits
short is 16 bit
>>
Can you make a game about furries with C++?
>>
>>54411971
>>54411996
It's up to implementation
https://en.wikipedia.org/wiki/C_data_types
>>
>>54411971

right but there aren't any full integers in C, there are only bits of integers
>>
>>54411971
>>54411996

char is at least 8 bits
short is at least 16 bits
int is at least 16 bits
long is at least 32 bits
long long is at least 64 bits

None of the standard types in C have a set defined amount of bits for all platforms.
>>
Okay /g/, I have a question about C.

Consider the following lines:
int i = 0x12345678;
char c = i;


Now, the value of c will be 0x78.

Here is my question: When casting from a larger size type to a smaller size type (like int to char in this example), will the char ALWAYS get the least-significant byte from the int, or does it depend on endianness? Does the char get 0x78 because the int is stored in little endian on my computer and the 0x78 happens to be first? If I were to try this out on a big endian computer, would c equal 0x12?

Also, could someone point me to the K&R section that talks about casting mechanics?
>>
>>54412016

Yes. The question is not can you, but should you?
>>
>>54412059
How can I do it?
>>
>>54412016
it's pretty much the perfect language for the job
>>
i saw a video of a guy lecturing about databases. he was talking about fact based databases where updates to tables are stored in order. so you can go back in time and see what the database looked at at any particular time.
he also mentioned sequential write only hard drives for a performance boost.
i want to watch it again. anyone know what i'm talking about?
there were lots of neat ideas but i've never seen them implemented anywhere.
>>
>>54412043
pls respond
>>
>>54412075
But is the job itself oughted?
>>
>>54412141
Yes. I want to make a furry game for a friend.
>>
>>54412134
could use an update monad
>>
>>54412043
It has to do with endianness. Big endian would be 0x12
>>
http://codepad.org/32gog5gi
>>
>>54412043
http://c0x.coding-guidelines.com/6.3.1.3.html
>>
>>54412155
No. It is impossible to create furry games in C++.
>>
>>54412043
struct {
union {
unsigned long long int i;
char cuck[4];
};
} nigger;

int main() {
nigger.i = 0x12345678;
printf("%d\n", nigger.cuck[0]);
return 0
}
>>
>>54412203
What languages is it possible in? C? Python? Java?
>>
>>54412218
It's only possible in FORTRAN
>>
>>54412224
How do I use Direct3D in FORTRAN?
>>
>>54412243
http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html
>>
>>54412073

Not exactly something that could be described in an entire post, or even an entire thread. How about you start by giving some information about the game you're making?

>>54412043
>>54412137

So... can't find anything in the standard about this, but I'm pretty sure it's endian-agnostic. Consider the following: getchar returns int, not char. If it doesn't read EOF, it's going to return a number between 0 and 255. On a little endian machine, that value is going to be in the first byte of the integer, and on a big endian machine, it's going to be in the last byte. But regardless, it has to be able to be safely downcasted to char.
>>
>>54412243

You should not use Direct 3D for any purpose. Only OpenGL.
>>
Suppose I'm transferring serialized objects to other machines.

What's the best way to deserialize them now that we'ver lost run-time fluff?
>>
>>54412283
>You should not use Direct 3D for any purpose. Only OpenGL.

Okay, id software.
>>
>>54412300
... the reverse of the way you serialised them?
>>
>>54412283
What's wrong with Direct3D?

>>54412258
Couldn't I just write the whole thing in C?

>>54412262
It needs to be a game where you play an anthropomorphic wolf who has to go around breaking into houses and eating children who visit, before the children realize what's going on and try to kill you. I want it to look like Braid.
>>
Sup /g/s,

Working with Java here

>successfully parsing HTML text using Java,
>read HTML text from a Google Search
>doesn't list the results' contents

Anyone know any ways around that?

Also,

>parse HTML text for a site with multiple pages
>ex. String siteName = "sitename.com/page/" + incrementVal;
>run into sites with one page that uses expand buttons to show more content

>Google how to interact with buttons
>HTML-Unit shows up

Anyone experienced with working with buttons to show more content?
>>
>>54412283
>Only OpenGL.
But that's not Vulkan
>>
>>54412205
But that doesn't show the effect of casting

I already know that the first memory byte contains 0x78, but I was asking about casting in particular

>>54412262
Okay, that makes sense, thanks

>getchar returns int, not char. If it doesn't read EOF, it's going to return a number between 0 and 255

Here is another question I had:
Is it possible for a weird architecture to have chars and ints be the same size?

In that case, how would you distinguish EOF from a real character, if it's not using ASCII?
>>
>>54412321
no, you have to write the window/rendering in C and interface with fortran
>>
>>54412321

>wuts wrung widh direct 3d
Vendor lock-in, no thanks
>>
>>54412407
Isn't OpenGL slower though?
>>
>>54412427
RUNNING IN THE 90's
>>
File: 1445224425142.gif (2 MB, 307x346) Image search: [Google]
1445224425142.gif
2 MB, 307x346
>mfw I realize I overwrote my source code with my debugging source code by accident
>>
>>54412427

Whats slow is your ass in a wheelchair

As a beginner nobody have to care about speed differences, just follow ogl 3.2+ tutorials and let deprecated shit rot
>>
File: yeaa.gif (223 KB, 220x200) Image search: [Google]
yeaa.gif
223 KB, 220x200
>>54412471
>not using vc
>the current year minus 2 plus 2
>>
https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py

holy shit i just spotted a Sad CS Graduate meme in the wild
>>
>>54412332
yes, do not try to parse html, you do not try to interact with buttons, put your html scraper app in the trash because they are unmaintainable and tedious and annoying to write and break every time the site does a redesign. if the site has an API, use that otherwise fuck off they dont want you scrapig.

https://developers.google.com/custom-search/json-api/v1/overview
>>
File: 1459487588767.jpg (78 KB, 340x314) Image search: [Google]
1459487588767.jpg
78 KB, 340x314
>>54412533
>My computer at work is struggling to scroll through it
There's no way this was made with any other purpose but to be comedic. There's no way.
>>
>>54412477

It's probably better to learn vulcan desu, gives you all the freedom to do things differently or even faster than opengl and directx
>>
>>54412533

That's a joke. His GitHub isn't full of stuff, but nothing else is nearly that bad.

I don't doubt he wrote a program to generate it.
>>
>>54412533
It's fake famalam. Read the README.md.
>>
File: nagisa.jpg (40 KB, 480x749) Image search: [Google]
nagisa.jpg
40 KB, 480x749
>>54410459
KEEP OVERFLOWING THE STACK, HIME!

>>54412332
If you want to go as far as pressing buttons, why not use a tool designed to be able to interact with webpages like people do, like PhantomJS?
>>
>>54412629
Is 'he' you, Oni-San Goes To Party?

We all know you're not a man.
>>
>>54412649
woah, cute boy!
>>
File: 1459487295667.png (249 KB, 340x314) Image search: [Google]
1459487295667.png
249 KB, 340x314
>>54412639
>So to be true to the "real" story I have only gone from 0-50 however higher numbers can easily be generated too however my Python crashes with larger numbers. I generated one that was 0-1000 and it took up 317 MB of space on my hard drive but was only 20MB after I compressed it to a .rat so I have also attached it.
>>
>>54412654
>Is 'he' you

Thankfully, no. I don't use Python and I'm also a proud red-blooded American.
>>
Can someone explain why casting the return value of malloc is a thing? What's the practical purpose?
>>
>>54412721
I don't believe you. I think you're really Canadian.
>>
>>54412731
It allows you to signify your intent. It's kind of like virtue signaling.
>>
File: 1462187173041.jpg (174 KB, 960x1280) Image search: [Google]
1462187173041.jpg
174 KB, 960x1280
>>54412721
Who likes niggers.
>>
>>54412770

I would never associate with el rato and his ilk.
>>
Trying to get good at programming here and I cant get the cmd commands to work.
Can someone tell me whats wrong with
system("ffmpeg -i 1.mkv -map 0:s:0 subs.srt");
>>
>>54412799
>Who likes niggers.

It's an American pastime. After all, Tommy "Miscegenation Plantation" Jefferson did it, too.
>>
>>54412802
Syrup lover. Hockey competent.
>>
>>54412539
Thanks for the Json link.

What if the site doesn't have an API?
>>
File: 1462201789173.jpg (143 KB, 960x1280) Image search: [Google]
1462201789173.jpg
143 KB, 960x1280
>>54412824
>http://killedbypolice.net/
Apparently shooting people sounds like a great way to kill some time too.
>>
>>54412824
Can we go tribbing together sometime?
>>
>>54412812
what language are you in
>>
>>54412812
Try to hack into the matrix by using IRC.
>>
>>54412926
norsk
>>
>>54412321

>What's wrong with Direct3D
Proprietary, not portable

>I want it to look like Braid
SFML
>>
>>54412855
>shooting people

That hobby is mainly practiced by black people.
>>
>>54412043
Or maybe it's like registers.
if EAX has 12345678h inside, then AL has 78h inside.
>>
>>54413057
>>54413116
Are you two dating?
>>
Whats a good name for a 2d graphics library(blitting/line drawing/etc).
Something that can be put into a neat namespace like how std:: and sf:: are.
>>
>>54413179

I'm not gay.
>>
>>54413208
Wait, Ruby's a girl too?
>>
>>54413221
no, just a brony
>>
>>54413202
Your initials. If needed, do a retro-acronym
>>
>>54413238
Then how is it gay if he dates you?
>>
I've only just started learning programming, I'm taking a class on java and I have to make something to read 2 int arrays from the user, then make a third array and check if there's the same numbers on any of the positions, then start putting then in the third array as I find them

I got to make the 2 first arrays that read the inputs, but I have exactly no idea how to make the third, I assume I have to make a 'current' variable and increase as I find, but I don't know how to test it

arrayA[i] == arrayB[i] doesn't seem to work
>>
>>54413262
You need to use .equals instead of ==

You need to use ArrayList instead of arrays

You need to use composition instead of inheritance
>>
>>54413179

No.

>>54413221

We're both male.
>>
>>54413262
it should, post code
>>
>>54413262
>I got to make the 2 first arrays that read the inputs, but I have exactly no idea how to make the third, I assume I have to make a 'current' variable and increase as I find, but I don't know how to test it
and
>arrayA[i] == arrayB[i] doesn't seem to work
are these two unrelated inquiries?
>>
>>54413285
No, OSGTP is a girl (One Silly Girl Took Programming)
>>
>>54411748
report your findings back
>>
>>54413305

I thought it was One Slow Grand Turing Prototype
>>
>>54412926
c++
Not sure what Im doing wrong here.
>>
>>54413389
Could be, I guess. Anyway she's definitely dating material for you: you're both into programming.
>>
>>54413389

It stands for One Sexy & Greatly Talented Programmer.
>>
>>54413409

My ex girlfriend was into programming. She turned into a real queen bitch. A shared interest does not imply compatibility.
>>
 
// prevent our code from being compiled with any C++ compiler
struct class;
>>
>>54413434
You're also both 4channers.
>>
>>54413435
Noice
>>
>>54413277
>>54413295
>>54413296
>You need to use .equals instead of ==
I thought .equals was only for strings? they are all supposed to be int
>You need to use ArrayList instead of arrays
reading about it seems like it would make it easier, but the it's next on the schedule of the class, so this is to be done only on arrays

as I said i've started a few weeks ago and this is total spaghetti coding
        final int MAX_ARRAY = 8;    
int i = 0;

// reads first two arrays
int[] arrayA = new int [MAX_ARRAY];
for(i = 0; i < arrayA.length; i++) {
System.out.println("array A : " + i);
arrayA[i] = in.nextInt();
}

int[] arrayB = new int [MAX_ARRAY];
for(i = 0; i < arrayB.length; i++) {
System.out.println("array B : " + i);
arrayB[i] = in.nextInt();
}


//supossed to make the third and then test
int z = 0;
int currentPos = 0;
int[] arrayRES = new int [MAX_ARRAY];
while (in.hasNextInt() && currentPos < arrayRES.length && z < 8) {
if (arrayA[currentPos] == arrayB[currentPos]) {
arrayA[i] = arrayRES[currentPos];
currentPos++;
}
z++;
}
System.out.print(arrayRES);
>>
>>54413445

My ex and I also shared a website or two of interest with one another. Again, shared interests does not imply compatibility.
>>
hello, I am new to programming - how do you make a robot?
>>
File: OSGTP.jpg (126 KB, 1300x936) Image search: [Google]
OSGTP.jpg
126 KB, 1300x936
>>54413419
Aww, thanks
>>
>>54413499
Come on, we all know she and you would make a great couple. You can stop pretending otherwise. We're all really happy for you, we wish you'd just admit it and get together!
>>
>>54410414

I know this is late, but you're wrong. C++ disallows implicit void-casting.
>>
>>54413541

I don't like this Ruby x GTP fanfiction.
>>
>>54413567
>fiction
>>
>>54413567
We know you're hot for each other.
>>
>
arrayA[i] = arrayRES[currentPos];

that line in particular is very problematic. Look at it

>
arrayA[currentPos] == arrayB[currentPos]

Wrong variable, should be z IMHO

>
in.hasNextInt()

Why? Pretty sure it fucks up the loop
>>
>>54410459
Stop this programming fag meme.
>>
>>54413624
Crossdressing really does improve code quality.
>>
>>54413624
>meme
>>
>>54412043
For signed numbers it's implementation defined, for unsigned numbers it's reduced modulo 2^N (where N is the bit size of the converted result)
>>
I don't understand the error I'm getting when I compile on my school's linux servers. Pic related is error, arrow shows where findMin is called, and there's the findMin method.

>>54410459
Keep overflowing the stack, Hime.
>>
>>54413785
It's literally what the error message says: You have multiple definitions of findMin() and you're only allowed to have at most one.
Most common way this happens is if you have it defined in a header file and managed to include it twice.
>>
File: 640K feeling will never die.png (159 KB, 1187x190) Image search: [Google]
640K feeling will never die.png
159 KB, 1187x190
I'm cross compiling for mipsel, and I have some linking related questions.

I need to compile programs for an OpenWrt GNU/Linux system running on a mipsel architecture processor. In itself, this isn't difficult because the OpenWrt project supplies a buildroot for all of their supported architectures and sub targets (eg mipsel ramips for all the ralink mips SoCs), that include a build of the entire toolchain for said architecture.

The complication I'm trying to think through right now is linking against system libraries. OpenWrt has a package management system (opkg) to install libraries and programs, but how can I ensure I link against them properly when compiling/linking against them in my buildroot? eg, I want to use libxml or some other C library in my own program that I'm going to cross compile for the mips box; when I scp the binary to the box how do I ensure it's properly linked? (assuming I pull the library I need from github or some such and build it for mips of course)

If anyone is familiar with CC for OpenWrt: does selecting a package in the menuconfig when making the buildroot also create linkable libraries for it (wasn't sure because you're also meant to use it for image compilation from source). If so, can I menuconfig again, add the package, re-configure and re-make to only build the needed lib? (vs the whole toolchain again which takes over an hour)
>>
>>54413814
>It's literally what the error message
That's what's confusing me, because I only have one method that I implemented called findMin() in my project.
There's a driver file, which has no function called findMin(), a cpp file with findMin(), and then there's no header files in my project since I'm not overriding anything or creating objects. I'm not sure why it thinks there's two methods called findMin().
>>
>>54413494
Yeah, I was just fucking with you. == is fine for ints, and you should use arrays if that's what your prof wants.
>>
File: 1368994987087.jpg (213 KB, 730x1095) Image search: [Google]
1368994987087.jpg
213 KB, 730x1095
I seriously don't get how some people don't understand programming AT ALL
Like for real, so many people don't even know what programmers DO. So many people don't even know how the internet works
How is this even possible
My fucking RA didn't know that snapchat used the internet
>>
>>54410323
My pajeet.
>>
File: 1389224279388.jpg (44 KB, 500x316) Image search: [Google]
1389224279388.jpg
44 KB, 500x316
>>54411150
"The brand became popular in most of the Soviet Bloc countries due to their low price. They are famed as one of the strongest cigarettes available in Eastern Europe (if not the strongest in the world). They were also pictured in many works of art and literature."
They'll still fuck you up, you wouldn't want more than that
>>
>>54414014
to be fair I'm a programmer and I still don't know what I do

something something make programs I think

>tfw in charge of large systems
>>
>>54414061

I need to get my hands on some of this commie tobacco. I wonder if it's imbued with the souls of counter-revolutionary peasants that were buried in mass graves.
>>
>>54413404
don't use system().
http://www.cplusplus.com/forum/articles/11153/
>>
>>54413494
>>54413494
Your while loop is incorrect. In "arrayA[i] = arrayRES[currentPos]" you are assigning a value from the third array(which will never have anything put in it) into the first array when you should be assigning the value from the first array to the third array. Also I'm assuming your int variable z is to track the current index for arrayRES, so you should be using arrayRES[z] instead of arrayRES[currentPos]. An easier way to do what you're trying to do is to do it using a for loop, like this

    for(int j = 0; j < arrayA.length; j++){

if(arrayA[j] == arrayB[j]){

arrayRES[z] = arrayA[j];
z++;

}

}
>>
>>54413891

>when I scp the binary to the box how do I ensure it's properly linked?

The easiest solution to this problem is to static link the library. No dependency issues on client side. Considering you seem to be doing some sort of embedded/IoT thing, dynamic linking isn't as useful.
>>
>>54414383
Heyyyyyy
finally got it to work, I'm really grateful, I think i'm making to many variables so I get kinda lost on my own letters, the way you put it is simpler than how I was thinking about it
thanks man
>>
>>54412043
>Now, the value of c will be 0x78.
not always
>>
>>54414471
>static link the library

I thought about that, but file size implications of that may make it unusable (I'm not sure yet, as ulibc is supposed to be small). The device has 4MiB of storage space for the entire system outside of the kernel image. It MIGHT be ok for a single small program, but I'm guessing it wouldn't fly if I need many programs.
>>
>>54412262
>read EOF
it can't read EOF
>going to return a number between 0 and 255
false
>>54412355
>chars and ints be the same size
yes
>how would you distinguish EOF from a real character
EOF is guaranteed to have a different value
>>
>>54414613

If it has only 4 MiB of storage space, chances are likely that it's not going to run much more than one program.
>>
>>54414678
>chances are likely that it's not going to run much more than one program
You be surprised. It has a lot more memory though (16MiB).

OpenWrt has over 2000 packages, and it runs lean. I'll tell you now though, that aside from all the daemons and scripts it's already running, it's going to run more than a few programs as well.
>>
>>54414511
No problem anon, glad to help; I'm getting back into programming/java myself. As for the amount of variables, the only variable you don't need is currentPos as the for loop is used to track the current index for your first two arrays, otherwise you should be good.
>>
>>54414849
Also, you don't need to declare int i = 0 right after you declare MAX_ARRAY. It's better practice to just declare "int i = 0" in the beginning of the for loop.
>>
>>54414810

Just because you can doesn't mean you should. When I say that it's not going to be running more than one program, what I mean is that because it's an underpowered embedded device, it should not be used for more than one program. It's something you get in bulk, and ship with a product to automate some small task. If you needed it to be general purpose, you would probably want something that cost more than $5.
>>
>>54414944
Maybe I'll just use the built into lua scripting; though I'd like to be able to write C programs for it.

>It's something you get in bulk, and ship with a product to automate some small task
Exactly, but 'primary' in place of 'small'.
>>
How important is it to finish coding challenges for jobs quickly? I took way longer than i should have because windows fucks with my ruby gems and makes me have to do hours of troubleshooting for no reason. I hope i still get the interview
>>
>>54415500
>coding challenges
no
it doesn't matter
it's not important
you shouldnt be trying to get jobs through online challenges anyway
>>
>>54415535
No, I talked with the guy over the phone and he told me if i do well on the coding challenge he'll bring me in for an interview. I feel like I fucked up pretty hard
>>
>>54415630
gg :(
>>
>>54415630
You wouldn't have gotten the job either way.
They're doing this as a formality and they already know they're gonna hire the HR rep's manager's 2nd cousin.
>>
File: oXErj.jpg (140 KB, 1200x1547) Image search: [Google]
oXErj.jpg
140 KB, 1200x1547
i reverse enginnered an apk and i want to edit it and recompile it.

where the fuck do i put the public xml? android studio does not let me create one in the resources directory?
Where do i copy and paste the code to?
>>
>>54410459
>Recursion
>Good performance
>>
I finished my fibonacci VM guys. The problem was with what I was trying to print, lol

Works now, good stuff.

>>54415741
You can literally just save the files in the folder hierarchy you want and then just open the folder as a project and it'll load fine.
>>
>>54410462
histograph is actually pretty easy.
 // print histogram from nlevel to bottom
printf("\n");
while(nlevel >= 0){
for(i = 1; i <= 15; ++i) {
if(length[i] < nlevel)
printf(" ");
else if(length[i] == nlevel)
printf(" _ ");
else printf ("| |");
}
nlevel--;
printf("\n");
}
>>
>>54415755
so i can just edit the package names and public ids and all that shit to my descretion?
because i just wasted like 3 hours typing everything down to my package name and now i got to edit the actual drawable icons to fit my shit.

thanks though but i need more info if you can. its my first project that will hopefully bring in some beer money.
>>
if old consoles had like 16 OAMS or whatever how do they manage things like fonts and 16+ moving entities on screen?
Does it switch sprites out depending on the scanline its rendering?
>>
>>54415850
No idea what you're talking about but you can just open a folder of files in android studio no problem, that's all you should need to know, and frankly all I know that can help probably
nice girl
>>
>>54412283
even though ruby sucks and ur a shitty trip ur right
>>
>>54413891
go ask #openwrt @ freenode:
https://webchat.freenode.net/?channels=openwrt
>>
>>54415850
RIP Kasia
>>
File: funland.jpg (201 KB, 1075x986) Image search: [Google]
funland.jpg
201 KB, 1075x986
/dpt/ guy with a week experience with C here. I have a question I want to catalog imaginary appliances and sort them. But the struct item that contains the description is weird. I'm running a loop to collect information from each equipement, but fgets() seems to only run once.


#include <stdio.h>

struct equip
{
char descri[40];
int qnt;
float pwr;
float hrs;
int days;
float consump;
};

main()
{
int i, c;
struct equip eqp[30];
for(i=0;i<=30;++i)
{
fgets(eqp[i].descri,40,stdin);
scanf("%d", &eqp[i].qnt);
printf("The descsription of equipement %d is %s and the ammount of such devices is %d", i, eqp[i].descri, eqp[i].qnt);
}
}



What I'm doing wrong?
>inb4 living.
>>
ITT: the anarcho-statist-libertarian-capitalist-conservative-christian-liberal being retarded and talking bullshit as usual
>>
>>54416310
>fgets(eqp[i]
struct equip is not a buffer
>>
>>54416449
What does it mean? Why the destination of fgets should be a buffer?
>>
>>54416310
instead of eqp[i].descri do eqp.descri[i]
>>
File: 57202_tobacco_va_lg.gif (322 KB, 1024x675) Image search: [Google]
57202_tobacco_va_lg.gif
322 KB, 1024x675
>>54416367
>anarcho-statist-libertarian-capitalist-conservative-christian-liberal

Look, I'm just trying to be a red-blooded American man.

Add some more words to it and it'll make you feel better.
Thread replies: 255
Thread images: 40

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.