[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: 21
File: spaghetti.jpg (374 KB, 1000x1000) Image search: [Google]
spaghetti.jpg
374 KB, 1000x1000
old thread: >>52441370
Fun fact: mods deleted the last 7 /dpt/s posted.

What are you working on, /g/?
>>
Are function pointers idiomatic C?
>>
>>52446984
DONT DELETE PLS THX
>>
>>52446984
ThirD
Reading through this
>>
x-macros are really cool.
>>
>>52447009
save yourself a lot of pages

visualgo.net
>>
>>52446992
>idiomatic C
In my experience, there's no such thing anon. C has been around long enough that "idiomatic C" is whatever conforms to the style guide of the project you're working on.

But yeah, function pointers are fine as long as you've got a good reason to use them. And shoehorning in functional programming doesn't count as a good reason.
>>
Removing whitespace or putting everything on one line doesn't make your code smaller.
>>
>>52447031
Idiomatic C means conforming to the design patterns encouraged by the language spec and not trying to abuse structs in an object oriented fashion.
>>
>>52447033
optimization does that for you anyways lel
>>
>>52447031
What about writing a state transition table for a finite state machine?
>>
>>52447073
what about it?
>>
>>52447073
I wouldn't know about that. I just know that I work on a frankenstein's monster of an embedded system cobbled together from several different open source projects written in C, and each of them has a completely different coding style. Each project claims to have found the "idiomatic" way of writing C, and each codebase sucks just as much as the last.
>>
I will literally program all replies to this post in the C programming language.
>>
which is better
for (i = 0; i < 10; i++){
stuff;
}

or
for (i = 0; i < 10; i++)
{
stuff;
}
>>
>>52447026
this website would be much nicer if it wasn't full of slow animations
as if anyone actually needs the play-by-play psuedocode highlighting
>>
>>52447144
int i;
for (i = 0; i < 10; i++)
{
stuff(i);
}
>>
>>52447144
I've always preferred the second, it looks much cleaner to me.
>>
>>52447144
literally the same. C optimization takes care of that shit anyways

>>52447154
it helps you understand what it's doing. If it was so intuitive in the first place there wouldn't be whole classes devoted to the subject.
>>
>>52447033
it does when your code isn't compiled
>>
File: ss+(2016-01-15+at+10.46.52).jpg (14 KB, 569x89) Image search: [Google]
ss+(2016-01-15+at+10.46.52).jpg
14 KB, 569x89
>>52447166
>>52447167
b-but
>>
>>52447218
K&R only advocates that style because it saves space in the book
it's called K&R style for a reason
>>
>>52447195
Your hard disk has block alignment though, so unless you can save a ridiculous amount of spaces, it won't make your file any smaller in reality.
>>
>>52447225
i have a friend who swears by it though
>>
>>52447229
I was implying that its for transferring the code over the wire, to users.

(hint: javascript)
>>
>>52447142
Well that was easy.
>>
>>52447307
it looks difficult to read in nested loops
>>
>>52446984
>What are you working on, /g/?

Moving my application servers off Linode after the whole.. Linode situation.
>>
OCAML IS LOVE, OCAML IS LIFE!
>>
File: high_density_memes.png (53 KB, 800x519) Image search: [Google]
high_density_memes.png
53 KB, 800x519
>>52446984
>>52446828
>>52446617
>>52446588
>>52446550
Post your memes in your favorite meme, everyone. Bonus points for meme editors.
const readline = require('readline');                                       

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

rl.question("Enter dank meme: ", (answer) => {
console.log(answer);
console.log(answer.slice(1).split('').join('\n'));

rl.close();
});
>>
>>52447115
Whether it's a good reason to use function pointers.
>>
>>52447408
#include <stdio.h>
#define BUFF_SIZE 1024
int main () {
int i;
char str[BUFF_SIZE];

printf("Enter whatever: ");
fgets(str, BUFF_SIZE, stdin);

printf("\n%s", str);
for (i = 1; i < strlen(str); i++) {
printf("%c\n", str[i]);
}
return 0;
}
>>
>>52446984
>Fun fact: mods deleted the last 7 /dpt/s posted.
good. maybe we won't have to post early threads to """"""""compete"""""""" against the trap poster
>>
File: the himouto life is suweeeeeet.jpg (437 KB, 1000x1000) Image search: [Google]
the himouto life is suweeeeeet.jpg
437 KB, 1000x1000
>>52447408
#include <stdio.h>

int main(int argc, char **argv)
{
if (argc != 2)
{
printf("%s %s\n", argv[0], "\"text to meme\"");
goto end;
}
printf("%s\n", argv[1]);
int i;
for (i = 0; argv[1][i]; i++)
{
printf("%c\n", argv[1][i]);
}
end: return 0;
}
>>
>>52447408
Why do your line numbers go backwards?
>>
need a quote for some freelance work.

Need a program which can add a product to a shopping cart (HTTP post method) then check out as fast as possible (running this task at a certain time).

reddit quoted me literally thousands of dollars -.-
>>
>>52447502
It prints the first character twice ie
me
m
e

It also doesn't allow for spaces.
>>
>>52447532
fixed it, just change the starting index to i = 1
$ ./meme "ayy lmao"
ayy lmao
y
y

l
m
a
o
>>
i like functional programming

levels the playing field for me and my non CS degree. I took way more math than CS people.
>>
>>52447517
Yes, thousands of dollars.
Don't you value your time?
>>
File: relativenumber.png (41 KB, 810x278) Image search: [Google]
relativenumber.png
41 KB, 810x278
>>52447511
They don't. The zero follows my cursor. I'm using vim, so being able to tell exactly how far away a line I'm trying to jump to is fantastic.
>>
>>52447545
I never realised that putting quotes around input args made them one argument.
>>
>>52447546
kill yourself
>>
>>52447517
>coming here butthurt because redditors won't work for free
>>
>>52447609
I'm not asking them to work for free. I just can't see it being a project which takes more than 10 hours.
>>
>>52447618
You're asking them to build you a working product.
You have right to be undercutting them just because your non-technical ass thinks this is 10 hours worth of work.
>>
>>52447641
*no right
>>
>>52447423
wait you dont need #include <string.h> for strlen()?
>>
>>52447618
then do it yourself if you think that
>>
>>52447595
> I never realised that putting quotes around input args made them one argument.
In Unix, that's down to the shell. argv[] is whatever the caller passes to execve().

On Windows, programs get a single string and it's up to the start-up code to parse it into argv[] (assuming you're actually using main() rather than WinMain() or custom start-up code). The rules for escaping quotes and backslashes are a level of bullshit only Microsoft is capable of (and the rules for cmd.exe are far worse).
>>
>>52447517
these things literally cost thousands of dollar stupid shitkid

