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

/dpt/ - Daily Programming Thread

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

Thread replies: 380
Thread images: 30

File: trap programmer dpt.jpg (2MB, 1700x2470px) Image search: [Google]
trap programmer dpt.jpg
2MB, 1700x2470px
old thread: >>59050789

What are you working on, /g/?
>>
where can i get a qt anime gf(male) ?
>>
>catalog
>ctrl-f
>challenge
>no challenge
>disappoint.jpg
>>
>His function doesn't even have multiple return values
I hope you aren't using a shitty language, /dpt/

>Filthy obsolete peasants
tuple!(int, float, char[]) function(int kill_me){
return tuple(just, fuckmy, shitup);
}

>civilized and modern languages
while _,indes in range x: {
do(stuff)
}
>>
>>59057263
One of my few regrets for D
>>
File: fun.png (2KB, 466x78px) Image search: [Google]
fun.png
2KB, 466x78px
Do you guys do fun output while debugging?
So funny, right guys?
>>
>>59057301
I feel like that would be a larger project than whatever I was doing before.
>>
Where were you when C was kill?
https://benchmarksgame.alioth.debian.org/u64q/performance.php?test=knucleotide
>>
>>59057315
this link should be on autoban
>>
File: 16508094.jpg (14KB, 262x260px) Image search: [Google]
16508094.jpg
14KB, 262x260px
>>59057231
>>59057340
>>
>>59057315
Where were you when Rust was kill?
https://benchmarksgame.alioth.debian.org/u64q/performance.php?test=binarytrees
>>
>>59057383
You'll need an array of strings containing the names of each day (starting with Sunday of course) and the modulus operator
>>
This is with Python. I don't know how to solve this problem. Can someone point me in the right direction?

I was thinking about some way to cycle through a list. I get an error "beyond the max range of the list". Or maybe there is some other way to solve this? Please don't solve it for me just tell me what to look into to get started to solve it.
>>
>>59057402
>>59057399
>>
d=x.getImageData(0,0,w=c.width=256,h=144);for(i=0;i<h;i++)for(j=0;j<w;j++)d.data[(i*w+j)*4+3]=(i-j&j+i)*t%w;x.putImageData(d,0,0)
>>
>>59057363
Where were you when C was kill?
>Binary expressions and function arguments are evaluated in strictly left-to-right order. This is similar to Java but different to C and C++, where the evaluation order is unspecified...
>>
>>59057402
char *days[] = { "mo", "tu", "we", "th", "fr", "sa", "su" };
printf("%s\n", days[(3 + 137) % 7]);
>>
>>59057414
>>59057434
>general version of the program
>spoonfeeding
>>
>>59057443
dont worry he's retarded and won't get it
>>
File: suna5.gif (36KB, 400x299px) Image search: [Google]
suna5.gif
36KB, 400x299px
How do I create a dynamically growing buffer for large amounts of data
>>
>>59057471
In?
>>
>>59057471
create a vector object that doubles in size whenever it's at least 75% full
>>
>>59057471
Queue<Stuff> = new ConcurrentLinkedQueue<Stuff>();


:^)
>>
>code pauses when laptop is in sleep mode
Are you fucking kidding me?
>>
>>59057521
what do you think suspend does?
>>
>>59057471
List
>>
>>59057402
Easy enough.
Any day + 7 days is equal to the same day next week. Use the modulus operator to determine how many remainder there is and work from there.
>>
>>59057533
Sleep and suspend are two different thing, anon.
Stuff are supposed to work in sleep mode.

Maybe the other anon isn't using his sleep mode properly.
>>
>>59057482
C
>>
in the beginning, mans programs crashed
>>
>>59057553
I-Is that so? How do I make sure that my code runs overnight?
I'm using cygwin+gcc to compile C++ btw.
>>
I understand how heaps work, but how do grow/shrink the size of the heap dynamically in C???????
>>
>>59057521
No, that's how it works.
>>
>>59057399
>>59057551
>>59057414
I'm still getting the same error index out of range
days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']

def weekDay(x):
return days[x + 4 % len(days)]

print(weekDay(int(input("Input number of days: "))))
>>
>>59057582
That's something that the malloc implementation does.
You don't need to fuck with the heap yourself.
>>
no one cares about how elegant or smart your code is only that it works

The cold hard truth
>>
File: Redditfags out.jpg (137KB, 555x664px) Image search: [Google]
Redditfags out.jpg
137KB, 555x664px
>>59057345
>Being a communist/socialist in 2017
Back to Raddit with you
>>
>>59057644
poorly written code doesn't work very well
>>
>>59057635
because you're doing x + (4 mod 7) instead of (x + 4) mod 7
>>
>>59057640
Fucking with total size of heap is what OS does for you, with malloc you only claim parts of the heap that you actually intend to use (if available).
>>
File: 1487464466945.gif (1MB, 260x260px) Image search: [Google]
1487464466945.gif
1MB, 260x260px
>tfw used to be super good at programming in high school
>hit university and now I'm hilariously below par grade wise

Anyway, how can I get myself more comfortable with recursive programming? I can get a loop solution fairly easily, but I have trouble translating that into a recursive solution.
>>
>>59057263
>no MULTIPLE-VALUE-BIND
>no DESTRUCTURING-BIND
>no VALUES
Into the trash it goes.
>>
>>59057635
Order of operators still apply in programming
>>
>>59057667
>total size of heap is what OS does for you
Normally (on Unix-likes), brk/sbrk needs to be called so that the OS will resize the heap, but that's something the malloc implementation will do.
>>
>>59057672
Practice. Recursive programming isn't hard. The hard part is spotting the right situations to use it.
>>
>>59057726
there's almost no valid situations where recursion would be useful unless you're using trees, and those have very limited use cases where they wouldn't degenerate into a straight linked list.
>>
>>59057735
>very limited use cases
What?
Trees are useful as fuck, and are used all over the place.
>>
Anyone here ever hard such a horrible programming teacher that you never got programming but when you finally did get a good programming professor you actually understood how to program and the fundamentals of programming?
>>
>>59057735
>>59057748
Also when programming math equations
>>
>>59057769
Kind of, but I got gud on my own
>>
>>59057769
I had that happen except I didn't understand shit until I taught myself C.

