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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 337
Thread images: 40

File: Sieve_of_Eratosthenes_animation.gif (154KB, 445x369px) Image search: [Google]
Sieve_of_Eratosthenes_animation.gif
154KB, 445x369px
anime edition?
>>
#include <stdio.h>
#include <stdlib.h>

void squeeze(char* str1, char* str2)
{
int i, iNew, j, member;
iNew = 0;
for(i = 0; str1[i] != '\0'; ++i)
{
//printf("%c\n", str1[i]);
member = 0;
for(j = 0; str2[j] != '\0'; ++j)
{
//printf("\t%c\n", str2[j]);
if(str2[j] == str1[i]) member = 1;
}
if(!member) str1[iNew++] = str1[i]; // this segfaults
//printf("\t\t%c\n", str1[iNew]);
//printf("%d %d %d\n", i, j, iNew);
}
str1[iNew] = '\0';
}

int main()
{
char* str = "barack hussein obama";
char* str2 = "abracadabra";
squeeze(str, str2);
printf("%s\n", str);
return 0;
}


why does this segfault?
>>
I wrote a fizzbuzz that asks counts how many times fizz, buzz, and fizzbuzz are displayed. God damn. I never would have been able to do it if I hadn't drawn a flow diagram!
>>
>>59835720
are you still in cs50?
>>
>>59835727
It's not even a CS class, its an Engineering class and we're learning Matlab
>>
>>59835720
What? Everytime you print Fizz, you increment a counter by 1. And then you increment the respective counters each by 1 everytime a word gets printed. Why the fuck do you need a flow diagram for that?
>>
>>59835727
Fuck off C-sharp, you were asking inane and piss easy questions yesterday. You have no right to diss others.
>>
>>59835744
Because I am by no means an experienced programmer and it helps to visualize what I need to program.

I thought making Flow diagrams was good programming practice?
>>
>>59835720
Are you being sarcastic on the Internet where nobody can hear sarcastic tones, or are you just actually retarded.
>>
>>59835701
String literals are read-only. Trying to modify them will fug you up.
>>
>>59835766
Fuck you
>>
>>59835740
>ENGINEERING?
good! now build a physical machine that does this with real world materials
>or have a redstone contraption in minecraft (no commandblocks)
>>59835760
i asked 1 question u 'tard and it was just a punctuation error, u fuck off!
>>
>>59835764
Don't overcomplicate simple programs. Soon you will be using OOP in places you don't need to.
>>
>>59835727
You are disowned from using C# as of right now, go pollute another gene pool
>>
>>59835764
they're a meme
>>59835774
i went to pajeet overflow and they said the same thing and it works now. i guess [] isn't just pure syntactic sugar for * like i thought it was. i haven't gotten to that section i K&R yet
>>
>>59835792
O-OK
>>
>>59835793
>>59835760
>>59835740
>>59835727
>>59835720
and i wasn't talking shit... i was asking for a fact.
is the kid still in cs50?
he answered engineering, so while i was typing a response, you flamers trying to start some shit. FFS get a life
>>
>>59835838
Frick off Barb
>>
>>59835844
>Barb
???
>>
someone draw a 4d array right now
>>
>>59835858
just allocate a flat array and multiply your variables by factors of the array bounds.
A 4D array would take forever to allocate if done the idiomatic C way.
>>
File: meme.png (18KB, 1200x800px) Image search: [Google]
meme.png
18KB, 1200x800px
r8 the meme i made
>>
File: 1413338253283.jpg (38KB, 680x684px) Image search: [Google]
1413338253283.jpg
38KB, 680x684px
>>59835676
>implement sieve
>use array of unsigned chars for truth testing, so memory efficient
>only check odd values, so cut array size in half, and forgo initial even sieving, so fast
>happy that I can program well enough to implement this
>try to implement segmented sieve with wheel factorization for memory and sieve optimization
>tenfold harder to implement than standard sieve
>realize I can't program at all and am trash
>>
>>59835875
>A 4D array would take forever to allocate if done the idiomatic C way.
why?
>>
>>59835875
You're retarded
>>
>use strings on a program
>a shit ton of the strings found are pathnames to source code of the application

Is this most likely assert data left over that was never removed?
>>
>>59835893
unsigned i, j, k, l;
int *****a = (int *****) malloc(sizeof(int ****) * n);
for (i = 0; i < n; i++)
a[i] = (int ****) malloc(sizeof(int ***) * n);
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
a[i][j] = (int ***) malloc(sizeof(int **) * n);
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = 0; k < n; j++)
a[i][j][k] = (int **) malloc(sizeof(int *) * n);
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = 0; k < n; j++)
for (l = 0; l < n; l++)
a[i][j][k][l] = (int *) malloc(sizeof(int) * n);
>>
>>59835854
>>59835838
C-sharp, can you help me?
can you tell me in everyday speech:
what's the difference between a class and a struct in C#?
i read the definitions of several sites and in my textbook, but damn it. it's just not sinking in.
how do i know when to use which?
is there any difference in how to write them or how to call upon them?
>>
>>59835955
Well memed
>>
File: oh god the dick.png (100KB, 245x333px) Image search: [Google]
oh god the dick.png
100KB, 245x333px
>>59835955
>5 star pointer
ohhhhhhhhhhhhh
>>
>>59835955
Holy fuck this is retarded. Just allocate the array as a contiguous block.

2d array:
arr[width*height]
2d access:
arr[I*rows + J]

3d array:
arr[width*height*depth]

3d access:
arr[K*rows*cols + I*rows + J]

(access functions may vary depending on your desired ordering)

follow this pattern for
4d
5d
nd
>>
>>59835880
If you formalize it with the official image and a readable flowchart, I'll even save it.
>>
>>59836005
umm yes?
that's the point I was making earlier.
Though in practice, I can't think of any valid reason to have a 4 dimensional array of anything, I've never used more than 3 levels of indirection and it was just a 2D array full of pointers.
>>
>>59835955
I don't see why this would take forever to allocate.
>>
>>59835881
the only failure I see here is that you gave up
>>
>>59835676
Thank you for not using anime photo
>>
>>59836021
This >>59836005 is the idiomatic way is allocating an array
>>
>>59836035
if n is 10, malloc will be called 11110 times
>>
>>59835956
C-sharp seems to have left.
can anyone else help me please?
>>
>>59836021
>I can't think of any valid reason to have a 4 dimensional array of anything
4D totally antisymmetric tensor. I've programmed it into a numerical code that calculates Feynman diagrams.
>>
File: 1468109167579.jpg (41KB, 480x622px) Image search: [Google]
1468109167579.jpg
41KB, 480x622px
>>59835676
I'm going to keep posting this until the meme dies.
  int size = 2000000;