go on some freelancing website and get some pajeet to do it for you for $10 and see how that goes...
>>
WHO WANTS TO MAKE A GAEM
>>
>>52447618
even if were to take no more than 10 hours then at $100 an hour it's still $1000
>>
File: 1448744645876.jpg (70 KB, 518x376) Image search: [Google]
1448744645876.jpg
70 KB, 518x376
>>52447584
muh nigga
>>
>>52447693
for how much
>>
>>52447693
I can make the logo.
>>
>>52447695
>$100 an hour
>HTML
>>
>>52447655
You do, but compilers are helpful and I'm an idiot.

#include <stdio.h>
#define BUFF_SIZE 1024
int main () {
int i = 1;
char str[BUFF_SIZE];

printf("Enter whatever: ");
fgets(str, BUFF_SIZE, stdin);

printf("\n%s", str);
while (str[i] != '\n') {
printf("%c\n", str[i]);
i++;
}
return 0;
}
>>
>>52447618
10 hours my ass. It will probably take two hours just for you to explain what you need done in enough detail to get them started.

Writing the code probably won't take long, but they'd need to test it and do their research to make sure it works right. And if you want it to be flexible at all, then that's more work right there.

And sure, maybe if everything goes perfectly, it'll only take 10 hours or so, but that's not the point. The point is they can charge that much because you CAN'T do it. Programmers are expensive as fuck, and freelancers even more so because they don't get 401k or benefits like salary programmers.
>>
File: matrixscreensaver2.gif (87 KB, 604x576) Image search: [Google]
matrixscreensaver2.gif
87 KB, 604x576
crypto hash 1/2
def unpack_factors(bits):   
""" Unpack encoded (prime, power) pairs and compose them into an integer.
Each contiguous 1-bit increments the exponent of the current prime.
Each zero advances to the next prime and composes the current prime and
exponent into the output.

For example:

11001101

Is interpreted to mean:

(2 ** 2) * (3 ** 0) * (5 ** 2) * (7 ** 1)

The bits that previously represented the number 205 are composed and
result in the integer 700. """
if '1' not in bits:
return 0
variables = prime_generator()
variable = next(variables)
power = 0
output = 1
last_bit = len(bits) - 1
for bit in bits[:-1]:
if bit == '1':
power += 1
else:
output *= variable ** power
power = 0
variable = next(variables)
if bits[-1] == '1':
power += 1
output *= variable ** power
return output