Java is such a horrible beginner's language.
>>
if your brain is too small to use Rust, then you need to head on back to /v/
>>
>>59057769
I had an indian professor that no one understood.
Luckily I already had prior knowledge. Easiest A of my life.
>>
File: grXbijJ.png (821KB, 1330x1080px) Image search: [Google]
grXbijJ.png
821KB, 1330x1080px
>>59057798
>having the compiler babysit you makes you "smart"
>>
>>59057798
If you don't have a degree from MIT, then you need to head back to /v/ as well
>>
>>59057811
>>59057839
t. brainlets
>>
why do unis hire immigrant trash that can barely speak English?
this happens all too often, tbqhf
>>
>>59057839
MIT became trash the moment 6.001 switched to python.
>>
>>59057839
>MIT
pleb trash.
>>
>>59057798
This.

Quick reminder that C toddlers are actually too dumb for Rust.
>>
>>59057872
Because they pay out of state tuition, usually at a rate 4x more than you do.
>>
>>59057872
Why do you care? You are going to go to a uni that employs jews and niggers. Why would you cuck yourself like that.

Take some pride on yourself and drop out.
>>
>>59057852
*tips*
>>59057881
See >>59057811
>>
>>59057873
I went on exchange to MIT during my university days. That was prior to them switching to python. I don't understand why they would switch it but most of the people there are already smart enough that it doesn't matter if it is coded in Python or Rust or even in Assembly. One of the few places I have been to that made me feel stupid but I did love America a lot.
>>
>>59057872
The same reason other places hire them. Because they do it so much cheaper than a local would that the decline in quality is deemed acceptable.
>>
>>59057904
That feature is necessary for C toddler refugees so that they can learn how to write programs.

It's literally nurturing a C infant
>>
>>59057922
So you're saying you'd be able to program safe programs without the borrow checker? Why not just use C then?
>>
>>59057951
Because C has fuckton of undefined behaviors
>>
>>59057959
And? Are you trying to say UB is bad?
>>
Does anyone know how to open up a file browser in Android so the user can select a file to user for whatever reason?
>>
>>59057970
The more undefined behavior the more broken the language is
>>
>>59057959
>tfw too dumb to avoid UB
>>
>>59057983
>If I just ignore and pretend UBs (that are well defined in good languages) it's not a problem

BAN C PROGRAMMING
https://arstechnica.com/security/2016/08/code-dumped-online-came-from-omnipotent-nsa-tied-hacking-group/
>>
>>59057959
>undefined
You mean platform dependent?
>>
>>59057980
UB allows the compiler to generate a lot more efficient code.
UB allows the language to be much easier to implement.
UB allows the language to not have to define ridiculous situations where there is no reasonable answer.

The thing which is actually a pain in the ass is implementation-defined behaviour.
>>
Bout to make my first issue in an open source problem
>>
>>59058006
If you are depending on UB to generate "efficient code" you really need to rethink your algorithm
>>
>>59057225
By installing gentoo
>>
This is stupid of me but how do I use two inputs as arguments for a function call without setting up variables?
def weekDay(x, y):
return days[(x + y) % len(days)]

weekDay(int(input("Input number of days"), int(input("Input starting day"))))
>>
>>59058025
It has nothing to do with my algorithms. It's to do with the compiler.
A compiler is allowed to assume that UB can never happen, and is allowed to optimise based on that assumption.
So it can take statements like (x < x + 1), and just replace that with (true), as it can assume that signed integer overflow can never happen.
>>
Anyone, the original discussion before the Rust user derailed it was that Rust users aren't actually smarter for having the borrow checker do the thinking for them
>>
>>59058050
jesus fuck you're too stupid for this

drop out right now
>>
>>59058055
What are you talking about? Can you re read >>59058025

If you are looking to improve your efficiency, optimize your model, do not defined on the fact that the language is broken and produces unspecified behavior
>>
>>59058050
lmfao
>>
>>59058082
>defined
depend*
>>
File: light_kek.jpg (31KB, 364x275px) Image search: [Google]
light_kek.jpg
31KB, 364x275px
>>59058050
>>
>>59058068
>>59058083
>falling for the bait
>>
>>59058050
don't do that. it makes your code harder to read

p.s. it's already hard to read
>>
>>59057672
> used to be super good at programming in high school
>how can I get myself more comfortable with recursive programming

Brah...
>>
File: (you).png (2KB, 244x226px) Image search: [Google]
(you).png
2KB, 244x226px
>>
>>59053612
>>
>>59058082
>unspecified behavior
Don't use your terms incorrectly, idiot.
That is something else.
>If you are looking to improve your efficiency, optimize your model
How is forcing the compiler to add more checks going to make the program more efficient?
Some languages might be able to add more to the type system to try and remedy that, but Rust certainly isn't the shining example of a type system that is going to generate efficient code.
>>
>>59058068
>>59058083
>>59058114
I just started. I'm a beginner. I can't help not knowing things I haven't learned.
>>
>>59058050
Stop.
Why the fuck are you doing this?
>>
>>59058168
You're cute if you're sincere anon
>>
>>59058168
Explain what is wrong with declaring two variables and having inputs assign values to those variables before passing them into the function.
>>
>>59058181
Is it because the inputs are temporary and not stored?
>>
>>59058168
You are not going to get real help in 4chen.

Go to python beginners IRC
>>
>>59057231
Why aren't you solving math problems right now? Is that not enough of a challenge for someone of your intellect?
for i in range(10001, 1000000):
if str(i) == str(i)[::-1]:
for m in range(100, 1000)[::-1]:
if i % m == 0 and 100 <= i / m <= 999:
print(i, '=', int(i / m), 'x', m)
break
else:
continue
>>
>>59058181
it uses way more memory if you do that
>>
>>59058199
You are not at the stage where you need to worry about memory yet.

