[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: 44
File: hime c.png (1 MB, 1280x720) Image search: [Google]
hime c.png
1 MB, 1280x720
old thread: >>53764151

What are you working on, /g/?
>>
reposting

Alright anyone doing deep learning here?
I'm trying to figure out theano and CUDA here and been thinking.
Does anyone develop under W10?
I'm currently on W7 but this conference and the fact that I have a free W10 edu license from my uni makes me wanna jump ship.
what does dpt think?
>>
gotta love the d programming thread
>>
Which is the best 3d game engine that is still maintained with C api?
Currently it seems that irrilich is the only option.
>>
>>53772623
i've done a little bit with deep learning. used theano.

i work as a programmer and use W10, but it wouldn't be my first choice (i like OS X). it doesn't offer any benefits to W7 currently, but this summer they'll be adding bash which will be helpful.
>>
>>53772608
Making a thread before the bump limit, you fucking cuck
>>
I want to learn more about the science and math of CS. Can someone recommend any good papers to read?
>>
>>53772766
CS isn't a science.
it's all math
>>
>>53772629
ye-es? I suppose so. but consider the amount of knowledge I, the end-user, need to have in order to use this- starting with the knowledge that this file exists. admittedly I'm a nincompoop; most users are going to be smarter than me, but I'm probably not more than a standard deviation, standard deviation and a half stupider than the mean. That's still like ~7%, 15% of your users. I understand that this tool exists because the number of formats/subsets of the docs/sources to document is more than they can reasonably have available for download, but again: it is probably trivial to programmatically generate a command that grabs, say, the Racket Guide; from there I could figure out how I want it formatted. As is it is a non-trivial investment of my time to get my preferred format of documentation. This as a prerequisite, corequisite for me learning to use this language. I understand that I'm being incredibly autistic right now, but "there's a utility to produce documentation for arbitrary sources in arbitrary formats" is not the same as "there's readable docs available to the language learner without undue effort".
>>
>>53772802
There's a big philosophical argument here but I put both in because I didn't feel like having one.
>>
>>53772913
there really isn't. the "science" side to computers would be considered physics.
>>
>>53772852
footnote: I Googled <"the racket guide" pdf> and found this link.
>http://mirror.racket-lang.org/docs/6.4/pdf/guide.pdf
(actually, I found
>http://mirror.racket-lang.org/docs/6.0/pdf/guide.pdf
and crossed my fingers that the 6.4 version would also exist at the appropriate URL.)
again: I am a nincompoop, I should've Googled this first. That said: Why was there no FUCKING link on the FUCKING doc page?
>>
>>53772961
Depends on how you define Science. There's a huge branch of philosophy regarding science, and some say the math is a science. Hence, there's a huge philosophical debate behind it
>>
File: 1430885038383.gif (2 MB, 320x240) Image search: [Google]
1430885038383.gif
2 MB, 320x240
>>
>>53772852
In that case, the standard-devied go on https://www.google.ch/search?q=racket+reference+pdf and it works. I can find a link from the Racket website to this tho I admit
>>
>>53773083
can't find
>>
File: good stretching form.jpg (26 KB, 425x282) Image search: [Google]
good stretching form.jpg
26 KB, 425x282
>>53773083
>>53773119
yeah, I'm making a mountain out of a molehill. the information exists, in a variety of formats, and is easy to find. However, it still seems bizarre to me that finding one format doesn't make it easy to find other formats.

image related, me trying to make my bitchass sound reasonable. lmao
>>
>>53773066
Well that's his interpretation. Academics by no means all believe the same thing
>>
>>53773176
>image related, me trying to make my bitchass sound reasonable. lmao
At least you're self-aware.
>>
File: dpt.png (1 MB, 940x822) Image search: [Google]
dpt.png
1 MB, 940x822
>>53772608
Fucking why does this not work?
Project euler 1.

#include <stdio.h>
#include <inttypes.h>

int main()
{
uint16_t result = 0;

for (uint16_t i = 3; i < 1000; ++i)
if (i % 5 == 0 || i % 3 == 0)
result += i;

printf("%" PRIu16 "\n", result);
}
>>
>>53773496
You are a total idiot.
PE #1 can be solved on paper in 5 minutes. If you can't do that, you should quit programming and do something not requiring math skills and logical thinking.
>>
>>53772608
kill yourself, sick FAG
>>
I'm new to c++. I have a function which has a vector as a return value, so I do this aVectorOfSomething = foo(...). Should I re-factor the function so that it now has a void return value, but accept a reference to the vector it's supposed to fill up? Which of these two approaches is generally preferable?
>>
https://www.reddit.com/r/ProgrammerHumor/comments/4clfzn/deconstructing_the_malicious_autistic_lies_of/

>>53769013
>>
>>53773616
holy shit that fucking guy
>oxford
not surprised
>>
>>53773526
It turns out the sum is too big for uint16.
I've solved this many times in the past btw, no need to get butthurt you big fat faggot fuck.
>>
>>53773616

Holy shit.
>>
>>53773496
The answer doesn't fit in 16 bits and overflows, friend
>>
>>53773616
>robust, high quality, reliable
>detect certain classes of bugs
>perform optimizations
>modularity and composability
it's fucking nothing in practice
>>
>>53773602
Both are Okay. I guess the way you did is better for most people. It's nice, because you can chain like so:
auto size = foo().size();

Theoretically this way has a problem that you have to construct the vector and then copy-construct, but in practice modern compilers optimize out the copy.

Just remember not to return a reference to this vector if it's a function-local variable.
>>
File: haskelel.jpg (99 KB, 529x598) Image search: [Google]
haskelel.jpg
99 KB, 529x598
>>
I'm reading this "A Pamphlet against R," and one of the things Godek mentions in passing is that even things which have no logical order must, in programming and much of the time in human language, be articulated in some order.

being the person that I am, my train of thought immediately jumped tracks: What if signed language was the primary mode of communication when we were inventing programming languages?
Signed languages also impose order on their utterances, but the balance of sequence vs. simultaneity is strongly slanted towards simultaneity as compared spoken languages. For instance, the signed syllable doesn't order its sub-units- they occur simultaneously. And to a much greater degree than in spoken languages, lexical/morphological units can be both analysable- that is, clearly understood as separate units, rather than being one fusional unit with multiple independent functions- and simulatneous. In ASL, the precise quality of movement one makes with the sign "SICK" may be modulated in myriad ways to indicate the output signed word's "aspect," or time-relational quality; this is simultaneous to the part of the sign that represents the root "SICK". At the same time, the quality of movement may be recognized as an independent unit from the "SICK" component; you can apply that quality of movement, in accordance with the grammar, to other such predicates in a predictable way. It's not like Latin, where declension expresses gender and case and number all with the same ending, but the endings themselves are not in a simple way composed of individual units for gender, case, and number.

How would a signing inventor of programming make a different programming language? Would it have units that, under our model, are sequentially ordered instead composed into a single time-unit by, e.g., bitwise operations? Makes You Think
>>
>>53773732
>Data.Vector.Storable.Mutable
>>
enum color
{
RED,
BLUE,
GREEN
};

switch (paint) {
case RED:
// do something with red
break;
case BLUE:
// do something with blue
break;
case GREEN:
// do something with green
break;
default:
// now what?
}

What's the normal flow for the default case in a switch statement on an enum?
>>
File: normals.gif (265 KB, 628x426) Image search: [Google]
normals.gif
265 KB, 628x426
Triangle with its normals visualized. I'm using this to better understand shader lighting techniques.
>>
>>53773823
thanks for sharing

>>53773813
you've covered the domain
what language & what are you doing
>>
>>53773813
throw an exception, silently fail and do nothing, or bundle it with another case
>>
>>53773813
Just break.
You dont want it to do something unintended.
>>
>>53773813
Your logic is that paint is an enum, so it can't be anything else.

Except paint isn't an enum, it's an int, so it can be any int value.
You do whatever you would do if paint was not initialised properly.
If you really don't care because it should never happen, just break.
>>
>>53773895
It depends on the language and implementation
>>
>>53773066
Based Abe
>>
>>53772669
C++ can be C, so your question is flawed.
>>
>>53773858
That's not me, I'm the guy making a game in webgl.
>>
File: vulkan_lava.jpg (88 KB, 800x500) Image search: [Google]
vulkan_lava.jpg
88 KB, 800x500
So did any of you fuckers mad anything with Vulkan since its release?
>>
>>53773966
are you high or do you not understand replying to more than one person
>>
>>53773915
Switch works with ints, nothing else.
If paint is truly an enum then the syntax is invalid, you need to establish the enum int value for thw switch to work with.
>>
>>53773968
no it's a meme, and it was always a emme it's useless for most people, top kek at fags who didn't learn opengl years ago because they were saving themselves for vulkan lmfao
>>
File: file.png (381 KB, 800x533) Image search: [Google]
file.png
381 KB, 800x533
http://www.theverge.com/2016/3/30/11331014/microsoft-windows-linux-ubuntu-bash
>>
File: 1384925625801.jpg (48 KB, 469x463) Image search: [Google]
1384925625801.jpg
48 KB, 469x463
>>53773968
>Cuckan
>>
Virus makers are getting lazy. Trying to get me to run a court_document.js inside a .zip. Whatever happened to good old .exe files? Are they unwilling to learn C?
>>
>>53772669
what features do you need to get out of it? if you want to go the engine route, you should probably go full enginebabby with a proper drag and drop engine like UE4, cryengine or jewnity, otherwise you could probably just make it from scratch, maybe with a physics engine like bullet, going the middle route with a half-assed amateur neckbeard "engine" seems dumb as fuck
>>
>>53773984
Depends on the language, and in C++ underlying type if not explicitly specified depends on the implementation
C++ switch works with any integral constant / something that can be cast to an integral constant
>>
>>53773823
What type of light is being applied to the scene to light the normals, or are you just making them red?
>>
>>53773983
both?
>>
>>53772608
What's wrong with casting malloc?
>>
>>53772608
>What are you working on, /g/?
https://github.com/enfiskutensykkel/multi-gpu-bwtest
>>
File: 1439232096638.jpg (261 KB, 858x480) Image search: [Google]
1439232096638.jpg
261 KB, 858x480
>Not compiling code with your own body
>>
>>53773026
>Depends on how you define Science.
There's no definition that includes CS. Science, in the broadest definition you can make, studies things to understand how they work. We invented computers, there's no model to be made because the implementation of a Turing machine already exists. It's not a field of study.
>>
>>53773700
>Just remember not to return a reference to this vector if it's a function-local variable.

You mean not to return a reference to the vector created inside foo? Gotcha.
>>
Alright I'm trying to learn Java here.

I'm using scanner for user input, is there a better (I mean a more elegant way) to ask for input on say 3 variables, a b and c instead of writing it like this:
Scanner input = new Scanner(System.in);

int a = input.nextInt();
int b = input.nextInt();
int c = input.nextInt();
>>
>>53774069
kill yourself
>>
>>53774038
I'm just using a uniform to color them while working on the actual lighting code.
>>
foreach (Foo bar in Man) {
if (bar != null)
Chu.Add(bar);
}

Chu.AddRange(Man.Where(bar => bar != null));


Other then brevity, are there any reasons to use one over the other?
>>
>>53774048
void* is implicitly cast in C

If it's not implicitly cast, you're either writing C++ (in which case you should use new instead) or you're doing something wrong which the compiler _should_ complain about.
>>
>>53774087
an array and a for loop
>>
>>53774078
CS is a formal science, like mathematics.
>>
>>53774094
That's what I thought based on your OP, it looked like no lighting was going on.
>>
>>53774107
there's nothing wrong with using malloc in C++ code

>>53774098
bottom is clearer
can you create a templated, inlined function that literally returns "x != null"?
if so
Chu.AddRange(Man.Where(IsNotNull)) would be better
>>
>>53774078
fucking retard

it's a field that you can study, there are objective universal truths that you can discover, just that it's not something you can touch

https://en.wikipedia.org/wiki/Mathematical_sciences
>>
>>53774078
you can't rules-lawyer natural language friend. definitions are not Platonic ideals, they're squishy abstractions in human brains that happen to be similar enough among a well-chosen population that information transfer is possible. a sufficiently tightly chosen population may establish external norms that they can attempt to follow in order to allow more faithful information transfer. however, this only works if all the members of this population consent to the external norm. if this dude's squishy abstraction allows science to mean something yours doesn't, and they don't feel like conforming to your squishy abstraction, you'll either have to deal with that subjectivity or impose communicative and social penalties on yourself
>>
File: 1433226104022.gif (510 KB, 700x827) Image search: [Google]
1433226104022.gif
510 KB, 700x827
>>53773928
>That feel when Harold "Weird Hal" "Hal" Abelson will die in your lifetime
>>
>>53774148
>there's nothing wrong with using malloc in C++ code
There is, unless you're writing non-idiomatic C++.
>>
>>53774083
Just return the vector by value, move semantics will kick in.
>>
>>53774194
Not if you kill yourself first
>>
>>53774197
>>>>"idiomatic C++"
>>
>>53773616

https://www.reddit.com/r/ProgrammerHumor/comments/4clfzn/deconstructing_the_malicious_autistic_lies_of/
>>
>>53774208
Only if he has written a proper move constructor and move assignment operator overload for his class.
>>
>>53773996
very low quality post, friend
>>
File: the pain.jpg (484 KB, 1280x4320) Image search: [Google]
the pain.jpg
484 KB, 1280x4320
>>53774194
is your pic unrelated giorgioing?
>>
>>53774229
Come back when you've read Efficient C++, More Efficient C++ and Efficient Modern C++.
>>
Okay so this is euler #2
How can I make it shorter?

#include <stdio.h>
#include <inttypes.h>

int main()
{
uint64_t second = 0, next, result = 0;

for (uint64_t first = 1; first < 4000000; first = next)
{
next = first + second;
next % 2 == 0 ? result += next : 0;
second = first;
}

printf("%" PRIu64 "\n", result);
}
>>
>>53774254
What about Professional C++ :^)
>>
>>53774254
>muh C++ celebrities
>>
>>53774254
don't tell me these autistic book titles are real
>>
>>53774264
why would you want or need to make it shorter if it works
>>
>>53774114
for(int i=0;i==3;i++){
int[] sides = new int[3];
sides[i] = input.nextInt();
System.out.println(sides[i]);
}