pic unrelated
>>
>>52447708
however much you think the result of your efforts is worth :^)

>>52447711
just fuck off with that meemee
>>
>>52447695
breh

maybe $50 an hour
>>
>>52447712
have you any idea what web dev salaries are like in first world countries? if it's so easy and takes so little work then just do it yourself
>>
>>52447726
2/3
def hash_function(hash_input, key='', output_size=None, iterations=1):
""" A tunable, variable output length hash function. Security is based on
the hardness of the well known problem of integer factorization. """
input_size = str(len(hash_input))
state = binary_form(hash_input + input_size)
state += binary_form(input_size + str(len(state)))
# print state

for round in range(iterations):
state = binary_form(unpack_factors(state))# + binary_form(str(len(state)))
random_index = pow(17, int(state, 2), len(state))
state = rotate(state[:random_index] + state[random_index+16:],
int(state[random_index:random_index+16], 2))

state_size = (len(state) / 8) - 1
if output_size and state_size < output_size:
return hash_function(state + str(state_size) + hash_input,
output_size=output_size)
else:
return rotate(byte_form(state[:-8])[:output_size], int(state[-8:], 2))
>>
>>52447726
Did you know the matrix characters are reversed japanese characters?
>>
>>52447722
You don't know how to program and yet you have the nerve to lowball freelancers because you have no idea how long it takes to build your shitty web store?

I hope this is a troll.
>>
>>52447726
>implying that isn't just matrix text
>>
>>52447738
>web dev
>programming
first of all, web dev is not programming
>>
>>52447746
3/3
import itertools   

def rotate(input_string, amount):
if not amount or not input_string:
return input_string
else:
amount = amount % len(input_string)
return input_string[-amount:] + input_string[:-amount]

def binary_form(_string):
try:
return ''.join(format(ord(character), 'b').zfill(8) for character in _string)
except TypeError:
return format(_string, 'b')

def byte_form(bitstring):
slice_count, remainder = divmod(len(bitstring), 8)
output = ''
for position in range((slice_count + 1 if remainder else slice_count)):
_position = position * 8
output += chr(int(bitstring[_position:_position + 8], 2))
return output

def prime_generator():
primes = [2]
yield 2
for test_number in itertools.count(3, 2):
for prime in primes:
if not test_number % prime:
break
else:
yield test_number
primes.append(test_number)


and the helper functions. It's just a toy, nobody uses my code.
>>
>>52447737
$50 hours x 40 hours a month x 12 months = $24k

web devs make $50-100k in the us

and freelancing costs more per hour
>>
>>52447754
meant for >>52447618
>>
>>52447722
>2 hours

if you were my boss I'd kill myself
>>
>>52447748
I did not. The screensaver thing I did in about 10 minutes because someone mentioned it'd be cool to see. I don't claim it accurately reflects the symbols from the matrix, it's just a bunch of random crap.
>>
>>52447760
HTML isn't programming either
>>
>>52447769
that should be 40 hours a week but whatev you know what i mean
>>
>>52447769
40 hours a month