But to answer your question, create another function to store the inputs and then use that function to pass the inputs to your other function.
>>
>>59058129
Never did that kind of stuff.
>>
>>59058199
Never worry about memory unless it's an explicitly memory intensive problem
>>
File: cosmos-programming-language.png (17KB, 616x470px) Image search: [Google]
cosmos-programming-language.png
17KB, 616x470px
>tfw no logic-functional optionally-typed object-oriented prototype-based scripting language in a procedural syntax with sensible whitespace rules
>>
>>59058168
"Ignorantia non excusat."
- some Mediterranean buggerer approximately 2000 years ago
>>
>>59058193
i am actually solving unsolved math problems right now. already got one of them.
>>
>>59058261
>object-oriented
Nope, stopped reading right there, buddy.
>>
>>59058261
python?
>>
>>59058299
>Sensible whitespace rules
>Python
Nani!?
>>
>>59058193
it's more fun when everyone's working on the same problem so you can compare solutions
>>
>>59058299
not logic-functional or optionally-typed
>>
>>59058283
As in academic problems? Doesn't that require a proof? Some of those have rewards into the thousands.
>>59058314
Project Euler problems have solutions you can look up and compare to.
>>
>>59058331
>As in academic problems? Doesn't that require a proof?
yes to both. i have the first proof ready, now working on some other easy shit.
>Some of those have rewards into the thousands.
i haven't checked but I'm not sure if I will even share this with the world before I die.
>>
>>59058331
P != NP. QED
>>
>>59058348
So basically you are writing a math thesis?
>>
>>59058387
i'm just solving unsolved math problems for fun.
i'm not affiliated with any university if that's what you're asking.
>>
>spent an hour trying to make a patreon scrapper
>hold up
>let me check github to see if someone hasnt already done this
>they have, and it does everything i want

im happy and upset at the same time
>>
>>59058425
You don't have to be affiliated to universities to write a thesis senpai. But what you are doing is considering writing a thesis since you are solving and proving unsolved math problems. Do consider writing a paper and publishing it.
>>
File: killing_me.jpg (22KB, 397x398px) Image search: [Google]
killing_me.jpg
22KB, 397x398px
>>59058050
you're gonna get hired at company XYZ and write this shit for money

I bet you sleep at night without thinking about how shitty it is
>>
>>59058491
As someone who has a job that codes in Python 90% of the time, I can safely say you are right and it scares me what my colleagues do sometimes.
>>
>>59058491
>>59058114
>>59058083
I have no idea why everybody is so amused by my code but I see it as a sign of progress that I'm thinking of new ways to solve problems even if I'm doing it wrong.
>>
>>59058532
>I see it as a sign of progress
kek
>>
>>59058491
>>59058514
How much LOC do you have to write per day in such company, and do you need a degree to do so?
>>
>>59058560
Depends. Most of my time is spent reading documentation cause my job is real to convert Matlab code into usable python code for plugin applications. I can write hundreds of lines a day if I get going or I can write zero and stare at my screen trying to figure out what the fuck R&D is trying to pull on me.
>>
File: shot0012.png (2MB, 960x720px) Image search: [Google]
shot0012.png
2MB, 960x720px
>>59057998
OMG. You're right. We should write an operating system or kernel in Rust or Java. That surely would be both portable and extremely quick, almost to the same degree C is. I see no massive performance drawbacks whatsoever.
>>
>>59058560
>implying LOC is a sign of proficiency

you need a degree if you don't want to piss off the devs around you

good luck find a legitimate company that will hire you without a tech degree
>>
>>59058532
>Runs into a small problem
>Easily solved with a little troubleshooting or even googling
>Runs to 4chan to ask for helps
>Sign of progress
Okay anon
>>
>>59058588
see >>59058134
>>
File: whatweretheythinking.jpg (143KB, 965x719px) Image search: [Google]
whatweretheythinking.jpg
143KB, 965x719px
Can someone make python with curlies?

I love copying and pasting code from stackoverflow just to test it three times to get rid of indentation errors, since it might be tabs or spaces or fucking triforces, anything goes it seems..
>>
>>59058579
>cares about that stunninc 0.01% performance gap
>doesn't program in assembly
Not everyone is running pentium 1 these days poorfag
>>
>>59058596
j >>59058588
bne >>59058290
>>
I just finished writing a business web java app and it already has made $20 feels good man
>>
currently working on resume. no idea what to put on it.

so far I have listed:

// languages, frameworks, etc...
// projects
// accomplishments, awards, etc...

I'm a senior software engineering student that goes to an average state school. I've never really done anything too exciting outside of class. I have however worked on several significant projects in my classes over the years. Should I put them on my resume? Should I list come of the classes I've taken on my resume?