long sum = 0;



boolean[] isPrime = new boolean[size];

Arrays.fill(isPrime, true);



isPrime[0] = false;

isPrime[1] = false;



for(int i = 2; i <= size/2; i++){

if(isPrime[i]){

for(int j = i*2; j < size; j+=i){

isPrime[j] = false;

}

}

}



for(int k = 2; k < size; k++){

if(isPrime[k] == true){

sum += k;

}

}
>>
>>59836005
clarify for me, i don't see how (1,0) and (0,1) don't get put in the same index
>>
>>59836060
I'm in FecesOS right now, can you O3 both methods and show me the assembly?
>>
>>59836080
>Arrays.fill(isPrime, true);
stopped reading
>>
File: tools.png (42KB, 526x213px) Image search: [Google]
tools.png
42KB, 526x213px
>>
for num in range(1,2000000):
if all(num%i!=0 for i in range(2,num)):
print (num)
>>
>>59836206
so this.. is the power.. of python.. woah
>>
Hi lads i have an interesting idea.

seed a random int from 0 to 10^6

then right a while loop that increments +1 until the number is found

How long would this take?
>>
>>59836190
devops was a mistake.
>>
>>59836080
You can start j off at i*i instead of i*2.
>>
>>59836226
It would be found pretty much instantaneously.
>>
>>59835676
I thought it was sieve of aristophanes. Is this the Mandela effect?
>>
>>59836263
you're just dumb, sorry
>>
>>59836242
tic
x = 10^9;
i = 0;
while (i <= x)
i = i + 1;
end
toc


>Elapsed time is 2.927581 seconds.
>>
>>59835676
/dpt/ op images should always be anime themed animated algorithms
>>
Run this program if you dare

x = 10^9;
i = 0;
while (i <= x)
i = i + 1;
fprintf('%d\n',i);
end
>>
>>59836288
This and with traps too
>>
How do FP programmers deal with the fact that IO is actually all their program is supposed to care about. Getting from the input to the output is stuff the compiler should make as efficient as possible. So you're just writing code where the computer should and your paradigm is oriented around writing code there. Dumb.
>>
>>59836286
the 6 magically became a 9, weird
>>
>>59836360
go to bed pajeet, you're tired
>>
>>59836360
All well written programs separate logic (manipulating values) from input and output. Pure FP just forces you to do it in a somewhat esoteric manner, or else risk making your code horrible to work with.

main :: IO ()
main = do
input <- getSomeInputFromIO
let output = transformPurelyFunctionally
displayWithIO output

getSomeInputFromIO :: IO T
transformPurelyFunctionally :: T -> U
displayWithIO :: U -> IO ()
>>
>>59836363
To be fair the 10^6 evaluated in 3/10th of a second. Not exactly instantaneous
>>
>>59836418
you could say the same if it was .0000001 seconds and the statement would be just as valid
>>
>>59836418
Only 10 times faster? 10^6 is 1000 times less than 10^9.
>>
>>59836387
transformPurelyFunctionally <$> getInputFromIO >>= displayWithIO
>>
>>59836439
>>59836418
doesn't your CPU's Ghz determine how long this takes?
>>
>>59836454
Yes, and other factors. For example if it is an Intel or AMD CPU
>>
I bought a Sams Learn C++ book at a thrift store.
Its from 2009 and a couple "editions" old.

Will I still be able to learn properly from it, or has stuff changed enough that ill be learning something antiquated?
>>
>>59836457
what if i have a ryzen cpu?
>>
>>59836473
AMDfags don't count
>>
>>59836418
>>59836454
In HS competitions we assumed 10^8 operations/second for rough estimates
>>
10 HOME
20 SWEET
30 GOTO 10
>>
https://www.youtube.com/watch?v=njos57IJf-0
>>
>>59836454
Yes. But more importantly your OS and more specifically the file stream buffer size. Larger is better in this case.
Benchmarking basic IO is fairly pointless usually.
The compiler can also play a role but I'm not sure how constrained they are on fpritnf
>>
>>59836307
What programming language is this?
>>
>>59836544
hehe epic meme amirite :^)
>>
File: 1470968871244.png (1MB, 1039x988px) Image search: [Google]
1470968871244.png
1MB, 1039x988px
>>59836317
>>
>>59836564
could be a snippet from java, C# or a number of other OOP languages.