huh
>>
>>52447781
that's what i said
>>
>>52447760
>I don't know what I'm talking about the post
>>
>>52447792
that would make it $104,000 then...
>>
>>52447805
you are not making your point very clear. look back through the conversation and see where it went wrong
>>
File: ss+(2016-01-15+at+11.41.04).png (19 KB, 594x328) Image search: [Google]
ss+(2016-01-15+at+11.41.04).png
19 KB, 594x328
>>52447715
i had to add fflush(stdout); before fgets because using msys
>>
>>52447812
which is a normal web dev SALARY. FREELANCING/CONSULTING/CONTRACTING is more expensive per hour because it's not a steady stream of income and you don't get the same benefits as with an employment.
>>
>>52447809
>>52447814
retarded retards are not allowed to post on 4chan. leave
>>
>>52447815
That's probably the safer thing to do.
>>
>>52447840
you're the retard in this case
>>
>>52447829
m8. Average is $59
>>
>>52447840
>projecting this hard
>>
and you wonder why dpts get deleted.
please read the replies to this thread
>>
>>52447842
>>52447849
>thinks web dev is programming
>claims web dev is programming
>in /dpt/
how new are you?
>>
>>52447778

I've got a job implement a password policy on a website for a Government agency. The project tracker is at 41 hours and counting and all we've done is meet people let them bikeshed about their feelings on passwords.
>>
>>52447847
sweet jesus

how do I get into web dev?
>>
>>52447847
>although I know freelance web designers that charge $100 an hour
also that pic talks about DESIGN not making a shopping cart. those designers can't even make such a thing
>>
>>52447856
>am I fitting in yet mom?
>>
>>52447842
retards are allowed on 4chan, they just won't last long
>>
>>52447870
Butthurt pajeet detected. Watch out, he'll DEDICATE this thread!
>>
>>52447856
i replied to >>52447712 which clearly talked about HTML, not programming.
>>
>>52447868
so easy it hurts
>>
>>52447876
>didn't use to
FTFY
>>
>>52447870
hahahaha you actually think web dev is programming. haha you should kill yourself hahahahaha
>>
File: ab.png (8 KB, 547x157) Image search: [Google]
ab.png
8 KB, 547x157
Why is my actionBar white? It's supposed to be the color of the blue square on the left.
>>
>>52447815
Why are you using set relativenumber and set number? If you want to see the line number you're currently on, take set number out of your vimrc and use set ruler.
>>
File: 3mLydMU.png (70 KB, 243x200) Image search: [Google]
3mLydMU.png
70 KB, 243x200
>>52447893
NO ONE ITT SAID WEB DEV IS PROGRAMMING YOU FUCKING RETARD

JUST ADMIT YOU WERE WRONG OR SHUT THE FUCK UP IDIOT
>>
>>52447905
woah lad cool those jets m8
>>
>>52447881
web dev includes html, tardfriend
>>
>>52447914
HOW DO YOU MAKE THE LOGICAL JUMP FROM
>WEB DEV ISN'T PROGRAMMING
>HTML ISN'T PROGRAMMING
>WEB DEV INCLUDES HTML
TO
>WEB DEV IS PROGRAMMING

FUCKKKKKKKKKKKKKKKK
>>
>>52447073

Yeah, that gets done sometimes. Other times, people just use switch statements and let the compiler optimize them out to jump tables.

https://en.wikipedia.org/wiki/Branch_table#Alternative_implementation_using_addresses

>>52447144

