[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]

Post more of these

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: 109
Thread images: 32

File: csgrad_delete_usr.png (82KB, 461x660px) Image search: [Google]
csgrad_delete_usr.png
82KB, 461x660px
Post more of these
>>
File: girls who code.png (311KB, 652x669px) Image search: [Google]
girls who code.png
311KB, 652x669px
bump
>>
File: 67179643.jpg (74KB, 400x400px) Image search: [Google]
67179643.jpg
74KB, 400x400px
>>57321285
>>
>>57321285

whats wrong with this code?
>>
>>57321552
Too edgy for /g/.
>>
>>57321552
Could easily use a loop, and reduce the code by 90%. Also allows multiplication by a factor larger than 10.
>>
File: q2sQfR4.gif (486KB, 311x262px) Image search: [Google]
q2sQfR4.gif
486KB, 311x262px
>>57321552
>>
>>57321552

tits or gtfo
>>
File: youcantbeserious.png (490KB, 449x401px) Image search: [Google]
youcantbeserious.png
490KB, 449x401px
>>57321552
>>57321556
>>
>>57320538
Are they even around somewhere else in the web or are those a /g/ special?
>>
File: makes_you_tink.png (218KB, 1152x648px) Image search: [Google]
makes_you_tink.png
218KB, 1152x648px
>>
File: oddoreven.png (88KB, 890x670px) Image search: [Google]
oddoreven.png
88KB, 890x670px
>>
File: 1374796030634[1].png (117KB, 444x440px) Image search: [Google]
1374796030634[1].png
117KB, 444x440px
>>57321850
>tfw never did any stupid shit like this because it was the lazier option to just learn this shit.
>>
>>57321552
:^)
>>
>>57321839
How can anyone teaching be this much of a shitter.
>>
>>57321905
>Using the smiley face with the carat nose
>>
>>57321552
Nothing, /g/ just hates women >.<
>>
I've always found deeply embedded software architecture design flaws more amusing than these extremely simple "beginner mistakes".