not trying to get into any big companies. just looking for something (I've even take a shitty web development internship at this point) this summer because I graduate in 10 months. good news is I know a few guys willing to put in a good word for me at a few places.
>>
>>59058547
Over the last couple of days I've gone from blind repetition to trying out new things I've thought of on my own.

I'm probably not the first person that's learnt program to think I've learnt that input can act as variables let me try two inputs in one statement and I probably won't be the last.
>>
>>59058606
True, but everyone who's at least marginally intelligent doesn't need their language to baby them when it comes to undefined behavior, due to knowing how to avoid it in the first place. Not to mention,why program in assembly when C is more easy to remember and codealong with being more portable?
>>
What's the best way to handle timers on android applications? As in something to count down and perform a function at a pre determined time.
>>
>>59058652
>due to knowing how to avoid it in the first place.
If I pretend they don't exist they actually don't
Get a load of this faggot
>>
>>59057215
I already know C++ and I want to move to write graphical applications. I took interest in Qt since it can go multiplatform and it has a nice little interface to create the GUI, but the moment I dug into some examples I got a bit overwhelmed by signals everywhere and .qml's syntax.

Is there any good books or websites to learn Qt by myself?
>>
>>59058661
event handlers
>>
File: 1476944779597.jpg (19KB, 320x320px) Image search: [Google]
1476944779597.jpg
19KB, 320x320px
What's the most aesthetic language? This is very important to me.
>>
>>59058670
>Being so cucked your language has to hold your hand
Good luck getting anything worthwhile getting done in your cucked language faggot. Any programmer woth their weight in praise can program in C.

>>59058688
(( LISP ))
>>
File: satou_downs.jpg (55KB, 640x364px) Image search: [Google]
satou_downs.jpg
55KB, 640x364px
>>59058581
Is this true?
>>
>>59058688
APL
>>
>>59058695
>le cuck XD
This is what a C toddler resorts to when it gets cornered like a little mouse
>>
>>59057748
He said when the wouldn't degenerate into a linked list; he's right and also recursive functions usually get turned into a loop by the optimization process.
>>
File: images.png (1KB, 121x121px) Image search: [Google]
images.png
1KB, 121x121px
Why the fuck didn't you fags tell me how great Golang was?
>>
>>59058602
Fix your .vimrc.
>>
>>59058633
Sounds about right. Remember to add in stuff like being gay, being a minority or shit like that. It is 2017 and it works.
>>
>>59058720
I've said that it's fucking shit many times, though.
>>
>>59058050
lmao just use variables dumbass
this is unreadable btw
>>
Java is C++ on steroids
>>
File: nevermind.gif (478KB, 140x105px) Image search: [Google]
nevermind.gif
478KB, 140x105px
>>59058726
>tfw i use geany like the GUI-pleb i am
>>
>>59058633
connections probably matter more than knowledge in this field.

employers want to know that someone else knows you're not a complete sperg.
>>
>>59058747
i use geany, too!
>>
>>59058756
Connection > Interviews > Actual Degree >>>>> Knowledge
>>
>>59058688
lisp or haskell
but you can do lisp style programming in haskell
without the macros
>>
>>59058730
I'm just your average white dude.

I know I'm a shit, glorified code monkey. I'm just trying to produce the best resume I can with what I got, so I can get my foot in the door somewhere.
>>
>>59058731
Lol, you obviously know nothing of the finer things, I bid you good day sir.
>>
So I have to chose a path in my BS. Java or C++. My dream job is to develop medical software.
>>
File: endian.png (57KB, 742x864px) Image search: [Google]
endian.png
57KB, 742x864px
I just finished a project for my compsci class and not like ten minutes later my professor assigned this for 12 tonight. Maybe it's because I just got done burning through another project but I have no idea how to even start this. Just making a function that converts a char to hexidecimal seems insurmountable. Could someone help me out?
>>
>>59058785
>Lol
>I bid you good day sir
Seriously? Get the hell out of here.
>>
>>59058744
More like on synthol.
>>
I wish my compiler wasn't so harsh in telling me I made a mistake! Can't someone make a more compassionate one?
Maybe make it give a gentle hint as to what I'm doing wrong instead of abruptly crashing my program and flashing a violent blood red error message?
>>
>>59058797
Lol, you are indeed a sperg.
>>
>>59058796
just printf a char as an integer and see what happens
>>
>>59058688
>>59058261
>>
>>59058796
this is very easy literally google converting an int to a hexadecimal to see how it is done
>>
>>59058770
nailed it

reeeeee
>>
>>59058777
Resume gets you an interview. Resume doesn't get you a job. Put interesting shit in your resume that makes them want to call you up for an interview. You can bore them to shit during the actual interview. So in summary, keep your resume short, concise and to the point. HR at my company auto shreds any resume longer than 1 page.
>>
>>59058810
computers don't have feelings
they're also not going to forgive an arbitrary number of mistakes because it's only going to do exactly what you want and nothing else, a forgiving compiler would be an AI that guesses your intentions even though your syntax is completely wrong.
>>
>>59058796
S T A C K O V E R F L O W
>>
>>59058770
Yup, nepotism scored me half the job I ever had. Tech or otherwise. The better half.
>>
>>59058199
I doubt it. the return values still have to be stored somewhere anyway...
>>
How the fuck do I make an induced subgraph? All google gives me is math definitions, and I'm thinking hard here but I do not understand how a breadth first search is going to apply.
>>
>>59058855
___ doesn't have this problem

Hint: Starts with 'R' and ends with 't'
>>
File: shot0062.png (2MB, 960x720px) Image search: [Google]
shot0062.png
2MB, 960x720px
>>59058706
>C toddler
>Uses a meme language that literally tells you what to do
>toddler
If you're going to use a meme language, use one that's at least practical. I mean you act like Rust is hot shit, when in reality, it's a shittier version of Java or C++, both of which were said to replace C in the future. Yet people still use C today, probably because it's the best language for the job it was intended for: near bare-metal interaction and OS development. Rust doesn't have the same niche nor the same necessity in today's world that C did in the early to mid 70's, when it was being created for UNIX. Why should you use Rust today vs. C? C has all the important features Rust has and is less inhibited by security,making it faste in addition to being more portable than Rust. Even in the 70s, this was the same basic reason C won out over less memey languages like LISP, Pascal and FORTRAN (although even they still ahve their uses). Rust honestly doesn't have a niche like C does since it's not as fast as C and not as portable as C, which was the entire fucking point of making C in the first place. If you want to sacrifice those things, sure go ahead. But the majority of programmers think thoe benchmarks are important so don't go around acting like Rust is some godsend when it's really just a piece of shit.
>>
>>59058897
He is doing homework senpai. I doubt his professor allows him to submit code in another language.
>>
>>59058900
woah there my weeb friend you really wrote yourself an essay there.
>>
>>59058792
>I have to chose
no you dont you retard
>>
>professors make language spec for compilers course
>it's horribly incomplete
>most of the rules we decide on are just whatever we like since he's more concerned with us actually generating code

This is a real pain in the ass
>>
>>59058902
Oh alas
>>
>>59058824
>>59058829
>>59058855
The examples I'm finding just use itoa or hex. I'm not allowed to use those.
>>
>>59058897
Root?
>>
>>59058796
damn.

and meanwhile in my CS2 class our "big" project was to take a string and count the number of different characters in it. we had two weeks to do it.
>>
>>59058903
Nice ad hominem there, my friend. Just ignore the actual argument and it will go away
>>
>>59058720
but I have...
been posting links to the Go Tour for months


>>59058050
your program will crash if the user inputs non-numeric values

>>59058627
congrats
>>
My professor told us to stop talking about C because
>I discourage C because it promotes "meritocratic culture" in programming which is essentially a culture of white male autism and scares away people of color and women to keep them away in this white male dominated field.
I'm thinking of dropping out.
>>
>>59058920
void hexaD(int a, char b)
{
int hexa[2]={0}, x,y,i=1;

cout << "Enter the value to convert to hexa: ";
cin >> x;

y=x;

do
{
hexa[i] = y%16;
y = y/16;
i--;

} while(y>0);

for (i=0;i<2;i++)
{
y = hexa[i];

if (y==10)
cout << 'A';
else if (y==11)
cout << 'B';
else if (y==12)
cout << 'C';
else if (y==13)
cout << 'D';
else if (y==14)
cout << 'E';
else if (y==15)
cout << 'F';
else
cout << y;
}
}


O P E N W I D E
>>
>>59058955
he is right ya know
>>
>>59058962
disgusting
>>
File: 1452741641874.png (232KB, 500x525px) Image search: [Google]
1452741641874.png
232KB, 500x525px
>>59058955
>being in a meritocracy is bad
I'm so fucking glad my field is still relatively untainted by SJW PC bs and that there aren't any niggers in my research group
>>
>>59058962
Holy shit anon God Bless. You just saved my ass.
>>
>>59058897
Reddit?
>>
>>59058963
If he were why should it matter to me? Why should I give a shit about the feelings of minorities and women and do what works best for me?
>>
>>59058953
>argument
nonsense rambling fueled by emotion*

Just give up.
>>
>>59058955
Program in C just to trigger him. Talk about how it's the best language ever (even if you don't believe it). Then just spew C buzzwords whenever you have a question in class (like "This topic is giving my brain a segmentation fault" or "Let me get my stdio.h pen/encil out")
>>
>>59058973
doesn't even matter it's more than nothing
>>
>>59058796
>reverse endian
>>
>>59058953
Welcome to 4chan, friendo.
>>
>>59058962
atleast explain to him how this works and your code so he learns something