Whichever is used by whatever group you're working with. If you're working on a new project, I personally am of the opinion that Linux Kernel Style or Stroustrup Style (which use the former) is better.
>>
>>52447905
quote the post where i'm "wrong". you can't, faggot
>>
>>52447905
butthurt webdevs are the most hilarious, hahahaha!
>>
>>52447928
>>52447760
>implying anyone was talking about programming
>>
>>52447584
wow thats useful
>>
>>52447922
i really pity you and your low-IQ
>>
>>52447933
epin trole xdd such a great use of your time on earth xdddd
>>
>>52447936
I will literally program anything anyone tells me to.
>>
-- left          -- right
V V
+----------------+----------------+
|i:f: :(:m:y:_:\0|v:a:r: :=:=: :\0|
+--------^-------+----^-----------+
| |
begin end


What would be the correct way to extract a token split between two buffers? It's delimited by the begin and end pointers.
>>
>>52447941
literally retarded

>>52447949
ok?
>>
>>52447900
i tried what you said and it doesn't really work the way i want it to
>>
>>52447951
what are your delimiters?
>>
>>52447584
or you can program in a decently sized window so you don't have to crawl line by line through your code base
>>
>>52447970
or you could use vim
>>
>>52447988
relative code line numbers are the dumbest thing i've seen all day and i've seen some pretty damn dumb things today
>>
>>52447999
trips for hyper-retardation.
>>
>>52447964
Pointers. Begin points to 'm' and end points to 'v'. The \0 at the end of the buffer should not be included in the token.
>>
>>52447999
But if i want to move down to a certain line i can do it with 2 keystrokes since i know how many lines to move down. also checked.
>>
what program brings my dog back to life
>>
>>52447970
>>52447970
>so you don't have to crawl line by line through your code base
That's the idea. When I'm working on a big ass screen, it's nice to be able to say 48j instead of hitting j a bunch of times or moving my hands from the memerow and to my mouse.
>>
>>52448016
just keep track of whether you finished a token (probably a space or something) and continue appending from the next buffer.
>>
>>52447856

I'm not a fan of web development myself, but quite frankly...

Some aspects of web development (server/database code, client Javascript) are programming.

Some aspects of web development (HTML, CSS, anything that templates either of these) are not programming.
>>
>>52447936
the poster that i replied to was indeed implying that web development is programming because this is in fact the daily programming thread where the subject matter should only relate to programming and not web development. even the fact that he presupposes web development as a feat by challenging me to attempt web development leads me to question his intelligence and not even his extremely overly inflated reverence for web development will take away from the fact that web development is for script kiddies
>>
>>52448020
you can move to it with 1 click
>>
>>52448038
>mousefags
>>
>>52448038
but i'd have to move the mouse and stuff :/
>>
>>52448035
FOR FUCK'S SAKE YOU FUCKING SPERGLORD NOT EVERYTHING IN /DPT/ IS ABOUT PROGRAMMING. THE POST IT WAS REPLYING TO: >>52447712
>>$100 an hour
>>HTML

>HTML

LITERALLY RETARDED KILL YOURSELF OR FUCK OFF TO REDDIT SPERG FAG
>>
>>52448035
nice. u win
>>
>>52448035
>even the fact that he presupposes web development as a feat by challenging me to attempt web development
JUST DO IT YOURSELF IF YOU DON'T WANT TO PAY FOR THE WORK SIMPLE AS THAT YOU SMUG ENTITLED MILLENNIAL SHITKID FUCCBOI
>>
>>52448062
wow, he seems upset now after i owned him
>>
>>52448062
NICE SAMEFAG FUCKING IDIOT
>>
>>52448080
i know. what a weirdo
>>
>>52448080
OBVIOUS SAMEFAGGING OR FUNPOSTING
>>
>>52448088
KILL YOURSELF UNDERAGE FAG
>>
Pure, unadulterated autism
>>
>>52448030
My question is how to extract the token, I want to have a string "my_var". Naturally I can't just copy from begin to end because it's split between two buffers.
>>
>>52448088
damn he's still going.>>52448089
huh??
>>
>>52448144
ok kid
>>
this thread is quite DESIGNATED
>>
>>52448089
>>52448099
only autists can get this upset
>>
>>52448254
only underage kids samefag after getting rekt
>>
>>52448266
what's your deal?
>>
>>52448295
what's YOUR deal? a number of people on reddit and on here have already quoted a price in the thousands of dollars. so you're a kid who doesn't have that kind of money to spend on a business application, then maybe you should work on it yourself unless you can settle with hiring some pajeet to do some very low quality work for you for cheaper.
>>
>>52448391
that wasn't me you dickhead
>>
>>52448414
k /care
>>
>>52448424
well reddit'd
>>
can we talk about something interesting again... fucking children

whats the point of function pointers
>>
>>52448531
2 uses I've seen
you can feed a function with a function pointer to another function to mitigate C's lack of dynamic types

you can also put them in structs and pretend that C supports member functions.
You can also put them in a vtable so as not to bloat up your structs with N*4kb of pointers inside of every struct.
>>
>>52448038
> clicking
lel
>>
>>52447999
you haven't looked in a mirror today
>>
>>52447144
former, because in the latter, the loop conditions feel separated from the code block
>>
>>52447584
adding this to my vimrc
>>
>>52447335
just add a newline
>>
>>52448050
you have to move your eyes anyway and with the mouse you don't have to read the line number, you don't even need to show line numbers at all
>>
>>52448622
how?
>>
So dpt, I wanted to learn JAVA since all the upcoming classes will use it for OOP projects except the three or five specializations which demand functional programming ala Haskell.

I have delved into the g wiki for some Java books I can learn from and use as a reference but following problem occurred to me as I looked up customer reviews for the books and I haven't bought and read any yet:

Herbert Schildt's Beginner book on JAVA:
http://www.amazon.com/review/R2EFLHDRLUZ7FC/ref=cm_cr_dp_title?ie=UTF8&ASIN=0071809252&channel=detail-glance&nodeID=283155&store=books

The Headfirst Java has some years under it's belt and is clearly very old for the version of Java I will use.

And then I have Think Java as an option, but it is also not going deep enough for acquiring deeper skills.
Sure it will teach me skills the on gist of programming, but it isn't sporting the functional aspects of java I am also interested
In other words, this book would be good, if it were updated for the current year.

Could someone be so kind and waste some time on my problem?
>>
>>52448663
>not showing line numbers at all
when my compiler gives me an error on line blah blah blah how am I supposed to navigate to that line I might as well be using notepad
>>
>>52448684
http://lmgtfy.com/?q=vim+relative+line+numbers
>>
>>52448860
kek
don't teach them how to code better
the market is saturated enough as it is

> newfags thinking people use terminals to be edgy
>>
>>52448663
>you don't even need to show line numbers at all
>>
>>52447335
get better eyes
>>
>>52447167
gay
>>
>>52448860
>how am I supposed to navigate to that line

http://vim.wikia.com/wiki/Go_to_line
>>
>>52449000
>>>/v/
>>
>>52449007
no u
>>
>>52447335
I literally don't get how this is possible.
>>
>>52449016
>literally
as opposed to figuratively not understanding how this is possible?
wow stop posting any time
>>
Is there another IDE I could use C# in? Using visual studio means I can just play around wih code, I have to actually implement it into controls.

            Console.WriteLine("Enter Dank Meme: ");
string memetext = Console.ReadLine();
for (int i = 1; i <= memetext.Length; i++)
{
Console.WriteLine(memetext[i]);
}


doesn't work because of the way the shit is initialised.
>>
>>52449023
autism
>>
>>52449024
that's not -- you know what nevermind
>>
>>52449016
>>52449023
as much as I hate people that use the word literally that way, he's right
1) it doesn't make it harder to read, you just suck
2) it's wasting a line for nothing
3) ????
4) fuck you
>>
>>52449044
I'm relatively new to programming, all I've been doing so far is working with controls, literally haven't touched the console.
>>
>>52449024
I think there's an open source thing called monodevelop, but if you're writing C# then you should be using visual studio
>>
>>52449059
I'd like a place to write little things that use the console so I can try shit out without having to try and sort out all the controls.
>>
File: no_u.jpg (30 KB, 640x454) Image search: [Google]
no_u.jpg
30 KB, 640x454
>>52449015
>>
>>52447951
>>52448016
>>52448112
Anyone?
>>
>>52449009
clearly you need the exercise.
I suggest tetris or stepmania because they require strenuous eye motion and and quick recognition
>>
>>52449023
>>52449049
Sorry, when you grow up in the south you get used to hearing stupid shit like this and it's hard to unlearn
>>
>>52449070
I donno. I don't windows. Maybe PowerShell? or a different language? Python, Ruby, Something Else?
>>
>>52449124
I specifically want to practice with C#, want to be able to check exactly how different things work so when I implement them into my application I know what it'll do, instead of having to test it inside of a bunch of other code and having no idea what is actually causing the problem.
>>
>>52449123
Don't apologize, it's just autists who can't handle the fact that words can change meaning
>>
>>52449070
File -> New Project -> Console Application