but its just basic simple logic (while tatement)
>>
>>59836579
yes.
meme to the normies.
nice easter eggs to those in the know.
the more we know about the characters, the better these ERB videos are.
>>
>>59836598
go back there
>>
>>59836586
None of those languages have "end" though. And fprintf (which isn't even being used properly) is generally considered specific to C.
>>
>>59836583
What anime is this?
>>
>>59836611
>go back there
u wot m8?
where is there?
>>
>>59836622
anime?
MANGA!
still frames vs animation
>>
>>59836564
Closest I can think of is lua.
>>
>>59836626
My bad (I wasn't trying to be funny at all). What manga is this?
>>
>>59836626
Manga is just animation consisting of very few frames
>>
>>59836616
Not that anon, but it's pseudocode.
>>
OP, you are a moron.
Leave a link to the old thread.
Old thread: >>59830279
>>
Describe to me the coolest program you've ever made
>>
I'm working with a 2d CSV where a lot of the entries have commas in them. Is there a way in Python to keep these commas without messing up how the csv is read in? Or to delete them without messing up csv formatting?
>>
>>59836671
made a program that can transfer arbitrary files between 2 devices for my computer networks class

he wrote like 90% of the code already though b/c the class has BAs in it and they can't code
>>
>>59836682
>CSV where a lot of the entries have commas in them
wtf kind of data set is this? i hope they at least have some type of marker around them like "". look into regex if they do otherwise you're fucked
>>
>>59836682
The entries with commas in them are surrounded by double quotes right?
>>
>>59836705
it's for the Quora kaggle competition; the dataset is comments pulled from the site, many of which have commas in them with no marker

I'm not really sure how to proceed but this seems like a really dumb thing to get stuck on
>>
https://www.youtube.com/watch?v=p9YXY45CFpI
>>
>>59836717
>>59836705
>>59836722
>>59836682
wait a second I'm retarded I was filtering out the double quotes too early never mind
polite sage
>>
>>59836671
catches running refridgerators
>>
>>59836722
>many of which have commas in them with no marker

If there's no marker to delineate quotes and separators then it's malformed. There's nothing you can do.
>>
File: horses.png (36KB, 590x272px) Image search: [Google]
horses.png
36KB, 590x272px
self driving cars: let's just put horse brain in them.
>>
>>59836758
>>59836723
>>59836544
stop
>>
>>59836671
I made an Asteroid clone in Visual Basic.
>>
Do people actually find xkcd entertaining?
>>
>>59836852
yes
>>
>>59836227
I have mixed feelings about devops. I've been both devops and more traditional approaches work great and also fail really bad.

Maybe I'm just arrogant, but I tend to think the devops approach, even when it fails, is better than handing your build/deploy pipeline over to the incompetent, which is the alternative failure case. Better to have bad developers be bad sysadmins than waste dev talent on an operations team that doesn't know their ass from a hole in the ground.

Closest I've ever come to murdering a person: build engineer hounds me about a broken build every 30 minutes for 5 hours straight. Everything works in local, I spend ages combing through logs and trying to trace code because it's just too much to ask for access to the build environment. Finally I notice a filename seems like a character off, but remember fixing it recently. Build engineer had been redeploying the same broken build instead of running a new one every time I told him to retry all day. Fucker gets paid more than me too.
>>
>>59836671
Mailserver with an encrypted database, the idea being a host couldn't be compelled to turn over (useful) user records if subpoenaed
>>
>>59836876
how
>>
>>59836916
it is how they were born
>>
>>59836963
with autism?
>>
File: 1464998874180.jpg (72KB, 720x690px) Image search: [Google]
1464998874180.jpg
72KB, 720x690px
>disassemble some program I use to make modifications to it
>find functions in it that apparently take like 30+ arguments

what the fuck
>>
File: 2016.png (48KB, 368x414px) Image search: [Google]
2016.png
48KB, 368x414px
>>59836771
NEVER!
>>
>>59836852
85% yes
>>
>>59837010
85% of people have double digit IQ? I thought IQ was normed though?
>>
>>59836992
It's probably just the compiler optimising by passing certain things on the stack.
Disassembly is often misleading.

OOP does this a lot.
>>
>>59836981
>autism
I wish people here would expand their dictionary of psychopathological and mental disorder insults.
No, I'm not trying to make a point about autism being a big deal by being ironic, I seriously wish to see someone being called e.g. hebephrenic someday.
>>
>>59837053
I was thinking that but wasn't sure if it would show it that way. Lots of weird things I'm finding that absolutely puzzle me but this is fun.
>>
I just spilled my whole coffee on a keyboard I don't even know why I'm even typing this I should wash it or do something about it in the first place probably
>>
i'm studying bitwise operations for my interviews
>>
>>59837138
go clean that shit.
unless it coffee had sugar or milk in it RIP KB
>>
File: cofffe.jpg (78KB, 1280x720px) Image search: [Google]
cofffe.jpg
78KB, 1280x720px
>>59837138
One whole coffee?
>>
uhhh i just heard that interns at the big 4 get paid ~$8k/month

can anyone confirm?
>>
>>59837179
yup it's true. they prolly get paid even more
>>
>>59837185
looking for non-sarcastic response
>>
File: 10383891.jpg (206KB, 1500x1500px) Image search: [Google]
10383891.jpg
206KB, 1500x1500px
>>59837150
>>
>>59837179
Yes can confirm. I studied the jewish tricks in University with a minor in Programming. Interned at an investment bank and was paid 10k a month. Hours was shit and I was made to do the most inane shit ever.
>>
>>59837174
yes
>>
File: 1448840603790.gif (4MB, 270x263px) Image search: [Google]
1448840603790.gif
4MB, 270x263px
>>59837006
>I'm acutely aware
KEKLOL. Very witty.
>>
I tried making a simple random grid generator while drunk. Needless to say, it didn't work as intended, but I'll post it here so at least someone will see it.
#include <iostream>
#include <time.h>
#include <cstdlib>
using namespace std;
#define UP 0
#define RIGHT 1
#define DOWN 2
#define LEFT 3

int arr[9][9];

void resetMap(){
int i;
int j;
for(i = 0; i < 7; i++){
for(j = 0; j < 10; j++){
arr[i][j] = 0;
}
}
}
void generateMap(){
int i = 4;
int j = 4;
int dir;
bool loop = true;
while(loop){
if(i < 0 || i > 7 || j < 0 || j > 10){
loop = false;
break;
}
arr[i][j] = 1;
dir = (rand() % 3);
switch(dir){
case UP:
i--;
break;
case RIGHT:
j++;
break;
case DOWN:
i++;
break;
case LEFT:
j--;
break;
}
}

}
void printMap(){
int i;
int j;
for(i = 0; i < 7; i++){
for(j = 0; j < 10; j++){
if(arr[i][j] == 1){
cout << '#';
}
else{
cout << ' ';
}

}
cout << "\n";
}
}
int main(){
srand(time(NULL));
bool loop = true;
char choice;
while(loop){
cout << "Generate a new map? y/n ";
cin >> choice;

if(choice != 'y' && choice != 'n'){
cout << "Invalid input\n\n";
}

if(choice == 'n'){
loop = false;
}

if(choice == 'y'){
resetMap();
generateMap();
printMap();
cout << "\n\n";
}
}
return 0;
}
>>
>>59837261
>#define 0 1 2 3
>not enum
>>
>>59837261
dir = (rand() % 3);
>>
I'm working on a small python script for facial identification using OpenCV on an OrangePi One.
To speed up the finding and identifying of faces I am using a multiprocess.Pool with a size of 4 (1 per core). Now it can identify me within a second, but usually more than one process will identify me, resulting in a greeting played multiple times, etc.

Usually I would use Threads and a semaphore, but I read that threads aren't really threads in python and would not result in a performance improvement. Is there anything equivalent to a semaphore or lock for multiprocessing in python?

I tried the multiprocessing.lock(), but that resulted in no frames being processed at all, even though it should have never executed lock.acquire()
>>
>>59837343
Don't use python
It is that simple.
Python doesn't thread well.
No one is computer vision uses python
>>
>>59837404
I just used python to try my install originally. It's literally 40 lines to identify someone from a video stream based on a single photo.

I guess I'll switch over to C++ then...
>>
Success is like being pregnant:
Everyone congratulates you.
But no one asks how many times you got screwed to get there.
>>
>>59837441
i hope you get banned for offtopic posting
>>
>>59837444
>offtopic?
it is motivation for the programmer
>>
File: 1490308351166.jpg (86KB, 640x807px) Image search: [Google]
1490308351166.jpg
86KB, 640x807px
>>59837444
If only. Mods are too busy being like Stallman rn.
>>
FOR A = 1 TO 100
OUT$ = ""

IF A MOD 3 = 0 THEN
OUT$ = "Fizz"
END IF

IF A MOD 5 = 0 THEN
OUT$ = OUT$ + "Buzz"
END IF

IF OUT$ = "" THEN
OUT$ = STR$(A)
END IF

PRINT OUT$
NEXT A
>>
>>59837528
Won't this print Fizz FizzBuzz?
>>
>>59837261
the array dimension is 9x9
int arr[9][9];

yet you treat it as a 7x10 in resetMap and printMap, and as a 8x11 in that if condition in generateMap, thus writing in funny places, which is the only way you can "go left", because normally dir = (rand() % 3) can't even point in the left direction (it can only be {0,1,2} )
>>
what would be the biggest hurdle in making a clone of snapchat and getting it big?
wanna call it slapshat and it would be purely for nudes.
>>
>>59835955
Fucking retard. The idiomatic way to do it in C is:
int *arr = malloc(sizeof(int) * x * y * z * t);

Your way is definitely not idiomatic. It is something only C beginners and retards do.
>>
>>59836159
In the 2D case?
 arr[1*width+0];
arr[0*width+1];

These are only the same if the array is width 1.
>>
>>59837818
nah son the way you do it is the way they teach beginners and rtards like me. This guy's on a different level.
>>
>>59837810
Convincing teenagers that it's the cool thing.
>>
I'm trying to get DataKinds to work in Haskell, using this guide: https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/promotion.html

I'm running into some issues when compiling, through:

{-# LANGUAGE DataKinds #-}

data Ze
data Su n
data Nat = Ze | Su Nat

data Vec :: * -> Nat -> * where
Nil :: Vec a Ze
Cons :: a -> Vec a n -> Vec a (Su n)


Is supposed to work, but I'm getting this:
    • Expected kind ‘Nat’, but ‘Ze’ has kind ‘*’
• In the second argument of ‘Vec’, namely ‘Ze’
In the type ‘Vec a Ze’
In the definition of data constructor ‘Nil’


Any ideas?
>>
>>59836223
Yeah run that shit on a vps shitbox somewhere and come back in the morning to collect the result. fuckin aces.
>>
so i'm focused mainly C# and a little Java due to focusing on mobile market (today's NEWS: android is the #1 OS for accessing the web)

but what other languages are in high demand? and why? what demands it?
>>
>>59837981
Javascript is the new Java
Everything
>>
>>59837950
You're doing both at once

Comment out the TYPES Ze and Su
ALTERNATIVELY put a ' before Ze and Su when you use them
>>
Where can I find good programming kneesocks?
>>
>>59836190
I like making tools and infrastructure for programmers such as myself.
>>
>>59836544
That's actually pretty alright.
>>
>>59837950
>>59837996
i.e.

data Nat = Ze | Su Nat
data Vec :: * -> Nat -> * where
Nil :: Vec a 'Ze
Cons :: a -> Vec a n -> Vec a ('Su n)
-- in some cases the ' is redundant and it can be inferred
>>
>>59837996
>>59838023
Thank you.
>>
>>59836648
Thanks!
>>
>>59838043
>thanking someone who called you a moron
>>
>>59838058
Hello.
This is bait.
>>
File: SCR_1491897255.png (5KB, 132x79px) Image search: [Google]
SCR_1491897255.png
5KB, 132x79px
>>59838058
>new IP in thread
>calls me OP
nice dude
>>
>>59838073
Some of us aren't faggots and use 4chan as it was intended
>>
File: objects-waifu.jpg (370KB, 1098x2986px) Image search: [Google]
objects-waifu.jpg
370KB, 1098x2986px
get mansplained
>>
>>59838081
Except its a bad explanation. It covers inheritance. Not objects. Inheritance isn't what oop is about.
>>
>>59838079
>muh vanilla ludditism
>>
>>59838106
If you want to identify individual posters, go to reddit.
>>
>>59838099
don't objectify me shitlord
>>
>>59838118
new IPs != Ids
Anyone with a dynamic IP can post again if they want.
>>
>>59838139
the only purpose your tool serves is to reduce anonymity
>>
>>59838148
>muh freedoms are under attack from a shoddy tool
nah
>>
File: propain.png (228KB, 411x354px) Image search: [Google]
propain.png
228KB, 411x354px
>>59835766
If you are unable to pick up the context of his wording there you should speed up natural selection and just k your s.
>>
stop shitposting now
>>
File: moot.jpg (85KB, 1024x512px) Image search: [Google]
moot.jpg
85KB, 1024x512px
>>59838166
who are you quoting?
>>
>>59836206
If you were trying to print primes, it's wrong. 1 is not a prime number. Prime numbers have 4 integer divisors, e.g: 2 -> (1, 2, -1, -2).
>>
Don't bully javascript
>>
>>59838195
FooNaN
>>
>>59838173
01110100 01101000 01100001 01101110 01101011 00100000 01111001 01101111 01110101 00100000 01100110 01101111 01110010 00100000 01111001 01101111 01110101 01110010 00100000 01110011 01101000 01101001 01110100 00100000 01110000 01101111 01110011 01110100 01101001 01101110 01100111 00100001 00001101 00001010 01100010 01110101 01110100 00100000 01110000 01101100 01100101 01100001 01110011 01100101 00100000 01001011 01011001 01010011 00100001
>>
File: Gbprintercreepy.jpg (39KB, 320x290px) Image search: [Google]
Gbprintercreepy.jpg
39KB, 320x290px
>>59838186
He's paraphrasing the previous poster.
>>
>>59838219
I never said anything about "freedoms"
>>
I only know a bit of pascal, what should I start learning ?
>>
how do I apply my programming skills to get gf help ty
>>
>>59838226
The rest of pascal, presumably
>>
>>59838226
Graduate to Ada, my dude
>>
File: CnfaodyXgAA7zOS.jpg:large.jpg (201KB, 890x1959px) Image search: [Google]
CnfaodyXgAA7zOS.jpg:large.jpg
201KB, 890x1959px
Nice to see that /dpt/ is still as good as I remember
>>
>>59838236
no one uses it, so it will be nice to work some thing useful
>>
File: Cb3sqXoUsAAn_lA.jpg:large.jpg (100KB, 669x1099px) Image search: [Google]
Cb3sqXoUsAAn_lA.jpg:large.jpg
100KB, 669x1099px
>>59835989
>>59835955

OSGTP prophesied HIS arrival
>>
>>59838278
i like that akarin image
>>
File: discipline.png (33KB, 389x342px) Image search: [Google]
discipline.png
33KB, 389x342px
>>59838290
Who
Tell me
>>
>>59838193
Would it even print 1? Because
>if all(num%i!=0 for i in range(2,num)):
would be
>if all (1%i!=0 for i in range(2, 1)):
>>
Probably a really dumb question but I don't know what question to search for on google so I get irrelevant answers.

In Java, when does an implicit conversion happen at runtime and when does it happen at compile time? For example, if I have:

double a = 5; // compile time?
double b = 5.0 + 5; // compile time?
int c = 2;
double d = Math.min(a * b * c + 10, 40); // c, 10 and 40 converted to double during runtime?


Am I right? Basically if it's not a simple assignment like a/b/c it's better to use the explicit type (10.0, 40.0, etc) to avoid the extremely minuscule but easily avoidable runtime conversion costs?
>>
if it's part of the structure of the program it runs at compile time

if it's and action the built program does, it happens at runtime
>>
File: 1476988725982.jpg (630KB, 641x917px) Image search: [Google]
1476988725982.jpg
630KB, 641x917px
Any ausfags here?
What's the computer science course at USyd like compared to at Macquarie?
>>
>>59838370
Kind of confused on what you mean. Are the comments in >>59838350 correct in what happens at compile/runtime? I know in the grand scheme of things I shouldn't even worry about this but I just want to know (or if you know of a resource that explains it since I'm not sure what terms I should be googling).
>>
This isn't really programming, but what the fuck do you do with primary and foreign keys in a many-to-many relationship in a table?
>>
File: Root.jpg (37KB, 602x374px) Image search: [Google]
Root.jpg
37KB, 602x374px
>>59838404
>nice get: 404 - answer not found
jk. more in depth check out "HeadFirst Java"
>>
>>59836473
Your house burns down.
>>
taking a break from working on my coding...
what shows, movies can i watch for coding/tech jobs inspiration?
the internship is funny, but seems lacking.
>>
>>59838419
Make a table of associations, containing a primary key from both sides
>>
>>59838419
You make an in-between table that links to primary keys of both tables you want m:n association. The entries in this middle table are the associations.

Simple, right?
>>
>>59838529
Halt & Catch Fire was alright.
>>
>>59838225
It's paraphrasing. He interpreted "reduce anonymity" as "freedoms under attack".
>>
>>59838637
That's not what paraphrasing is.
Paraphrasing:
>express the meaning of (something written or spoken) using different words, especially to achieve greater clarity.
>>
>>59838674
Implicit in all communication is that you only do attempts.
>>
Sup /dpt/. I'm supposed to make a Puppet script to configure some program as an assignment. I also want to start using Git, so I figured I might as well handle both at the same time. What are some important, useful or nice-to-have options you have set in your .gitconfig file?
>>
How can I retrieve a list of methods and fields of a class with the class name in Java?
I have a method that's supposed to receive a String (wich is the class name (or path, haven't decided yet)) and it's supposed to return the list of field in this class.

Anyone knows ?
>>
File: beautifulimage.jpg (634KB, 2000x1333px) Image search: [Google]
beautifulimage.jpg
634KB, 2000x1333px
Is there any reason I should avoid C++ and QT for android development?
>>
>>59838827
Regex, bitch boy
>>
http://doc.qt.io/qt-5/android-support.html
if you like restrictions, go for it.

otherwise, C# xamarin
or pure Java (maybe use RX, FX, etc...)
>>
>>59838894
sepples is convoluted cluster fuck.
You can either pay for QT or use it with LGPL license, it might have some problem with static linking?
Otherwise it seems like best library for cross platform guis.
>>
File: dd1.png (102KB, 200x207px) Image search: [Google]
dd1.png
102KB, 200x207px
>>59838894
>>59838940
see
>>59838939
>>
>>59838950
>http://doc.qt.io/qt-5/android-support.html
Where the fuck do you need qtwebkit?
Javafx has terriple API and it's pretty slow.
I have no experience with xamarin but I doubt that qt is somehow more restricting than xamarin.
>>
>>59838976
>somehow more restricting than xamarin.
VS/xamarin opens up the whole world. what are you on about?

watch & learn:
https://www.youtube.com/watch?v=ra3Pd8KoVOw
>>
>>59839020
Fuck off microshit shill nobody likes you.
>>
>>59839038
stick with notepad++ then, tardo
>>
>>59839058
Pajeet calm your shit.
No self respecting person would use Windows/VS/notepad++
>>
Can anyone recommend a good book on reverse engineering?

I've gone through most of AoA to learn 8086 assembly, but there are still so many gaps in my understanding of the grand scheme of things i.e how processes are loaded into memory from disk or how an operating system handles shared memory for libraries
>>
>>59839020
remind me when it has first class support for Haskell, Idris, OCaml, etc
>>
>>59839497
How would that even work?
A built in REPL?
>>
when, if ever, does the advent of new hardware affect programmers?
(new CPU is released, MoBos supporting more RAM, PCIe X512, etc...)
>>
>>59839507
If it was C library with bindings to those languages. Then it could just have some kind of build tools that have project template for platforms like android that spawns opengl context then the library just draws to that context.
Kivy and lambdanative work like and I assume qt does too.
>>
>>59839511
If you're an embedded systems programmer, often.

If you're doing high-level stuff, rarely, except that "wow I have more computing power!"
>>
>>59835676
I've been too lazy with programming since I learned the basics decade or so ago.

Whats the language of choice now to start building programs? Still c++/C/c#? Hows rust/golang for building desktop programs?
>>
>>59835701
It segfaults because you didn't use Rust.
>>
>>59839786
>Rust
kek
>>
File: output.webm (232KB, 359x319px) Image search: [Google]
output.webm
232KB, 359x319px
>>59839071
Windows 10 is obviously the best OS, it even automagically breaks the start button and refuses to start explorer.

Side note: Anyone know where to get bb4win?
>>
>first time I need js help
>/wdg/ is dead
>/sqt/ is for retards
>so pajeets are useless
what do?
>>
File: what the fuck.webm (2MB, 1124x525px) Image search: [Google]
what the fuck.webm
2MB, 1124x525px
>>59839875
and this smooth, amazing folder action!
>>
>>59839933
Your mouse movements piss me the fuck off for some reason.
>>
>>59839911
There's this handy website called Google that you might find useful.
>>
>>59835956
>>59836067
The big distinction you're looking for is "reference type" vs "value type".

Reference types/classes (typically) live on the heap, and the variable is a pointer to wherever that lives in memory.

Value types, like structs and primitives like "int", have variables that actually contain that information wherever it is.

So copying a struct's variable actually copies data, where copying a class's variable copies a pointer, or a signpost pointing to where the data is in memory.

As to the other differences functionally between them:
>classes can do inheritance, structs cannot
>classes/reference types can be null, structs/value types cannot without being explicitly marked "nullable" (e.g.
decimal? muhNullableDecimal  = null;
)
>probably a fuckton of other things you can google
>>
>>59836877
did you call him out?
i would've fucking lost it at that point
>>
>>59838099
>It covers inheritance
No, it doesn't.
>>
>>59839933
Do you have a raid card? My Win10 install used to do that when a HDD attached to a raid card had to spin up. The drive would spin up and Windows would lock up completely. Only way to fix was a reboot.

Since then I got rid of the card and I haven't had any problem since.
>>
>>59840059
This is on my main hard drive, on a laptop, though the hard drive should not be spinning down to the point where it takes that long to right click on a folder.
>>
>>59838940
>You can either pay for QT or use it with LGPL license, it might have some problem with static linking?

Yes, basically, you can either link dynamically and it's LGPL and you can sell your program commercially and do whatever else, or if you want to statically link you'll need to pay for the other license.
>>
i hate UIs
>>
>>59840059
If you go to power options and disable turning off inactive hard drives this will prevent that from happening.
Or something along these lines, because I remember back when I used Windows I had a similar issue where the explorer would lock up for secondary drives and wait for them to spin up and disabling the power saving for HDDs fixed it.
>>
>>59840197
ui is fun, silly yotsuba
>>
>>59839507
the same for any other language

though monads + ides would be great
>>
>>59840269
meh
integrating ui without shitting up your code is always difficult, and having to use external designers is a pain
not to mention designing a good ui is hard as shit
i just want to code man
>>
>>59840294
>monads
Trash.
>>
>>59840294
>though monads + ides would be great
What makes you think this isn't a thing?
>>
File: 1410564108334.png (82KB, 694x801px) Image search: [Google]
1410564108334.png
82KB, 694x801px
>>59835720
>>
File: xaml huh.png (5KB, 482x193px) Image search: [Google]
xaml huh.png
5KB, 482x193px
how do i find my designer view?
want to be able to select elements on the fly

xamarin website: can't find answer, just stuff on how to use the functions. but not what to do to get the designer view started.
>>
nth for node.js
>>
>>59840406
It's not that bad for a dynamic language.
>>
>>59840349
include boost
>>
>>59840331
i have yet to see anything that uses monads to interact with the IDE
>>
>>59840455
C# has monads and has some of the best IDE support around.
>>
>>59840406
>>59840418
what do you even use it for?
i've seen it used in backends, and there's electron for writing client side apps (atom, vs code)
what else?
>>
>>59840458
I didn't say "has monads and also has IDE support"
>>
>>59840469
Can you try to better explain what you desire?
>>
>>59840475
use of monads, com
>>
>>59835701
>C
It's a feature
>>
>>59840475
>>59840477
use of monads, comonads to interface between the program and the IDE, including evaluation for instance, possibly even automating IDE usage, etc

you could extend this to have a library that exports several monad types for stuff like command line interaction, graph interaction, etc and then right click in the IDE and have it run it
>>
>>59840432
+100Mb Faggot.
>>
>>59840465
It's great for prototyping APIs, RPCs, and other networked programs. Mostly because it's dead simple and has a huge package ecosystem so you can get a PoC up and running fairly quickly.
>>
>>59835676
how did you guys start off?

Not asking what you started learning but rather how was your first 3 months of learning to programm? How long did you study each day?
>>
>>59840349
Do programming in Gentoo linux+GTK4.
>>
>>59840532
I had programming classes in college, but it didn't really click until I start programming to accomplish things for a sysadmin-type job.
>>
>>59840584
what about your daily routine?
>>
>>59835797
>i guess [] isn't just pure syntactic sugar for * like i thought it was
It is though.
Just because it is working doesn't mean that the code isn't fucked up. You probably have undefined behavior somewhere.
>>
>>59840599
Well, once I had a basic understanding of how to start a project, build it, and whatnot, it was constantly breaking things I wanted to do down into small steps.

Simple example: list the largest files within a folder or harddrive, recursively searching all the way down the nest.

Had to figure out how to:
>List files in a folder
>do this recursively
>get size information
>store it all in a data structure
>sort the data structure, retaining all of the file information
>output to a GUI
>manipulate the data in many ways to get it to display meaningfully on the GUI
Last but not least:
>make it perform not like shit, which started to involve threads and async programming, as well as other optimizations

It's a simple task, but there's lots of components if you break it down sufficiently. From there, you start to add tools to your mental toolbox of things you know how to accomplish. After that, you apply what you know in novel ways to solve other problems, which could be just about anything.
>>
>>59840599
>>59840658
And the actual routine is simply to learn how to do each individual tasks. Whether that's via StackOverflow, obscure forum posts, official documentation, or ideally a mix of all-of-the-above, you eventually start to simply know how to do all sorts of things in a language.
>>
Reminder to program literally everyday
>>
>>59840532
began with ricing out mIRC when I was 11. no ragrets
>>
thinking of starting my own company and work as consultant doing small jobs for other companies
anyone who did something similiar?
>>
>>59840807
Refer to the discussions in the last thread.

It's not all sunshine and daisies. In fact, it's likely that you'll fail in this endeavor, and even more likely that you won't get past the point of barely being able to sustain a meager lifestyle.
>>
>>59840723
Obey your corporate master.
>>
>>59840789
>>59840658
>>59840671
how many hours each day?
>>
>>59840924
25 hours/day
8 days/week
>>
>>59840924
That doesn't even make sense.

You sound like one of those NEETs that thinks if you force yourself to set aside the anime and vidya for precisely 4 hours a day, that in 6-12 months you'll somehow have the social and technical skills to get a job and move out of mom's basement.

Different people learn at vastly different speeds, and the quality of time is much more important than the quantity of time.
>>
>>59840959
I just want to see the modus operandi of other people, why is that so bad?

I'm not expecting that If I do X for Y amount then something DEFINITELY will happen.
>>
File: codejam.png (48KB, 821x90px) Image search: [Google]
codejam.png
48KB, 821x90px
y-yay
google sama is impressed
>>
>>59840620
Dude, arrays and pointers ARE NOT the same thing.
>>
my project partner did virtually 0 work and I had to code his parts of the code last night and ended up turning an incomplete project

is this what real life is like
>>
>>59841188
Yeah, if you're a spineless faggot who doesn't properly monitor progress of team members.
>>
>>59841201
hes really dumb so I was just giving him extra time. Shant do that next project
>>
>>59841188
Make sure you tell the professor
>>
>>59841215
Protip: either ensure/agree to finish segmented parts of the project well ahead of the due date, or plan to do the project yourself and inform the professor that the person you're working with refuses to actually do the work.

If you let someone other than you affect your grade negatively, you're doing it wrong.
>>
>>59841133
what are the differences?
>>
>>59841215
>really dumb
>virtually 0 work

he's not dumb, he is probably a lazy faggot
be careful anon or you end up doing his homework for eternity
>>
>its a rust talk where the presenter cant stop mentioning that it isnt an intro talk when getting into anything slightly above hello world

even the salesmen are memes
>>
>>59840532
I was like 16 or 17 and found one of those chatbots (pyborg)

It had a module to connect to IRC but I wanted it to connect to MSN

I found bitlbee and that it could connect to MSN

So I tried to make it join bitlbee and send the connect message

it did not turn out well but at least it got me started on python
>>
>>59841294
First of all in terms of the topic OP string literals assigned to char* are usually implied to be read-only static data and modifying them is usually disallowed. String literals assigned to array objects is syntactic sugar for array initialization, and you don't need to specify the size, it is automatically determined.

For instance
char a[] = "wew lad";

is equivalent to
char c[8] = {'w', 'e', 'w', ' ', 'l', 'a', 'd', '\0'};

but for char*,
char *s = "wew lad";

gets assembled into a read-only string "wew lad" in the .rodata section and s is a char* (an integer) that points to the first byte in that string. Maybe this helps open your eyes to the fact that array are an aggregate type, while pointers are just integers with a special set of operations available for their use.

Arrays are usually allocated on the stack and are mutable (but in this case because of the initialization it might decide to put it in a mutable static data section).

This of course doesn't explain all the difference between arrays and pointers. But suffices for this topic.
>>
>>59841239
I have an even better protip: charge money for it. Seriously, start the project as early on as possible, and if you see the person doesn't contribute, make him an offer. They usually agree.
>>
Arrays are harmful.
>>
>>59841495
thanks, that was informative
>>
>>59841508
how much is fair, 20-50 bucks? The next project is going to be a bit harder so I might as well take it all.
>>
>>59838081
this shit is gay and doesnt explain anything
>>
>>59841322
link?
>>
database modeling issue
i want to assign permissions based on both whole companies and single individuals, but i dont want to create a ton of different tables like:
CompanyPermission
PersonPermission
xxxPermission
etc

whats the standard way of doing shit like this?
>>
Anyone willing to take the challenge?
>>59834943
>>
>>59841508
this is a bad idea desu
it can get you kicked out of the institution as it is plagiarism of sorts which is pretty serious
>>
>>59841930
try SO or your homework needs
>>
>>59841930
Why the fuck did you link to a post which links to a pastebin which links to github
>>
File: carrots-win[1].png (103KB, 1000x1000px) Image search: [Google]
carrots-win[1].png
103KB, 1000x1000px
I've looked a bit into CSS-grid and am now wondering.

How is it that every Tutorial manages to botch the presentation of a different part of the standard?

( http://cssgridgarden.com/ )

It seems every tutorial fails in a different aspect.
>>
>Regular Expressions
>C#

Can someone explain me the black magic.
I just want to check, if my string isnt something that fucks up the filepath

Regex pathCheck = new Regex(@"\/:*?"<>|");
if(pathCheck.Match(myString))
throw new ArgumentException("myString name must not contain \\/:*?\"<>|");


How do i escape this little motherfucker " in the Regex? @"\\/:*?\"<>|" didnt work either

>inb4 fucked up formatting
>>
>>59835955
Do pointers of different types have different sizes or can you use sizeof(void *) for all of those malloc calls?
>>
>>59841942
The post explains the need for the pastebin link. Blame 4chan.
>>
File: daly_porgammint_rhead.jpg (3KB, 177x193px) Image search: [Google]
daly_porgammint_rhead.jpg
3KB, 177x193px
>>59835676
>>
>>59842203
On any modern OS they should all have the same size but it's implementation dependant.
>>
Anyone has ideas for gui programs? i just wrote a simple time management tool in pyqt and need ideas
>>
>>59841616
Depends, but anything bellow 50 is not worth it. Take half in advance. And even then it's cheap - people in civil engineering do this almost on a daily basis and take at least 4 times more for a single project.
You should value yourself a little so try doing it for more. To put it into perspective, take the time you had to spend on the assignment and see how much you would make in that time by flipping burgers. You might as well practice bargaining a little.

>>59841935
People do this more often than you think. Just don't brag about it in front of everyone.
>>
>>59842377
A GUI REPL for your favorite language that doesn't have one.
>>
>>59842377
You could create a version of DirStat, like described here: >>59840658
>>
what does dpt think of computational sciences?
>>
why is opengl so messy?
>>
>>59842377
IQ test that uses a database to store questions and answers. Pretty useless, but a fair exercise, plus you might need someday something like that as a template for e.g. some sort of a class presentation.
>>
>>59842518
Vulkan, lad
>>
How/why is GUI work such a gigantic jump up in complexity? I thought XAML was supposed to make easy/light UIs relatively easy. Just want a fuckin' progress bar but I gotta sacrifice my left arm and firstborn to the BackgroundWorker just to be told by intellisense that I can't pass other arguments alongside a BackgroundWorker to a method. Is this why people go through the overhead of things like MVC? Is it necsesary even though I'm not even breaking 250 LoC/3 classes outside of the MainWindow/codebehind?
>>
I'm trying to learn about classes in C++. Why the fuck can't I do a simple print out in a class.
>>
>>59842203
Don't worry, he's retarded.

>>59841495
Well since I have some time I'll go a little more in depth.

Run this on ideone or godbolt or whatnot.
char a[15] = {0};
char *b = a;
printf("%zu\n", sizeof(a));
printf("%zu\n", sizeof(b));

The results should be 15 and 8.

a is an array, which is an aggregate type meaning that a is really one 15 byte value, the type char[15] is 15 bytes wide. b, however, is a pointer, an integer that hold a memory location, which depending upon your architecture is probably 4 or 8 bytes (32 or 64 bit arch). When you use an array it uses pointer semantics, which is why so many people confuse them. What I mean is that when you reference an array or a pointer using the index notation it really translate that into pointer math.
 b[5] -> *(b + sizeof(b[0])*5)

As a side note, that's why this code is valid syntax
5[b] -> *(sizeof(b[0])*5 + b)
.

Note in the above examples the
sizeof(b[0])
. This is one of the major reasons why you can't just treat arrays as pointers. This becomes more relevant with higher-dimensioned arrays.

int z[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
printf("%d\n", z[2][1]);

Lets see what's happening when indexing the z array. But before that how is it represented in memory? Well think about the semantics of arrays as aggregate types. z is an array of length 3, where each member is an array of length 3 of ints. The underlying type of the out-most array is int[3], and because arrays are aggregate type that means a contiguous 12 byte area. So what is z? An array of length 3 of 12 byte areas. With that in mind it's easy to see how the array is laid out. all the int values in the underlying arrays are laid out sequentially, and each of those underlyring arrays in laid out sequentially.

So, in memory the 2D array looks like
[1, 2, 3, 4, 5, 6, 7, 8, 9]

cont.
>>
>>59842628
Because you didn't put it in a method.
>>
>>59842628
you have to put it inside a method, and then call the method
>>
>>59842628
printing a has nothing to call with
You cant do
JC.cou<<[...]


you need to put it in a function.
void print(int);

JC.print(a);
>>
what type is i in sepples?
auto i = ~0;
>>
>>59842628
nigga you retarded? Read a book.
>>
>>59842581
>no osx support
>>
>>59842645
>>59842652

why wasn't anything printed?
>>
Can I use gtk for a simple turn based game? I have used sdl before, but because I need to update the GUI only every turn, I'd quite like to be able to use someting like gtk so buttons just werk and I don't have to program them myself.
>>
>>59842750
install a non-meme os
>>
>>59842757
make a Jesus_Christ type and initialise it
call its fuck_classes method
>>
>>59842757
Because you have no goddamn clue what you're doing.

Go read a book.
>>
>>59842633
>cont.
yes, please
>>
>>59842705
¯\_(ツ)_/¯
>>
>>59842757
lol
>>
>>59842757
literally go read something anon, you have no clue
>>
>>59842705
Probably a 32 bit int.
>>
>>59842757
What programming language did you learn on?

Was it Javascript? Python? Who taught you retarded shit like this?
>>
>>59842757
You have to call it in main, lad.

int main()
{
Jesus_Christ jc;
jc.fuck_classes();
return 0;
}



pick up a book please.
>>
File: 1481933632025.png (18KB, 203x209px) Image search: [Google]
1481933632025.png
18KB, 203x209px
>>59842757
jesus fuck
>>
>>59842806
jc denton?
>>
File: cute anime pic 0022.gif (40KB, 243x236px) Image search: [Google]
cute anime pic 0022.gif
40KB, 243x236px
>>59842757
I'm gonna stop you right here and tell you to figure it out on your own before you make it a habit of coming here for a bunch of tiny shit
>>
>>59842633
So when you index that array
z[2][1]
What's the equivalent pointer statement?

Well the first index, 2 yields
(z + sizeof(z[0])*2)
, and because arrays are aggregate types sizeof(z[0]), the underlying array, is 12 (3 4-byte ints). The next index exapands on the address calculation to index the underlying array
((z + sizeof(z[0])*2) + sizeof(z[0][0])*1)
Where sizeof(z[0][0]) is the underlying type of the underlying array, sizeof(int). This gives the correct addres of the int indexed by the expression.

The difference between arrays and pointers shows itself if you try to apply this logic to a pointer-to-a-pointer.

int **x = z;
printf("%d\n", x[2][1]);

This code segfaults. Why? Doing the same operation of translating the indexes shows why.
((x + sizeof(x[0])*2) + sizeof(x[0][0])*1)

What's the sizeof(z[0])? Well the underlying type of an int** pointer is int*, and from the previous post, sizeof(int*) IS NOT the size of the array, but the pointer.

If you are using int** as a 2D array realize that an int** can be viewed an array of int*s, NOT INT ARRAYS. pointers are integers, NOT ARRAYS.

That's why when you pass a 2D array to a function you must write it as such
void foo(int arg[][3]) { ...

To give the compiler the information that the underlying type of the arg array are int arrays of length 3, not a pointer.

For future reference, this might help.
int a[3][3];
sum(a, sizeof(a)/sizeof(a[0]), sizeof(a[0])/sizeof(a[0][0]));

int sum(void* _arg, size_t rows, size_t cols) {
int (*arg)[cols] = _arg;
...
}
>>
>>59842935
you make me wet with that dirty, sexy talk about arrays and pointers, sempai
>>
typescript is comfy
>>
>>59842633
>>59842935
you can just use sizeof(*b) instead of sizeof(b[0])
>>
NEW THREAD!

>>59843315
>>59843315
Thread posts: 337
Thread images: 40


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.