>>59058990
because you need to check your white male privilege
>>
>>59058994
What are your Reddit threads in that hideous font?
>>
is ruby a meme or is it worth learning for metaprogramming and scripting purposes to supplement my everyday tasks?
>>
>>59057471
linked queue
>>
>>59058955
troll, bait, poe's law?
>>
>>59059025
Bash and lua is all you need for scripting
>>
>>59058602
Too bad your precious python doesn't have read macros.
>>
>>59058920
>>59058796
sprintf does this automatically with %0x format string, but I don't think your teacher would want that

This shit stumped me the first week I started programming, I even learned how to do it on paper before writing a program to do it.
Now I forgot.
Anyway fuck that shit, you never need to do this sort of thing, you're much more likely to convert hex strings to integers anyway.
>>
>>59058774
There's Liskell too, but I think it's dormant.
>>
>>59058796
maybe you shouldn't have waited until 6 hours before its do fr fr
>>
>>59058994
Responses from that thread:
>For most uses there's not a huge difference in timing between C and C++, but for the simulation work I tend to do I need to squeeze every available bit of performance out as possible (time-domain simulations are a bitch) so using C is really the only way to go. Plus it's slightly easier to call from my Python graphing interfaces (using ctypes) due to C++ name-mangling - obviously you only need to add some "extern"s in c++, but why bother when you can use C which is faster for these simulations anyway.

>Learn the language you're using from inside out. Don't rely on copy pasting stack overflow and cry a river when shit goes bad. The language was created and is good. If you know how to use it correctly, nothing bad will happen. So yes, it's the coder's fault.

>Try implementing my C-based simulation code in any of your shit-tier """security-checking""" languages. Have fun waiting at least 10x longer for results.

>As long as people are writing low-level programs without sacrificing portability, C will never go away.
>>miniscule >http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gcc&lang2=rust

It's like being a good programmer requires you to know the ins and outs of your language by reading the documentation and everything is essentially the fault of the programmer. Like that C is very important when it comes to bare-metal interactions or speed. Really makes you think...
>>
Folks give me a hint, fastest way to visit all given nodes in a tree from whichever starting point you want. The tree has n - 1 links for n nodes, no loops, and its unweighted
>>
>>59058954
>>59058720
speaking of which...

>>59057215
https://tour.golang.org

>>59059025
learn Go. it can be used as a scripting language, too... and it's quite good at that (except for the "if err != nil" stuff...)
>>
>>59059062
*everything is essentially the fault of the programmer
everything that goes wrong is the fault of the programmer
>>
>>59059067

any suggestions on ebooks or paperbacks on Go? is there an oreilly book on it?
>>
File: slide8-680x400.jpg (37KB, 680x400px) Image search: [Google]
slide8-680x400.jpg
37KB, 680x400px
>>59058900
1. Java never was going to replace C, C++ was. C++ has replaced C, making C limited to embedded systems programming these days.

If you look at large open source C projects or if you have worked on closed source C projects you will notice the developers are dying to write C with Object Orientation mockups in the most pathetic matter.

>Rust honestly doesn't have a niche like C does since it's not as fast as C
I hear this a lot of times. but C doesn't have any concept of concurrency like modern languages, less memory is irrelevant in the age of multiple processors and threaded programming. The efficiency of hardware has increased while C is stuck in the 80's model of computing.

>C has all the important features Rust has
You don't want to go there, my child

> Rust is some godsend
It's not. However it's a major improvement on C++, which was a major improvement on C.

>more portable than Rust
Another buzzword. The RustC uses LLVM backend, any architecture LLVM works with, Rust will work (if not it already does)

>Rust doesn't have the same niche nor the same necessity in today's world
It does, safety is a major requirement now that security is a major consideration. "Safe C" courses and guidelines is a thing, which Rust deprecates.

You are just upset that C is being shat on while you C toddlers do the same with python and JS fags. How ironic that you can't handle simple banter.

NEET
>>
>>59058796
In assembly this is just
bswap
>>
>>59058962
The assignment clearly says to do that with bit operators.
>>
>>59058050
Hey friend, I don't know what IDE you're using, but grab pycharm community edition. It's got a lot of useful features including a debugger.
>>
>>59059096
>>1, manner*
>>
>>59059082
This is pretty much the only decent Go book: http://www.gopl.io/

You can find it on libgen.
>>
>>59059016
Must be your reddit eyes, redditor. Go back to your subchan
>>
File: CONSIDER THE FOLLOWING .png (1MB, 1299x863px) Image search: [Google]
CONSIDER THE FOLLOWING .png
1MB, 1299x863px
How long on average does it take for a person to learn a programming language like C++, Assembly, and Haskell?
>>
>>59059082
Go and Rust has pretty shitty book. Go introduction book is kinda okay for new learners if they can use Google.

I suggest you learn C or Python. Both are beginner friendly newbie languages
>>
>>59059063
If you have to visit every single one, just BFS.
>>
>>59059123
A lifetime.
>>
>>59059145
What if they're dead by then?
>>
>>59059153
Then they are no longer learning.
>>
>>59059096
Cucks RTFO'D!
>>
>>59059104
What about pycharm education edition?
>>
>>59059137
What about a given subset of the nodes?
>>
>>59059008
If he can't understand how that code works he is bound for failure. He won't have the Internet to help him.
>>
>>59059188
Still, I don't think there is a fast algorithm for visiting ALL nodes. I think you're stuck with BFS (DFS could work too with caution).
>>
>>59059096
>C++ has replaced C
Yet why is C still almost an industry standard when it comes to making drivers and low-level software where performance matters (along with assembly of various archetectures)?