Why doesn't this work?
>>
>>53774292
autism
>>
File: mfw-dog.jpg (34 KB, 575x465) Image search: [Google]
mfw-dog.jpg
34 KB, 575x465
>>53774264
Are you legitimately retarded?

>>53774278
>>53774277
>mfw neo-/g/
>>
>>53774292
>they don't optimize all of their code for illegibility
plebe
>>
>>53774299
never fucking mind i just noticed the ==
disregard this
>>
File: 1459369701973.png (14 KB, 792x395) Image search: [Google]
1459369701973.png
14 KB, 792x395
void draw () {
background (0);
loop();
textFont (f);
fill (255);
l0 = "F";
l1 = "E";
l2 = "A";
l3 = "R";
String[] l={l0, l1, l2, l3};
int i1 = int(random(l.length));
int i2 = int(random(l.length));
int i3 = int(random(l.length));
int i4 = int(random(l.length));
text (l[i1], 200, 250);
text (l[i2], 300, 250);
text (l[i3], 400, 250);
text (l[i4], 500, 250);
}


I'm working on this sketch that randomized letters in a word. The final goal is to have it move onto the next word once the randomized letters find a keyword. Right now I'm wondering how would I go about making sure there are no repeated letters?

I'm using Processing for this.
>>
>>53774264
uint64_t first, second, next, result = second = 0;
for (first = 1, first < 4000000; second = first = next)
((next += second); // first = next
% 2) ? (result += next) : 0;