Was that so hard?
>>
>>52446984

One of the few "two hour" projects I am working on. Let me know what you think.

https://play.google.com/store/apps/details?id=com.terminaltwofourty.rmgsoftware
>>
File: taken-aback-gif.gif (577 KB, 320x144) Image search: [Google]
taken-aback-gif.gif
577 KB, 320x144
>>52449123
> my reaction when I was baiting an angry reaction but you apologize instead
the whole thing is pretty subjective. it's a divisive issue that doesn't matter one way or the other. Don't be drawn into either camp, you will be the stronger.

>>52449165
That would make him the autist.
>>
File: 1285244821880.png (99 KB, 247x248) Image search: [Google]
1285244821880.png
99 KB, 247x248
>>52449191
I even looked for it, I spent 10 minutes looking for a console application thing, and I didn't even see it.
>>
>>52449191
>https://play.google.com/store/apps/details?id=com.terminaltwofourty.rmgsoftware
willingly giving up your anonymity, that's bad juju
you're lucky this isn't /b/ or /pol/
>>
>>52449221
I was about to say this isn't that much of a bad thing to do until I looked at the comment section... lol
>>
how the fuck do I play a wav file in SDL without SDL_Mixer? I just want to play a simple wav file
>>
>>52449289
first make sure your working directory is where the wav file is. It wont know where to read it otherwise
>>
>>52449289
i don't know
>>
>>52449289
you don't. if you don't know how to a link a library, then you're still a noob.
>>
>>52449289
first google result, what the fuck are you trying to pull
https://gist.github.com/armornick/3447121
>>
>>52449300
It is. I've successfully loaded it, I just don't know how anything else works. I'm assuming I need to call my audiospec's callback function, but when loading a wav file, it doesn't fill the audiospec's userdata, and I've tried copying the wav buffer to it with no luck
>>
>>52449316
holy shit, thanks anon, I'll try it
>>
>>52447049
>abuse