>it's a major improvement on C++, which was a major improvement on C
More features != an improvement. C++ wasn't really an improvement on C. C++ is slower than C in terms of performace (you know, the whole purpose of making C in the first place) and even that is eons ahead of Rust. So yeah, people that are concerned with performance use C probably.

> The RustC uses LLVM backend
Great. C runs on bare metal. Guess which one is faster?

> safety is a major requirement now that security is a major consideration
No good coding practices are what's needed, not more security features which slows down the language. ALL performance critical code has to use a memory unsafe language. I mean, you can't have your pie and eat it too.

>You are just upset that C is being shat on while you C toddlers do the same with python and JS fags.
No. I'm not mad. i just think you're a stupid webdev that can't read the fucking manual, has bad programming practices if C fucks up n you constantly and doesn't understand the concept of using different languages for different puposes. I wouldn't use C for something Haskell or LISP is more prepared to do or vice versa. Likewise, I wouldn't use Rust for anything C is supposed to do just because of C is honestly more adept at what it does than Rust will ever be.
>>
>>59059237
*No, good coding practices are what's needed
>>
File: alg-laughing-jpg.jpg (32KB, 750x543px) Image search: [Google]
alg-laughing-jpg.jpg
32KB, 750x543px
>>59059237
>> The RustC uses LLVM backend
>Great. C runs on bare metal.
>>
>>59059237
How old are you though
>>
>>59059254
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gcc&lang2=rust

Now take your meme language elsewhere
>>
>>59059188
>>59059220
I should clarify "all nodes AND it being unweighted." Otherwise I'd suggest something like Kruskal's.
>>
>>59059179
I don't know, I've always used Community edition. Make sure to google how to set line numbers (they might be enabled by default now, been a while), and I really like dark mode + monokai style.

Once you begin writing your code, under 'Run', you can select 'Debug <program name>. Set breakpoints by double-clicking neat the line of code you want the debugger to stop at. A small window will be open showing you allocated variables and their values (inc. maps, lists, ect). F7 then allows you to "increment" the program by a line at a time (there are other ways to move the program forward as well, see @ top of the bar in 'console' window).

Infinitely less shit to use than stepping through memory locations for an array and printing them in hex with GDB in C lol.
>>
>>59059268
Old enough :^)
>>
>>59058796
does anyone know how to convert to hex without having to reverse the string afterwards?

char *to_hex(unsigned num)
{
char lut[16] = "0123456789ABCDEF";
static char hex[16] = { 0 };
unsigned idx = 0;
while (num)
{
hex[idx++] = lut[num % 16];
num /= 16;
}
unsigned i = 0, j = idx - 1;
do
{
char t = hex[i];
hex[i] = hex[j];
hex[j] = t;
} while (i++ < j--);
return hex;
}
>>
were the boipucci at
>>
>>59059025
I find ruby quite comfy, in fact about two weeks ago I did some script that does """metaprogramming""" just to help me write some boilerplate.
>>
>>59059349
check your dads phone
>>
>>59059268
irrelevant
>>
>>59057471
malloc()
>>
>>59059321
At some point in time you need to start doing your own homework
>>
you stupid motherfuckers helping this kid out.

>>59058796
hey dude, read the goddamn man pages. do some research. experiment. write unit tests. go back and touch up on any fundamentals. draw it out on paper.

you get something challenging and you run to stackoverflow and /g/ like a little bitch
>>
>>59059400
Why do your format your posts like that, you redditor child?
>>
>>59057215
Working on a simple intro circuit in Verilog.

Finishing a simple 2D shooting game in Python.

Playing with some code for an Arduino project I did a few months ago.
>>
>>59059410
>everyone I don't like / agree with is a redditor
>>
>>59059321
I don't know if I would do it the way you have. Grab the current lowest 4 bits with something like:

val = num & x0F;

Then depending on the integer value in val is <= 9, take val + '0' (otherwise (val % 10) + 'A' or something) and put them into the char array in reverse. Then right shift num 4 spaces over: num = num >> 4;

And loop. This would work for 32 bits, 64 bits, ect.
>>
>>59059427
I don't disagree with you.
It's just that your post is formatted like a redditor and/or a child wrote it, and that you should leave.
>>
Any reason why Rustfags have been getting so aggressive lately?
>>
>>59059436
>being this autistic about the formatting of a post
>>
>>59059447
It's just the same insecure shitposter. You can just ignore him.
>>
>>59059123
>>59059123
>>59059123
>>59059123
>>59059123

Guys?
>>
>>59059448
There are standards here, you know. Proper formatting and writing style is one of them.
If you can't conform to the standards, fuck off.

>>59059455
Your question is far too vague/encompassing to give a real answer.
>Asm
Probably a few months.
>Haskell
A year or two.
>C++
~75 years and your sanity.
>>
>>59058675
Shameless self bump.
>>
What are some relatively easy Haskell projects to learn from?
>>
>>59059472
T-thank you anon, I love you
>>
>>59058955
Write everything in C. Not only write everything in C, but write in the most hot shot, systems programmer, pointers to pointers to pointers C fashion as possible. Use K&R style, etc.
>>
>>59057215
Reading through The Little Schemer. Really enjoying it.

Why don't more books try to teach concepts through the question and answer style formatting?
>>
>>59059321
Fuck you, I can reverse all I want!
(defun dec-to-hex (x)
(declare (fixnum x) (optimize (speed 3) (debug 0) (safety 0)))
(cond ((< x 16) (list x))
(t (reverse (append (list (mod x 16))
(reverse (dec-to-hex (floor (/ x 16)))))))))
>>
>>59059498
Write you a scheme in 48 hours
>>
>>59059429
That's an easy change.
while (num)
{
/* get lowest 4 bits */
hex[idx++] = lut[num & 0x0F];
num >>= 4;
}