not 100% sure on this
>>
>>53774299
i is 0 at beginning, so the loop never starts
>>
>>53773968
My hardware is too old.
I'm GL 4.5 conformant though.
>>
>>53774313
>_/more/modern efficient C++
>not neo-/g/
>>
>>53774314
>putting in extra effort to make your code less readable

sounds legit
>>
>>53773616
sockpuppet
>>
>>53774326
remove the ; after second)

>>53774323
you've already repeated so much
what lang?
>>
>>53774350
I was using a rhetorical technique called "sarcasm" to extend, rather than contradict, your point
>>
>>53774313
What makes you think I'm retarded?
Please know that if you do not answer I will have to assume you're a stupid faggot.
>>
>>53774350
more code = slower compilation
>>
>>53774364
its a simplified java for artists and designers through a software called Processing. the idea right now is to not have for example "E" three times.

Each letter needs to be ruled out once its used.
>>
>>53774379
no, LoC is irrelevant, efficiency of algorithms is more important, delete yourself.
>>
>>53774350
They can't fire me if I'm the only one who can maintain my code
>>
>>53774254
what about Most Efficient C++, is it any good
>>
>>53774407
if you can't read my post then you can't read any code, let alone high compiler performance code
>>
>>53774400
have a set
add characters to the set
when someone uses a character check it isnt in the set