Bad comp sci graduates are more likely to do the former than the latter, but we never get those examples in this thread, probably because /g/ doesn't understand what real anti-patterns look like.
>>
File: Tomorrowdate.jpg (41KB, 506x584px) Image search: [Google]
Tomorrowdate.jpg
41KB, 506x584px
>>
>>57321934
This is my favourite
>>
>>57321552
for b-- > 0
a =+ a
return a
>>
>>57321934
heh, this is actually pretty good
>>
>>57321934
That's brilliant kek
>>
>>57321981
>>57321975
>>57321939
It's the only one I ever saved because it's so creative
>>
File: 1406342141339.png (118KB, 694x732px) Image search: [Google]
1406342141339.png
118KB, 694x732px
>>
File: 1406342198440 - Copy.png (101KB, 694x670px) Image search: [Google]
1406342198440 - Copy.png
101KB, 694x670px
>>
File: 1406342198441.png (72KB, 694x670px) Image search: [Google]
1406342198441.png
72KB, 694x670px
>>
File: XFsLz5F.png (150KB, 1271x851px) Image search: [Google]
XFsLz5F.png
150KB, 1271x851px
>>
File: 1406342198442.png (83KB, 694x670px) Image search: [Google]
1406342198442.png
83KB, 694x670px
>>
>>57321995
>not using a loop to build a string which you then feed into eval()
What a newbie
>>
File: 1406342198443.png (71KB, 694x670px) Image search: [Google]
1406342198443.png
71KB, 694x670px
>>
File: 1413003240977.png (116KB, 1515x663px) Image search: [Google]
1413003240977.png
116KB, 1515x663px
>>
File: 1414554478954.png (73KB, 1092x426px) Image search: [Google]
1414554478954.png
73KB, 1092x426px
>>
>>57322012
What's the problem here?
>>
>>57322040
Returning a pointer to an char array that goes out of scope when the function returns.
>>
File: 1414554539138.png (68KB, 675x426px) Image search: [Google]
1414554539138.png
68KB, 675x426px
>>
File: 1415091883625.png (151KB, 766x664px) Image search: [Google]
1415091883625.png
151KB, 766x664px
>>
>>57322047
Ah right.
>>
>>57322047
data could be a global variable though :^)
>>
>>57322090
data could be, but that's not what the returned pointer returns to. It returns to an anonymous array declared in the return statement.
>>
File: 1463163008848.png (638KB, 4760x4986px) Image search: [Google]
1463163008848.png
638KB, 4760x4986px
I hope you are ready for this one.
>>
>>57322109
Please tell me this is a real thing
>>
>>57321839
can someone explain this to me
>>
>>57322119
That would be a lot of effort just for a joke.
>>
This is from a syntax highlighter of mine, think it qualifies?
>>
>>57322135
Base64 is a hash function, not an encryption function. Encryption can't be reversed like hashes can.
>>
>>57322135
Base 64 is an encoding function, not an encryption function (which should be evident since the guy doesn't even talk about keys)
>>
>>57322135
The joke is PHP.
>>
>>57322151
You're retarded, hashes can't by design just be reversed.
>>
>>57322145
It just looks like any good old regular expression. I've seen worse: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
>>
>>57322151
Base64 is an encoding. You can easily decode a Base64 string. Hashes are one way, you can't construct the data from only the hash string.
>>
>>57321760
imgur.com/a/lGOvs
found an imgur album
>>
>>57322177
>That link
Geez
>>
so using that function means if one card gets comromised all of them do

isnt this basically same with encrypting a a file filled with card numbers?
>>
>>57322184
>>57322176
My bad niggers, didn't have my coffee yet. I did mean encoding.
>>
>>57322119
It's faster using hardcoded values, that's why someone did that, I think
>>
>>57322151
Base64 is not a hash function. Base64 converts data to a base64 standard and is fully reversable. It is commonly used when you need to exchange binary data but the transfer method can only deal with text strings (and restricts those text strings to printable characters only)
>>
>>57322210
No, it means they could just run base64_decode on the "encrypted" card info if the DB ever got leaked whereas with a real hash they would need to bruteforce it (good luck with that).
>>
>>57322221
ah so it literally just converts a number to base 64
okay i get it now
>>
>>57322210
It means the shit is not encrypted at all, anyone who sees it either at target or in transit now has your credit card number.
>>
>>57322218
This actually true.

The algorithm is called "down algorithm" and it's actually pretty fast.

Here is a paper about it:
http://www.ams.org/journals/mcom/1983-40-162/S0025-5718-1983-0689483-8/S0025-5718-1983-0689483-8.pdf
>>
>>57322151
>Base64 is a hash function
Nope
>>
File: 1406354735971.png (334KB, 1881x915px) Image search: [Google]
1406354735971.png
334KB, 1881x915px
>>
>>57322443
>>57322221
see >>57322215
>>
>>57321964

You are like a little baby. Watch this:

    int a, b, c;

printf("Enter two numbers: \n");
scanf("%d\n%d", &a, &b);

c = a;
while (b > 1) {
a += a;
b /= 2;
}
if (b == 1)
a += c;

printf("Their product is: %d\n", a);
>>
>>57321934
Buggy code, doesn't account for DST, depending on the situation, you could get today, tomorrow, or the day after tomorrow.
>>
>>57321964
No.
>>
>>57322135
It's like converting your card number to hexadecimal and thinking that makes it secret.
>>
File: 1477384843487.png (133KB, 672x758px) Image search: [Google]
1477384843487.png
133KB, 672x758px
>>
>>57323119
How would one accomplish this? I assume reading the source file and printing it out wouldn't work.
>>
>>57323203
>>57323119

This is interesting.
What if it's compiled? How would one do this without code duplication?
>>
File: 1437885713589.png (135KB, 279x407px) Image search: [Google]
1437885713589.png
135KB, 279x407px
>>57322109
N-nani?!
>>
>>57323203
It's called a quine.

Python example:
l='l=%s;print l%%`l`';print l%`l`
>>
>>57321914
Male dominated field.

That's what happens when there's no competition.

That's why we need more women in tech.
>>
File: 1477671690149.png (73KB, 1333x600px) Image search: [Google]
1477671690149.png
73KB, 1333x600px
>>57323281
>>
File: 1384448248026.png (133KB, 622x626px) Image search: [Google]
1384448248026.png
133KB, 622x626px
>>57323281
>>
File: 1462465038034.jpg (28KB, 600x343px) Image search: [Google]
1462465038034.jpg
28KB, 600x343px
>>57320538
>>
>>57323370
>latter
>less readable
>less efficient
When will the functional meme finally die??
>>
>>57323370
Actual two types of programmers:
for(int i = 0;;++i)


for(int i = 0;;i++)
>>
>>57323370

normie fa/g/ here, which one is better and why?
>>
File: 12d.jpg (57KB, 567x561px) Image search: [Google]
12d.jpg
57KB, 567x561px
>>57323319
>>57323332
>everything I don't agree with is bait
>>
>>57323453
Top one for readability, bottom one to show your computer e-penis skills.
>>
>>57323471
Top one for everything, function calls are extremely expensive.
>>
>>57323370
I would fire the second programmer. It's less readable than the first, and has no performance benefits.

I would bet the second programmer would probably consider himself "smarter" since he used standard library functions instead of simple statements, but the opposite is in fact true.
>>
>>57322016
i would punch them in the heart
>>
File: 1448564482342.png (467KB, 1000x950px) Image search: [Google]
1448564482342.png
467KB, 1000x950px
I love these
>>
File: 1460721208467.png (42KB, 916x753px) Image search: [Google]
1460721208467.png
42KB, 916x753px
>>57323661
>>
File: 1448416255195.png (139KB, 955x654px) Image search: [Google]
1448416255195.png
139KB, 955x654px
>>57323669
>>
>>57321552
mainly just inefficient, also capped at b=10
just do a loop over b and keep adding a
>>
File: 1473517613226.png (410KB, 3000x3000px) Image search: [Google]
1473517613226.png
410KB, 3000x3000px
>>57323683
>>
>>57323661
This doesn't seem that unreasonable.
>>
>>57323661
What's wrong with that? Should it just return true / false? Maybe it uses the string it returns?
>>
>>57320538
Hahahahhaha
I have no fucking idea what is going on in this thread
>>
>>57322016
what the shit is the purpose of doing that?
>>
>>57323761
Making the code less readable and harder to maintain?
>>
>>57322016
>there may be unknown bugs caused due to this

I fucking hate this shit so much.

>coworkers writes some shit
>tells me to pull
>"It's not tested though :^)"
>>
>>57323513
I mostly agree, but 2nd version is better if it's lazily evaluated (is it? Haven't really done php7). Memory usage should be kept down.
>>
>>57322119
I did similar things, it can be a lot faster.
>>
>>57323734
>What's wrong with that?
needlessly long I assume.
just split the string, grab the info you need from it and then return it
>>
>>57322048
I have done this once or twice when rushing through an implementation. It just reads better, I always optimize later.
>>
>>57323818
>what is cyclomatic complexity?
>>
>>57323832
If hardcoding is faster depends on the complexity of the alternative. Compiler side optimization will get rid of that monster pretty fast.
>>
boolean isOdd(int n){
boolean[] arr = new boolean[n];
arr[0] = false;
for(int i = 1;i<n+1;i++){
arr[i] = (arr[i-1]) ? false :
}
return(arr[n]);
}
>>
scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'


From scrots manpage. Not sure if just a bad example or really retarded.
>>
>>57321552
Try using it to calculate 11*11
Not a very good function if it throws an error instead of answering with 121
>>
>>57324353
is this bait?
>>
>>57323725
What's the problem here?
>>
>>57324628
its a loop typed out
>>
>>57324735
You mean "unrolled-loop".
And unless there was an actual comment that the compiler/interpreter wouldn't unroll it, I'd say that this was premature optimization, and therefore completely bogus.
Thread posts: 109
Thread images: 32


[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.