oop is idiomatic C
>>
Question, how do designers of hash algorithms know two hashes won't ever be the same? Is there a probability or prevention for that sort of thing or is it even needed? Thanks, I'm just interested.
>>
>>52449382
those are called collisions and they're not guaranteed to not happen. handling collisions is up to the person using the hashes.
>>
>>52449403
Ah, cool. I'm going to go research that, thank you.
>>
for (size_t 
i, x, y = x = i = 0;

i < n;

i++,
(y = i / h),
(x = i % h),
std::cout << i << ": " << x << ", " << y << '\n'
);
>>
>>52449211
What version of VS?
>>
>>52448024
that post made me very uncomfortable
>>
>>52448024
rm -rf
>>
>>52449431
2015 Community.

Pretty damn great IDE if you ask me.
>>
>>52449422
>(y = i / h),
>(x = i % h),

It's shit.
>>
>>52449454
I said that jokingly in ##linux one time
mother hen lost their shit so hard
>>
>>52449457
>any microsoft product is remotely good
microshill detected
>>
>>52449457
Thank you Pajeet!
₹2 has been deposited into your Microsoft® Account.
>>
>>52449475

fucking called it
>>52449473
>>
>>52449473
>>52449475
the original question was what version of Visual Studio to use. you're both dicks.
>>
>>52449457
https://youtu.be/8lk6BSsX2g4?t=1m58s
>>
>>52449491
>>52449473

i was being sarcastic
it was satire
>>
>>52449457
I got VS2015 Ultimate for free through my school. That's the only reason why I think it's good. You can do the same shit in any other free IDE really.
>>
>>52449598
I defy you to find a framework better than WPF for creating UI's quickly and easily with databinding.
>>
Can anyone recommend a string building library for C?
>>
>>52449634
The C standard library
>>
>>52449634
what do you mean by string building. If it's what I think it means, <cstring>
>>
>>52449634
string.h
>>
>>52449648
Building strings character-by-character or by concatenation.