I actually knew how to do bitwise hex to integer, but not the other way around, thanks!
>>
>>59059586
Already doing that, I was thinking along the lines of some already existing project.
>>
>>59059600
Ah. I recommend writing a server of some sort using concurrency.
>>
>>59059275
>posting le meaningless meme benchmarks
>>
>>59059811
Yeah, it's so meaningless that Rust is a slow piece of shit when it comes to performance compared to languages like Java or C.Also
>le
>>
so is python the best choice for new programmers since there are so many resources available for learning AND it's a useful language?
>>
Why do people argue about languages being trash all the time?
>>
>>59059855
Because they are all trash.
>>
In Java how do I use a static method in one class to print something from another class?
I have two classes A and B, I have a name in A that I want to print in B using a static method.
I've googled and looked in every doc I could find and I'm ready to tear my hair out here soon.
>>
>>59059842
No. Start with assembly. You need fundamentals kid.
>>
>>59059902
The name in A would have to be both static and public
>>
>>59059918
No it wouldn't, however if it's non-static then you'd need to look it up by object, not by class.
>>
Is anyone else unable to create new threads because file uploads keep failing?
>>
>>59059902
You call the method that prints something in class B from class A. Like
public class A {
public static main (String[] args) {
B otherClass = new B();
otherClass.print();
}
}

public class B {
public B () {
}
public print () {
}
}
>>
>>59059925
Agreed, I assumed that he was not looking it up by object because he mentioned "classes" A and B
>>
>>59057215
I'm working on getting my life together... getting kicked out of my home in 2 days... I'm homeless guys. I'm fucking homeless. I think I'm gonna kill myself and stream it for the retards at /b/ . I don't have a reason to live and might as well use my body at best. Thanks /g/. Thanks 4chan. It was a wild ride
>>
>>59059981
You had it coming, you worthless neet garbage.
>>
>>59059937
Yep. I get responses while pinging sys.4chan.org but nobody can upload files right now.
>>
>>59059981
crash at a homeless shelter and apply for food stamps, mate
>>
>>59059981
>I don't have a reason to live and might as well use my body at best
Time for you to go nuclear
>>
>>59059981
i've been homeless and super broke and in debt and lonely and alone and hungry and not have stamps...
it don't get much worse. but that means, you can either stay there or move back up.
i now own a house and 2 vehicles not hungry... still never made more than $35k in any given year of my life so far.

if you really want it, you'll find a way
if not, you'll just find excuses
>>
>>59059981
make sure to post it here too
>>
Why do you guys fag these threads up so much? I actually enjoy talking about programming on /g/ because people here generally have a good sense of humor and you sometimes know what you're talking about... but why this annoying gay faggot shit?
>haha xD panties and socks
Do you really have to force this fucking gay meme bullshit?
>>
>>59060106
Hey don't knock it till you try it.
>>
>>59059123
Learn, or get gud?
>>
>>59060106
it's not gay cus when i put on a skirt i'm a girl
>>
>>59060136
How do I get good?
>>
>>59060144
You never will.
>>
>>59060144
Get off /g/ and get learning
>>
>>59060106
Traps aren't gay.
>>
>>59060148
Damn...

>>59060151
I yam! can you give me some pointers?
>>
>>59060106
if linus says it works then I'm inclined to do it myself. you're gay if you think otherwise
>>
>>59060160
>I yam! can you give me some pointers?
I wanna make a program that can do X.
Think of the X and then start researching, googling, learning till you achieve X. Repeat till you are good.
>>
>>59060160
>can you give me some pointers?
fag *anon = malloc(sizeof(fag));
>>
>>59060106
the fact that you get so worked up over homosexuality makes me suspicious of your sexuality, my friend.

See a therapist.
>>
>>59060179
>he doesn't cast malloc
>>
>>59060182
>the fact that you get so worked up over homosexuality makes me suspicious of your sexuality, my friend.

>le epic projecting meme
I'm pro-gay, I just don't think it belongs in this thread. Forcing it over and over becomes a bit annoying. It has no relevance to programming.
>>
>>59060202
Traps are NOT GAY
>>
>>59060202
>I'm pro-gay
>It has no relevance to programming
how gay can you be?
>>
Dude what the fuck
Python 3
-#Get Coordinates from Input Function
global k
k = 0
def askcord(ps):
checker()
if checker() and k == 0:
winner()
k = 1
else:

>>UnboundLocalError: local variable 'k' referenced before assignment

WHY
The code I show you is the only time "k" is referenced
pls help
>>
>>59057635
https://docs.python.org/3.6/reference/expressions.html#operator-precedence
>>
>>59060222
Have some pride in your sexuality, boyfucker.
>>
>>59060222
>>59060232
Are post-op MTF actually girls or no?
>>
>>59057572
Open Power Settings, switch to the high-performance plan and set it to never sleep.
>>
>>59060233
You do not need the global keyword except when inside a function that uses it.

k = 0
def askcord(ps):
global k
checker()
if checker and k == 0:
winner()
k = 1
else:
>>
>>59060244
no, they're an abomination
>>
>>59060244
No, they aren't girls. With that said, lusting after traps is not gay. A trap is meant to show off an aura of a woman. Thus one that finds a trap attractive merely finds the feminity attractive.
>>
>>59060233
Declare global inside your function instead of using it outside.
>>
>>59060262
but traps have a penis...
>>
>>59060262
if lusting after traps is not gay, then by the transitive property traps are not gay
>>
>>59060233
Your problem is with this line
if checker() and k == 0:


happening before