if it's just characters then you can probably just use a bitset
>>
>>53774264
>>53774379
kill yourself
>>
>>53774372
>What makes you think I'm retarded?
Your WTF solution, it's pretty obvious you don't know basic properties of the fibonacci numbers if you have to do each iteration and check for parity rather than just summing up the even fibonacci numbers.
>>
>>53773496
That's the most unnecessary use of int types I think I've ever seen
>>
>>53774492
it's true faggot

should i kill the other person you replied to as well
>>
File: 1459016299676.jpg (208 KB, 1032x774) Image search: [Google]
1459016299676.jpg
208 KB, 1032x774
>my code must be as efficient as possible
>literally speedrunning the code
>>
>>53774530
fucking idiot, denser code of the same complexity will take the more or less the same amount of time to compile
>>
>>53774556
it will take less time to compile you retard
>>
consider: if you're not shaving off compile time on the scale of nanoseconds at the expense of readability and maintenance time on the scale of hours, days, or weeks, are you even really a programmer?
>>
>>53774539
maybe speed doesn't matter for your enterprise java apps, but some people really need efficiency
>>
>>53774580
no it won't, and especially if you shit up the code to "codegolf" it it can take longer to compile

go on, enlighten us how you could get >>53774264 to reliably compile faster

>>53774598
epic trole fag now fuck off back to /b/
>>
>>53774512
How am I supposed to sum the even fibs if I don't compute them first?
>>
>>53774598
did you really have to spell it out for him though? you just shattered his ego and maybe even cured him of his autism, he may just go rage quit and do Java now instead. A True Pajeet, where he really belongs.
>>
>>53774598
>nanoseconds

have fun working on massive C++ projects where everything is called

main_thing::some_other_thing::this_thing_that_things_things::ThisIsAStaticBoolArray___array
>>
>>53774610
fuck off newfag

optimizing for code length is not how you optimize for performance, and even if it were, it would not be an acceptable solution for real programmers
>>
>>53774610
Java is pretty fast nowadays.
>>
>>53774598
Using pre-compiled headers to shave of compile time is sane.

Writing garbled spaghetti code because you think less characters = faster compile time then you're insane.
>>
>>53774616
give all the variables 1 letter names, remove all redundant whitespace
>>
>>53774628
nice samefag butthurt idiot

>>53774658
won't make it any faster to compile
>>
>>53774469
sorry, but is a set an array where the code would retrive one number without putting it back for the next randomization?
>>
>>53774625
Protip: You don't have to compute EVERY FUCKING fib in order to compute the even fibs

Come back when you've finished high school, kid.
>>
>>53774652
>because you think
because you CORRECTLY think

not all of us are as slow as you pajeet
>>
>>53774668
a set is like an array but you can't store duplicates

just use an array anyway
>>
>>53774610
and the point here is that "shortening" code is only an efficiency boost if all other factors are held constant

if shortening code impacts any other factor, you have a more complex problem on your hands

for instance, "longer" code, within certain constraints, is often more intelligible (see >>53774633 for an example of code length impacting intelligibility negatively)

lowered intelligibility is an efficiency loss on a MUCH grander scale than shorter code's impact on compile time

>>53774616
I'm. agreeing with you,
>>
>>53774677
LOOK MOM I CAN ANNOY AUTISTIC STRANGERS ON THE INTERNET
>>
>>53774677
Please enlighten me on how including more symbols and more header files, like >>53774264, REDUCES compile time?
>>
>>53774703
it doesn't reduce it, it doesn't increase it, it doesn't make any real difference
>>
>>53774703
i didn't say including more symbols and header files

i said reduce all variable identifiers to single letter names and remove redundant whitespace

will that or will it not consistently improve compilation time, given the rest of the code is left the same
>>
>>53774264
BTFO!
sit down, shitter
>>
>>53774264
>
next % 2 == 0 ? result += next : 0;

simply doing something like this to save a couple of characters is fucking retarded and might actually HURT compile time or the compilation result because it's not as clear as

if(next % 2 == 0) {
result += next;
}
>>
you: how do I shorten this code
us: why do you want that
you: so it will compile faster
us: that is not a reasonable tradeoff for less transparent code, the net efficiency change is negative by a wide margin
you: are you saying it WON'T compile faster???
>>
>>53774784

result += (next % 2 ? 0 : next)
>>
>>53774747
>will that or will it not consistently improve compilation time, given the rest of the code is left the same
It will not, as file seek and skipping whitespace have minuscule overhead.

Writing clean code has a lot higher impact, the more "funky" code-paths the harder it is for the compiler to synthesise it.