I know the standard library has strcat but it's not ideal.
>>
>>52449704
big buffers and strcpy
>>
>>52449721
>big buffers
That's exactly what's not ideal. I could roll my own string pool but I would rather just use a proper library.
>>
>>52449704
if you want a guaranteed way to make perfectly sized strings without allocating big buffers, realloc your string with every new char in your string builder loop.
>>
File: Encryption functioning.png (13 KB, 528x319) Image search: [Google]
Encryption functioning.png
13 KB, 528x319
>Tfw everything works
this is such a fantastic feeling
>>
>>52446984
Is engineering superior to CS?
>>
>>52449887
CS is engineering
>>
>>52449422
>this is what C is supposed to look like
>>
>>52449903
No, computer science is a science, engineering is the application of said science
>>
>>52449922
Software Engineering is required for Computer Science
>>
>>52449903
Nope

> is a science
From what I've heard on /g/ it's more like applied mathematics for computer purposes.
>>
>>52449930
>this is what code monkeys actually believe

>>52449935
>/g/ has taught me all I need to know about cs
>>
>>52449944
>everyone but me is wrong

explain how you do physics without instrumentation
>>
>>52449972
>he thinks I know anything about physics
Nah, I leave that shit to monkeys like yourself
>>
>>52449916
That's C++ though.
>>
File: 1451683583776.gif (2 MB, 400x600) Image search: [Google]
1451683583776.gif
2 MB, 400x600
I did it lads, I finished my CHIP-8 interpreter in C. I'm pretty sure my code is shit, but for a first C project, at least I got it to work now.

Now time to make an assembler
in python
>>
>>52449916
>C
>std::cout <<
>>
>>52447144
I honestly don't give a fuck so long as everyone uses the same style within a code base.
>>
>>52449997
>>52450086

>this is what C is supposed to look like
>>
>>52447144
First is objectively better
>>
>>52450048
I can never get over just how much this woman looks like my cousin, it's insane.
>>
>>52450162
I would take her out even if she was my cousin

tbf I could say that about a lot of my actual cousins though
>>
>>52450165
I feel you, having attractive cousins is the worst
>>
File: 1451683513443.gif (2 MB, 400x225) Image search: [Google]
1451683513443.gif
2 MB, 400x225
>>52450173
>tfw spooning your younger innocent cousin

so yeah virtual machines
>>
>>52447049
I don't think the C standard encourages any particular design pattern.
>>
ITT:
codemonkies
trolls
incest
>>
>>52450205
What's wrong with wincest?
>>
Why isn't my rot function working correctly?
http://pastebin.com/kwsdfQQc


rot[encrypt|5|dicks]
Rot5 Output: inhpn

rot[decrypt|5|inhpn]
Rot5 Output: dscus
>>
>>52450276
Another example, can't quite get my head around why it's happening.

rot [ encrypt | 4 | penis in vagina ]
Rot4 Output: lijmo mj rekmje

rot [ decrypt | 4 | lijmo mj rekmje ]
Rot4 Output: hefis if vagifa
>>
>>52450301
>benis
>>
>>52450301
>n is being encrypted to j
>j is being decrypted to f
start there, and debug it breh
>>
>>52450327
I've been trying, but I just can't seem to work it out, my first instinct wasn't to post here, but I ran out of ideas.
>>
>Working on some shitty database
>Uses seprate databases instead of separate schemas
>Guid primary keys
>Primary key is the clustering key
>Fucking NEWID() clustering everywhere
>No foreign key constraints
>Every column is nullable
>Application runs with sysadmin rights
>Devs log in to production for ad-hoc queries with sysadmin rights

So these faggots are moaning about performance issues, but "I can't change the schema, just do some dba tweaks. And you can't have any downtime/maitenece window longer than 10 seconds"

Please /g/, what's the most painless method of suicide
>>
>>52450327
>>52450301
You are decrypting/encrypting some letters twice nigger.
Holy shit you are retarded
Thread replies: 255
Thread images: 21

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.