k = 1
[
k in this case is your local k instead of your global k so it is referenced before it is assigned later 2 lines down.

To fix that declare global inside the function instead of outside.
>>
>>59060277
Feminine penis
>>
>>59060277
feminine penis*
>>
>>59060257
>>59060273
>>59060294
That fixed it, thanks anons, I thought that declaring global inside would throw me a SintaxError for declaring after assignement
>>
>>59060300
>>59060303
h i v e
m i n d
>>
Leviticus 20 13
>>
>>59060308
>SintaxError
Fuck off, redditor.
>>
>>59060317
>citing passages from the torah
fuck off
>>
I can't make a new thread!

We're stuck here.
>>
>>59060338
Too bad.
>>
>>59060317
>Old testament
Check this fag out
>>
>>59060338
I tried earlier too, but I can't upload an image. fucking hiro
>>
>>59060336
>>59060345
>christians
>hurr duurr lets ignore all the old stuff!
kek fucking joke
>>
>>59060371
Yeah it is like people forget about Jesus
>>
>>59060371
>jewish book
>"i-it's actually christian, trust me!"

i'm not a christian, but i hope you don't believe that christians take the torah (aka old testament) seriously
>>
>>59060200
L O L
>>
>>59060398
are you fucking retarded?
>>
>>59060410
Oy vey
>>
>>59060410
stay mad, jew boi

go on, try pushing your holy book's blood rituals onto civilized society
>>
>>59060422
>civilized society
>he still believes in fairy tales
kek

Christians are literally the worst out of all Abrahamic religions .. cherry picking hypocrites.

It's honestly quite pathetic.
>>
>>59060438
Those are actually muslims. Not only do they cherry pick, they cherry pick to the fucking extremes.
>>
guys can we pls stop arguing about religion and discuss what brand of panties is best?
>>
>>59060449
fuck panties; leggings a best!
>>
>>59060438
At least christians follow some of the new testament. Jews completely ignore the entire torah, except for "give reparations".
>>
>>59060438
>Christians are literally the worst out of all Abrahamic religions
you can only say this if you literally haven't heard of Islam. either that or you're simply delusional, even more than the people you seem to hate.
>>
>>59060448
the whole christian religion is based on selected verses from the old testament, chief.

>Christians believe the old testament is the word of God
>But this version of God's word is better!
fucking brainlet christians ..
>>
>Tfw I can't even take any of your programming statements seriously because you hate on a language for absolutely no reason

insert x language

x sucks it is too slow
x is too verbose
x doesn't have this feature

etc etc etc
>>
>>59060488
t, "pythonista"
>>
>>59060475
Yes but they don't murder people over it in current year so that automatically makes them not the worst.
>>
How would you randomly retrieve all items from an array? Would having all the indexes in a link list then doing a rand(linklist.length) be good? Popping it off each time?
>>
>>59060488
>x sucks it is too slow
C n'a pas ce probleme
>x is too verbose
C n'a pas ce probleme
>x doesn't have this feature
C n'a pas ce probleme, tout est realisable
>>
>>59060575
R u s t
u
s
t
>>
>>59060564
>Popping it off each time?
yeah, I just popped one off not too long ago if you catch my drift
>>
Did hiro just killed image uploading?
>>
>>59060642
Why anon, I was just asking a programming question
>>
>>59060564
https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
>>
>>59060731
>tfw algorithms turn you on
>tfw too stupid to understand and implement them
kill me
>>
>>59060756
nice, one less pajeet to compete with
>>
>>59060771
Pajeet understands algorithms, he is just too stupid to implement them
>>
>>59060782
so what does that make me the then?
>>
#include <iostream>
#include <string>
#include <functional>

class Foo
{
public:
Foo() {
arry[0] = "foo";
arry[1] = "bar";
arry[2] = "baz";
arry[3] = "qux";
}

// template <typename T>
// void each(T func)
// void each(const std::function<std::string (std::string ele)> &func)
void each(std::string (* func)(std::string ele))
{
for(int i = 0; i < size; i++) {
func(arry[i]);
}
}

int size = 4;
std::string arry[4];
};

int main(void)
{
Foo foo;

foo.each(
[](std::string str) {
std::cout << str << std::endl;
return str;
}
);

return 0;
}

Need some help. Playing around with C++ lambdas and I'm missing something very crucial here. There are 3 member functions named each inside the class Foo. Two are commented out and work as expected. The one that isn't commented out causes a runtime error and I literally cannot figure out why.
>>
>>59060782
Implementation is the easy part though
>>
>>59060791
Just stupid
>>
>>59060756
(let ((a (make-array 10)))
(dotimes (i 10) (setf (aref a i) i))
(loop for i from (1- (length a)) downto 1
for j = (random (1+ i)) do
(rotatef (aref a i) (aref a j)))
a)
>>
I need to generate a sequence of unique random number pairs.
I'm familiar with the cryptography techniques to create a psuedorandom unique sequence, but I don't know how to extend this to work with pairs.

How would you create a psuedorandom unique pair sequence generator?
>>
>>59060821
Cool it with the anti-Semitism.
>>
>>59060855
Also, I can't just generate a big fat list and shuffle it, which is the first thing any freshman would think of. The sequence is long as fuck. It can go up to a million.
>>
>>59060855
Roll 2 dices
>>
>>59060855
What do you mean pairs? Why aren't you just calling it twice?
>>
>>59060855
>number
That's awfully specific.
>>
>>59060877
Basically the idea is to randomly pick a pixel in an image, but never pick the same pixel twice.
>>59060869
That causes repeats.
>>
>>59060880
Create a deck shuffler for 52 cards.
Shuffle 2 decks.
This will not cause repeats
>>
>>59060898
I mentioned that solution already. I could easily generate a list of all pairs and shuffle it in O(n log n) time, but I'm sure there's a better way.

In cryptography it's possible to have an O(1) psuedorandom unique sequence generator, because all you're really doing is making each number map to another in a one-to-one relationship.
>>
>>59060880
>That causes repeats.
How do you figure
>>
>>59060905
I think he means he rolls 1,2 for the first roll and rolling it again could come up with a second 1,2 which he isn't allowed.
>>
>>59060905
If you don't back it with a bool table, it can generate repeats, but if you wait until you get a unique number, the result of the function is non-deterministic. It's better to just shuffle, but I would rather avoid that, because it's somewhat brute-force.
>>
>>59060855
Method 1:
1. Generate random tuple
2. Add it to hash table if it's not already in there
3. Repeat until the hash table has X entries
>>
>>59060880
This is basically a basic tic-tac-toe random AI problem, you're going to need a list or you're going to get repeats. So your options are either make a list of the numbers picked and reroll (which becomes a problem if it continues for a large enough chunk of the sequence), or make a list of all the numbers in the sequence and remove the picked ones.

Of course, that's assuming there's some technique I don't know (which there probably is).
>>
>>59060944
That sucks. So my choices are to either use a random function that theoretically may never return, or to waste a shitload of memory?
>>
new thread

>>59060949
>>59060949
>>59060949
>>59060949
>>59060949
>>
File: tcv80ipepkza7.jpg (28KB, 508x298px) Image search: [Google]
tcv80ipepkza7.jpg
28KB, 508x298px
>>59060953
Or you could go the Debian way.
>>
>>59060953
As far as I'm aware, yes.
But keep asking around, there are anons a lot smarter than me here.
>>
>>59060953
>theoretically
PRNGs are guaranteed to visit each possible number at least once (and ideally exactly once) meaning that unless you need more tuples than the PRNGs range it's guaranteed to terminate. And if you're worried whether pulling two numbers out of it will screw with that rule then just interpret a huge number as two smaller ones.
i.e. 54950045 is [5495, 45].
>>
>>59060731
Darn I knew it was something like that, I just had a shitty implementation
>>
>>59061005
>PRNGs are guaranteed to visit each possible number at least once
No?
Thread posts: 380
Thread images: 30


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