If the code is identical in all other aspects except whitespace and variable name length, then maybe you can shave of fractions of a nanosecond.
>>
>>53774788
yes i'm saying it WON'T compile faster, fuck off

easier to parse code will compile faster

shorter code won't
>>
>>53774788
this tbqh senpai
>>
>>53774693
What an oversimplification. I guess it's the easiest way to explain it to a freshman.

>>53774668
https://en.wikipedia.org/wiki/Set_%28mathematics%29
>>
>>53774812
>>53774815

IT WILL BE FASTER, CONSISTENTLY
SAY IT
SAY IT

AHAHAHAHA
>>
>>53774788
>XY problem - the post
>>
>>53774788
*for clarity, this is the plural you, as in "all you bitches saying stupid shit". It's entirely possible that the OP is a hapless bystander

>>53774815
okay, fine, you may move yourself into a third category. Us, You, and Them.
>>
>>53774840
>CONSISTENTLY
See, if it wasn't for this word, I might have agreed with you. But that word implies that just by shortening everything you are able to speed up, which is demonstratively false.
>>
Alright I'm trying to write a program that sums a set S = 1 + 2 + 3 + 4 .... and I keep getting an error.
It's supposed to equal -1/12, why aren't computers up to this task?
>>
File: 18211.png (98 KB, 400x300) Image search: [Google]
18211.png
98 KB, 400x300
>>53774887
>>
Today I learned that the rate at which a file may be copied is unaffected by the size
>>
>>53774856
std::move(idiot); //COMPILE ERROR: No significant memory to move, will not lead to performance optimization, resorting to Copy Constructor.
>>
>>53774907
>Today I learned that the rate at which a file may be copied is unaffected by the size
Depends on the file system and storage technology
>>
>>53774235
All the effort he puts into the bold and italic phrases, but the faggot can't even use "it's" correctly.
Or commas.
>>
>>53774907
>compilation only involves reading a file
retard
>>
>>53774906
Go back to calc II you dumb script kiddo.
>>
Today I learned that code efficiency, like file-copying operations, is negligibly impacted by human factors
>>
>>53774887
>1 + 2 + 3 + 4 + ... + n - 1 + n
>supposed to equal -1/12
uhmm
>>
>>53774943
go back to kidscancode retard
>>
>>53774942
holy shit just say it fucking lol
just say it's faster
>>
>>53774951
https://en.wikipedia.org/wiki/1_%2B_2_%2B_3_%2B_4_%2B_%E2%8B%AF
>>
>>53774968
it's faster

now fuck off back to /b/
>>
I'm going through Harvard's CS50, currently on pset2. I implemented caesar's cipher after some hours of thinking and for some reason, writing my code on paper first, I was amazed at how it compiled and worked at the first try.
Now I have to implement vigenere and I'm not sure where to begin. Anyone could give me a hand?
>>
>>53774951
he's just doing math like a physicist, don't worry about it.
>>
>>53774983
>the methods of zeta function regularization and Ramanujan summation
that's obviously not what you're doing you gargantuan buffoon
>>
>>53774986
Naa, I'm going to stay to teach the little kids that reading a longer string is slower
>>
>>53774986
hahahaha, thats right you little bitch, now suck on my big swollen trap cock and LIKE IT!
>>
File: mfw-retard.jpg (26 KB, 474x474) Image search: [Google]
mfw-retard.jpg
26 KB, 474x474
>>53774983
>>53774887
>infinite series
>set
>>
>>53775032
the series is the sum
the set would be the natural numbers
>>
File: 1458234887733.gif (698 KB, 200x113) Image search: [Google]
1458234887733.gif
698 KB, 200x113
>>53775015
gee, thanks for telling me, i'm going to minify all my source code now, i'm sure the microseconds saved will impact my life profoundly
>>
>>53775059
First it was slower, then it was nanoseconds saved, by the end of the day it'll be hours
>>
>>53775055
>the series is the sum
Well, yeah...
>Ramanujan summation
>>
>>53775083
Yeah. So what's weird about him saying he's trying to sum a set?
>>
File: rees mogg.jpg (20 KB, 460x276) Image search: [Google]
rees mogg.jpg
20 KB, 460x276
>>53775098
Forgot pic related
>>
>>53775078
>/g/ is one person
and it's clearly hyperbole

anyway it literally wouldn't make a tangible difference, it wouldn't be consistent, and you might INCREASE compilation time if your code doesn't have a clear format and you have symbol collisions
>>
>>53774996
This is, Caesar's cipher takes a phrase to cipher and a key, say I wan't to cipher using a 2 key.
Hello world!

would become
Jgnnq Yqtnf!


This is the formula used:
ci = (pi + k) % 26

where
pi = ith char in p (plaintext)
k = key
ci = ith char in c (ciphertext)

I implemented this in a C function as follows:

// Applies cipher formula to upper case chars
char shift_upp (char val, int key)
{
char arr[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char pi = val;
int k = key;

return arr[( (pi - 'A' + k) % 26)];
}

// Applies cipher formula to lower case chars
char shift_low (char val, int key)
{
char arr[26] = "abcdefghijklmnopqrstuvwxyz";
char pi = val;
int k = key;

return arr[( (pi - 'a' + k) % 26)];
}
>>
>>53775138
the amount of extra changes you're adding to try and get out of this is hilarious

it was obviously a fucking joke
i'm not even the guy that wanted shorter code
there are good reasons for wanting short code
>>
>>53775123
Hello /pol/ my old friend.
>>
>>53774916
I'm sorry for implying I disagree with you; you go in the Them category because your argument is not the same as mine.
>the You argument: I should shorten this code because it will reduce compile time.
>the Them (you) argument: No, it won't, and it will also have negative impacts in other ways.
>the Us (me) argument: I literally do not know whether compile time is affected by the length, in characters, of logically identical code. and you know what? I don't care to find out, because the negative impacts of shortening perfectly clear code consume time on a scale so far removed from its impact on compile time that the question is uninteresting.
I'm sure you're correct that compile time can also be negatively impacted by shortening code. I just don't really care because it's a bad goal to have for other reasons that, by the math, are lots more important. I don't begrudge you the academic horse you have in this race, I'm just not interested in the outcome.
>>
>>53774129
Mathematics is not a science. You're not creating any models to describe its behaviour.

>>53774175
>there are objective universal truths that you can discover,
Then it's not a science. By definition, Science does not discover any objective universal truths. I thought it would take longer to contradict you.
>just that it's not something you can touch
I never even said anything about tangibility.
>fucking retard
Calm down, anon.

>>53774178
>something something subjective definitions
Why would I ever care about a definition that's not objective? I can also say I don't agree that black is the absence of color and I decide to call black to what you call blue, doesn't make me any less of an idiot.
>>
>>53775098
>So what's weird about him saying he's trying to sum a set?
He's/you're trying to programatically sum the natural numbers (aka the infinite set of numbers) so that it will result in -1/12....

Do I really have to elaborate this or can you just admit that you're baiting hard?
>>
>>53775197
did you get the pun or not
>>
>>53775142
However, Vigenere's cipher takes a phrase and instead of a key number, uses a keyword, for example:
Meet me at the park at eleven am
using bacon as keyword would output:
Negh zf av huf pcfx bt gzrwep oz


The formula is:
ci = (pi + ki) % 26

For some reason I can't think of how to convert Caesar's to Vigenere's. I'm a little lost here.
>>
>>53775201
>Mathematics is not a science.
It's not a natural science, but it is a formal science.

>You're not creating any models to describe its behaviour.
But I am indeed.
>>
File: 24231.jpg (54 KB, 500x500) Image search: [Google]
24231.jpg
54 KB, 500x500
>>53775214
Really? I seem to remember this post >>53775032
not mentioning anything about -1/2!
>>
>>53775196
>it was obviously a fucking joke
yes epic ruse now kindly fuck off back to /b/
>>
>>53775238
>not mentioning anything about -1/2!
Let me refresh your memory then:

>>53774887
>Alright I'm trying to write a program that sums a set S = 1 + 2 + 3 + 4 .... and I keep getting an error.
>It's supposed to equal -1/12, why aren't computers up to this task?
>>
>>53775201
why would anon care about an equally subjective definition he doesn't agree with? why would anyone care about defining anything? there ARE no objective definitions. further, you are failing to establish successful communication because you are insisting on having your way, like a small child.

one thing you could do is say "when I use the word science, I use it in a way that excludes Computer Science because this" and then stop insisting on your definition, and on contradicting the interlocutor's definition. your opinion is registered, information is communicated.
>>
>>53775201
>my one definition that i made up in my fucktarded sperg head is the objective definition
ok retard
>>
class x:
def __init__(self):
self.x = 'noob'
def describe(self):
print 'i am noob'
def ask(self, other):
print 'is math a science hurr durr'


hurr
>>
File: 1453651138545.jpg (57 KB, 601x577) Image search: [Google]
1453651138545.jpg
57 KB, 601x577
>>53775262
Oh, I remember HIM mentioning -1/2. It's just your reply that was lacking
>>
definitional arguments are fundamentally non-communicative. natural language is a nightmare of name collisions. create a new symbol and define its semantics well. getting pissed that your preferred symbol parses differently in different namespaces is completely useless.
>>
>>53775304
>i was just pretending to be retarded
>>
>>53775331
>>infinite series
>>set

I'm sure you were anon
I'm sure you were
>>
>>53775219
Of course lad. Still waiting for IDS's public beheading though.
>>
>>53775345
Who are you quoting?
>>
>>53775234
I know it gets called that, my whole point is that the idea of a "formal science" is stupid, it contradicts the definition of science.

>>53775265
>there ARE no objective definitions.
That was a remarkably ignorante statement. Yes, there are. The definition of Integer, for example, isn't subjective. You can take an apple and call it an integer, sure, but you're not following.
>further, you are failing to establish successful communication because you are insisting on having your way
No, I'm the one using the actual definition of science, and saying that the concept of a formal science goes against it. It's you who's holding on to a contradictory concept, the idea that a science can come up with universal truths.

>>53775273
It's not MY definition. The guy who invented the scientific method gave the last definition of science, and that goes against the idea of a formal science: science, according to the scientific method, can't uncover universal truths. Gravity isn't a universal truth. No law of physics is a universal truth. Math, for example, can because it relies on axioms. It CANNOT be wrong. 2+2=4 will always be true in math. Thus, CS isn't a science.
>>
>>53775392
kill yourself
>>
>>53775382
n
(You)
o
u
u
>>
>>53775142
how do you syntax highlight stuff here on /g/?

I know about the
 tag, but have no ideia how to set the language
>>
>Computer science is the scientific and practical approach to computation and its applications. It is the systematic study of the feasibility, structure, expression, and mechanization of the methodical procedures (or algorithms) that underlie the acquisition, representation, processing, storage, communication of, and access to information. An alternate, more succinct definition of computer science is the study of automating algorithmic processes that scale. A computer scientist specializes in the theory of computation and the design of computational systems.
>NOT SCIENCE
>>
logical objects have well-defined behavior. linguistic objects do, as well, in a particular linguistic system- e.g., the linguistic system used by a single individual- and not in the way that logical objects do, because their boundaries are always and everywhere fuzzy- that "fuzziness" is constrained (again, within a particular linguistic system), but it is inherent to natural languages.

>>53775392
science's original definition is "a way of knowing," or an epistemological system. math is an epistemological system, ergo, under this (valid, attested, exactly-as-real-as-yours) definition, math is a science. the "actual definition" doesn't exist. the science you describe is one (1) logical object. empirically, it is obvious that it is not the only one to which "science" maps in the wild. logically, it is obvious that science's connection to said logical object is arbitrary.
>>
>>53775392
>I know it gets called that,
Then why the fuck are we having this discussions about semantics? To tickle everyone's autism?

>my whole point is that the idea of a "formal science" is stupid,
I don't care what you think or not, that's just how it is defined.

>it contradicts the definition of science.
*your* definition of science

>It CANNOT be wrong. 2+2=4 will always be true in math. Thus, CS isn't a science.
CS is not purely mathematics either, though. I'm fairly certain I conducted science for my master thesis, for example, by conducting experiments in a test bed based on my hypotheses and then applying statistical analysis of the results in order to understand what the hell was going on and then conclude that my hypotheses were wrong.
>>
>>53775447
i'm dumb and forgot that I wrote the tag lol
>>
>>53775418
>You
?
>>
>>53775225
You can't really "convert Caesar's to Vigenère's", this has little meaning, if any. Caesar's is Vigenère's with a length-one key if you will. You need to replace k in your function with an expression that gets one of the characters of the key string based on the index you are at within the message... Wait, those 2 functions you posted don't encrypt (resp. decrypt) a message, they just encrypt a character. Do you have those functions that work on messages? You're confused because Vigenère's does not make sense on single characters, does that help?
>>
>>53775200
So the original poster with the "how do i make i shorter guise" is gone then. Ok, anon, have a nice day. <3
>>
LOOK MOM I CAN ANNOY AUTISTIC STRANGERS ON THE INTERNET
>>
>What are you working on, /g/?

Added a visualizer for my behavior trees for my loli kidnapping sim, which allowed me to fix a bug in their AI when I tried combining the play-in-park AI (wandering around nearby parks) with their investigate-suspicious-noises AI (distracting them with cans)
>>
>>53774671
lol, is it anything personnell?
>>
File: mfw2.jpg (67 KB, 350x516) Image search: [Google]
mfw2.jpg
67 KB, 350x516
>>53775571
>loli kidnapping sim
>>
>>53775549
I'm using the functions inside a loop that goes through the string of the message.

// Loops through string to cipher
string cipher (string text, int key)
{
for (int i = 0, n = strlen(text); i < n; i++)
{
// If upper case, calls shift_upp
if (isupper (text[i]))
{
text[i] = shift_upp (text[i], key);
}
// If lower case, calls shift_low
else if (islower(text[i]))
{
text[i] = shift_low (text[i], key);
}
}

printf ("%s\n", text);

return text;
}


Also yes, it helps a litte, I'm still confused though.
>>
>>53773616
>>53774235
So obnoxious I find it hard to believe he's not trolling.
>>
>>53775571
I wanna play that
>>
File: s2yHpOe.gif (3 MB, 441x300) Image search: [Google]
s2yHpOe.gif
3 MB, 441x300
>>53775571
Everytime I see this my sides go flying all over the fucking place
>>
>>53775480
AFAIK you can't set the language, and the highlighter doesn't care about it anyway. It just colors some widespread keywords and constructs, and sometimes we notice that it doesn't make sense, specially with languages without a C-like syntax.
>>
>>53775571
Is this developed with SDL?
>>
>>53775659
source is on /agdg/
>>
>>53775531
Who are (You) and what have you done with >>53775032 ?
>>
>>53772623
I'm doing some.
>I'm trying to figure out theano and CUDA here and been thinking.
What have you been thinking? Just follow the tutorials.

Developing under windows is possible, I've done it, but its gets in the way of doing useful work.
>>
>>53775464
>this is the definition
>this somehow contradicts a guy questioning the plausibility of the definition itself
I thought /dpt/ was smart.

>>53775477
>I don't care what you think or not, that's just how it is defined.
But the way it's defined creates a contradiction.
>*your* definition of science
Are you literally retarded? Have you never heard of the scientific method?
https://en.wikipedia.org/wiki/Thomas_Kuhn
>CS is not purely mathematics either, though.
Oh for fuck's sake, you could even add actual science courses to the CS curriculum, the courses actually relating to CS like algorithmia still uncover universal truths and that goes against the definition (which you clearly don't know, so read the link above).
>I'm fairly certain I conducted science for my master thesis
I'm sure you worked hard and found stuff. That has absolutely nothing to do with the idea that a formal science uncovers universal truths and science by definition can't uncover universal truths (I'll keep repeating this until it goes in your thick webdev skull).
For example, you've seen algorithms getting proven to be correct by showing it's impossible they're wrong, right? This is something that does not happen in science according to the scientific method. It's just not contemplated, there's a degree of uncertainty to everything. You and I can be uncertain of the conclusion of something, but if we reach a conclusion using correct proof, the conclusion must be correct as well. This does not happen in Science because the concept of "correct proof" does not exist, everything is within ranges of uncertainty.

I have shit to do and I know you'll reply, so have the last word anon. This was nice.
>>
Should I use C or C++ for a pixel game? I'm opposed to C++ on moral and ethical grounds.
>>
>>53772669
Urho3D and Godot are quite good engines, better than irrlicht/ogre3d. I have used both.
>>
>>53775617
You do understand that key is a string in Vigenère's, and that you must select a character inside it to pass it to siff_up/down? At least that's how I would rewrite it.
>>
>>53775714
C++
>>
>>53775709
Hardware design is science, no?
>>
Is there really no way to get Lua on Windows without compiling it from source? It seems hard to do and I'm quite lazy
>>
File: 1453141328892.jpg (47 KB, 345x383) Image search: [Google]
1453141328892.jpg
47 KB, 345x383
>>53775571
>for my loli kidnapping sim
>>
>>53775714
Sounds like your just running with the wave of /g/, but how big is your pixel game? C++ is prolly the way to go but if you know it isn't going to be major just use C
>>
>>53775709
fuck off and die cancerfag

>This was nice.
yes your sperg bikeshedding of the definition of a word was nice masturbation to your fucked sperg brain
>>
>>53775754
It's probably going to be 640x480.
>>
>>53774018
How does it even run, does it use activeX or COM or something?
>>
File: 1399395243838.jpg (31 KB, 603x585) Image search: [Google]
1399395243838.jpg
31 KB, 603x585
Learning some more Python in order to better develop my isometric-tilemap-turn-based battle engine.

As far as I see it, I have a long way to go from knowing the basics of simple turn-based RPG battle created with object-oriented code to having sprites with four directions, movement, different attacks and defends, items and upgrades, animated attack sequences, elevation on the tilemap, no-go zones, elemental types and terrain types.

So much to work out and this dude with the beard on teamtreehouse is getting to me...
>>
>>53775709

I'm too tired to reply to your autistic rant.

CS is not mathematics alone. CS is a wide field ranging from physics, to applied mathematics, to social sciences.
>>
>>53775714
>le pixel game meme
fag
>>
>>53775774
drink bleach faggot
>>
>>53775676
You say that, although it is not
>>
>>53775774
kill yourself and fuck off to agdg fag
>>
I know I'm going to hell because I can't stop tweaking people who don't understand where language comes from

>>53775774
oh dude, you're making an isometric tilemap turn based tactical RPG? nice, me too. what's your model for levels- are bridges and caves possible?
>>
>>53775763
I meant as in memory
>>
>>53775778
Curious. How do social sciences feature in CS? Is it in HCI stuff?
>>
File: sup g.gif (3 MB, 509x379) Image search: [Google]
sup g.gif
3 MB, 509x379
>>53775583
>>53775748

See .gif. I just recorded it.

>>53775659

SFML

>>53775676

The /agdg/ thread finally 404'd like 2 days ago, after being up since 2014 and being past the bump limit since September 2015.

>>53775763

What the hell does that matter? That's an awful metric for how big something is. He probably meant in terms of the amount of code/logic going on, or the size of your world/number of entities (ie how much processing is going to have to be done).
>>
>>53775742

http://lua-users.org/wiki/LuaBinaries

>>53775714

>Moral and ethical grounds
Name them.
>>
>>53775809
Oh damn, well since it's not up there anymore, do you wanna post the source on a github or something?
>>
File: celegansgmap.gif (22 KB, 669x597) Image search: [Google]
celegansgmap.gif
22 KB, 669x597
>>53774069
I'd like to, anon, but I don't have the hardware for this, software for genetic engineering is still in its infancy as well..

I can download the human genome via torrents (link: https://kuiken.co/torrent/7064696/The_Human_Genome_Project ) but what cool thing would I even do with it?
>>
>>53775809
>SFML
[loli throwing up.png]
>>
>>53775802
Oh. Prolly not much. Maybe 32mb?
>>
Im trying to use python to do reverse image search, then get what's on the page to know what the image is.
Problem is I don't really know how to do the last part. I can get an URL to the result page, and in the search box, there's words that I would like to get, how would I do that ?
Pic related, i'd like to find a way to grab that
>>
>>53775805
HCI is the old schooler, there's also certain aspects of AI, everything related to social media and studies surrounding these (borders into non-CS territory), augmented reality / VR / third life stuff, etc.
>>
>>53775778
>CS is a wide field ranging from physics
lol
>to social sciences.
webdev confirmed
>>
>>53775142
By the way you underestimate casts in C:
(val - 'A' + key) % 26 + 'A'
and basta!
>>
File: 1443317393088.jpg (601 KB, 2048x1363) Image search: [Google]
1443317393088.jpg
601 KB, 2048x1363
>>53775805
>>
>>53775839
>torrenting the human genome
pretty cool in itself fampaiitachi
>>
>>53775841

What's wrong with SFML?
>>
>>53775843
Ehh, its small but C++ still might be better, the memory management will help alot
>>
>>53775778
CS is physics and social sciences? Citation Please!
>>
>>53775854
Autist confirmed

Also, not a web dev. The very reason I mentioned physics is because of DSP, analog- mixed circuitry, etc.
>>
>>53775714
Why bother with C/C++ when you can scrap a prototype in python/pygame or lua/love2d in 0.2x time. If you really need it you will always be able to rewrite hot parts in C.
Thread replies: 255
Thread images: 44

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.