[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: 335
Thread images: 37

File: caml-inria-fr.128x58.png (3KB, 128x58px) Image search: [Google]
caml-inria-fr.128x58.png
3KB, 128x58px
What are you working on?
Old thread >>55957258
>>
File: jgjhghjg.webm (2MB, 1440x900px) Image search: [Google]
jgjhghjg.webm
2MB, 1440x900px
Learning about /proc
I made this "BeOs like" CPU Monitor just reading data from "/proc/stat"
It looks cool imho
>>
>>55967224
>still no hkts
>>
>>55967241
desktop not riced enough
>>
Learning Rust.
Go a shit.
>>
>>55967241
Shit now, I have to download the integral of Evangelion and watch it. I hate you anon.
>>
>>55967287
integral?
>>
>>55967305
The entirety, the whole set... Poor translation. Sorry.
>>
File: 1468966676063.jpg (22KB, 429x451px) Image search: [Google]
1468966676063.jpg
22KB, 429x451px
I got called a Lisp Weenie today in class by my professor
>>
>>55967337
What was the context?
>>
File: 1384355872581.jpg (83KB, 466x365px) Image search: [Google]
1384355872581.jpg
83KB, 466x365px
Is it possible to create a memory leak that persists even after the application has closed?
>>
>>55967337
oh my fuck
the force is strong with this one
what did you do?
>>
>>55967364
Yes on Windows millenium.
>>
>>55967364
Don't think so, at least not if your OS is doing its job.
>>
>>55967364
Write a kernel space program
>>
>>55967337
FP BTFO
>>
>>55967354
>>55967371
The professor went around the room asking what our favorite languages are and I said Common Lisp and he replied with "Oh a Lisp Weenie" and everyone laughed.
>>
>>55967337
>first day of CS classes
>prof is using something called "emacs"
>stand up
>call him a macfag
>walk out
>>
>>55967392
Did he tell yall what his was?
>>
>>55967451
C++
>>
>>55967337
OMG I WAS THERE
AHAHHAHAHAH
>>
>>55967490
>>55967337
Looks like you revealed your power level
>>
>>55967392
kek

it's an oldfag meme if you didn't know
>>
>>55967458
your prof a shit
>>
>>55967529
C++ and java are literally the best languages
>>
>>55967337

Are you a lisp weenie? I'm pretty sure that specific admonition only occurs here, so your professor must browse.
>>
>>55967555
pls stop the bully
>>
>>55967588

Just curious if it were true, bud.
>>
>>55967555
maybe >>55967490 is the professor
>>
>looking up random shit
>stack overflow example of python
>CLASS every fucking time even for tiny code
Why do these idiots do it?
Why?
self. everywhere for no reason
it makes everything look so ugly and complicated
>>
>>55967791
OOP habits I suppose

I don't really like it either, it seems not needed to have an object for a thing that can just be a function
>>
anyone knows / has examples on how to visualize sound ? preferable c and/or c libraries.
i know next to nothing about that topic and couldn't find any info on it
>>
>>55967337
newfag here, what does that mean?
>inb4 lurk more
>>
>>55967553
... for pooping on.
>>
>>55967977
>look mom i meme'd again!
>>
>>55967337
Stupid trump frogposter

>>55967791
>python
You got what you deserved
>>
>>55968003
>माँ मैं फिर से एक इंटरनेट तर्क जीता देखो
>>
>>55968016
>>55968003
>>55967977
good posts
>>
>>55968020
>!nv.0k6WoTc
>being an authority on the qualities of programming languages
kek
>>
>>55967791
Because it makes code reusable? You'd understand that if you weren't a worthless code monkey, and a terrible one at that.
>>
File: terry.jpg (65KB, 1123x681px) Image search: [Google]
terry.jpg
65KB, 1123x681px
>>55967224
>What are you working on?
Nothing at the moment, watching Terry's latest livestream vod.
>>
>>55968170
functions are more reusable than objects
>>55968104
i am
>>
>>55968170
>python code
>reusable
>>
>>55968175
possible future minus being as good a programmer
>>
>>55968175
I don't get the pic. Is it a Bible joke?
>>
Did anything ever come of this?

https://archive.rebeccablacktech.com/g/thread/S51218729#p51219168
>>
>>55968191
>functions are more reusable than objects
Blanket statements like this are pointless unless we see the code anyways, if the original anon wants to link the stackoverflow post that triggered him.
>>
File: terry2.jpg (78KB, 1122x719px) Image search: [Google]
terry2.jpg
78KB, 1122x719px
>>55968208
>I don't get the pic. Is it a Bible joke?
Apparently, this one was something about "jewish jokes"
>>
>>55968209
looks disgusting, like it's made specifically for console i/o but with no advantages even for that
>>
>>55968221
no, it's objectively true. you can reuse any function as an object method
>>
>>55968209
No because it's fucking dumb.
>>
>>55968233
>in one of his streams he flipped out over the yapping bird
>the bird is nowhere to be heard
What did he do to it?
>>
>>55968263
the class ties everything together, the class can contain a whole system of several related methods which act as functions and the class also contains the data structures
>>
>>55968241
if you werent even in the thread, why are you replying?
>>
>>55968263
When you said "objects" I thought you meant "classes" but now I see you're just retarded. He was arguing that a class was unnecessary in that case which might be true, you're just twisting the argument into a retarded domain.
>>
>>55968329
what does it matter?
>>
>>55968337
What do you matter?
>>
File: challenges.png (905KB, 8889x5000px) Image search: [Google]
challenges.png
905KB, 8889x5000px
>>
>>55968307
and you can make a free function operate on the class itself (as a method) in one line of code if it's well written
>>55968332
>When you said "objects" I thought you meant "classes"
classes are objects.
>He was arguing that a class was unnecessary in that case which might be true
then why did you get mad when i said it wasn't?
>you're just twisting the argument into a retarded domain.
no. unless there's a reason that you have to define that function as a method (which according to the original post there isn't) then it's always more reusable to leave it separate from the class. you're the one trying to twist the argument by saying im wrong because you're too dumb to grasp my terminology
>>
File: a language you can't believe in.png (211KB, 638x592px) Image search: [Google]
a language you can't believe in.png
211KB, 638x592px
/rust general/ - embedded edition

This is Rust General, embedded in the DPT. All posts for rust general should quote this post so they can all be linked together.

https://doc.rust-lang.org/stable/book/
>>
@55968455
Fuck off
>>
>>55968438
If you have a function it's equally reusable as a method or as a unbound function. Your "objects are less reusable than functions" makes literally no sense.
>>
>>55968479
>or as a unbound function
you can't call it if it's unbound.
>>
File: 1446943989390.png (22KB, 1191x324px) Image search: [Google]
1446943989390.png
22KB, 1191x324px
>forgot this gem from november
I must've been pretty drunk
>>
>>55968602
>auto auto auto auto auto auto
Just stick to javascript or python.
>>
>>55968438
in a non-trivial piece of software you will have functions/methods that are quite specific and not very reusable by themselves. sometimes you may have a reusable function and sometimes you may have a reusable class.
>>
>>55968633
Auto isn't dynamically typed you idiot
And they're C++ lambdas, you have to use auto because they create anonymous classes
>>
>>55968633
Jesus christ, this is why I stopped coming to /dpt/ and /g/ in general.
>>
>>55968823

It was almost better when it was just full of C shitters.
>>
C++

>using size_type = map<string const, T>::size_type;
this gives
>error C2061: syntax error: identifier 'size_t'
>note: see reference to class template instantiation 'class<T>' being compiled
but compiles if i replace T with some type like int or whatever

not sure why, things like this work
>using value_type = pair<string const, T>;
>>
>>55968871
include cstddef or stddef.h
>>
>>55968417
You're missing about 100 challenges
>>
>>55968867
Nah, as long as there was this language elitism (so pretty much always) it's been shit. It's crazy how some people just have to feel superior to others.
>>
>>55968901
i have cstddef already
>>
>>55968961
Haha yeah fuck those people who feel superior
>>
>>55968961
>language elitism
it's just memes
>>
http://www.strawpoll.me/10939705

>>55968867
>almost
it was a thousand times better
and c weren't the only ones to go
>>
File: 1469733595081.jpg (179KB, 512x512px) Image search: [Google]
1469733595081.jpg
179KB, 512x512px
Is it really possible to get a job in software development without a degree? Anime unrelated.

Suppose that, if I got a CS degree, it'd be from an obscure state school. Would it be worth it?
>>
>>55969046
>Anime unrelated.
It's impossible for you because you felt the need to post your pic with your question to draw attention to the question.

Get fucked
>>
>>55969040

You are undoubtedly a C shitter, so I suppose you don't realize how bad it was.
>>
>>55969112
I don't use C and don't know more than 2 printf %s
>>
>>55969112
just look at the archives from 2015
you can see how much better /dpt/ was
>>
>>55969040
Where did this exodus of users end up?
>>
>>55969158
I don't know
I want to be with them
>>
>>55968871
template <typename T>
using size_type = map<string const, T>::size_type;
>>
>>55969046
Take everything I say with a grain of salt, because I'm a sophomore compsci student at a somewhat obscure state university and have no work experience in the tech industry.

If you plan on getting a job without a degree, make sure you've done something to be competitive against people who've actually done a degree program. Publish an app or make a significant contribution to an open source program.

The obscurity of the school probably isnt too much of an issue. Make sure it has regional accreditation (if its a state school it should) and still do all the stuff you would do to get noticed if you didn't have a degree, because degrees aren't magic job fairies.
>>
>>55969158
rettit
>>
>>55969046
Depends on your social skills but judging by the pic I'd say no, it's not possible.
>>
>>55969021
python and js are genuinely shit and belong in >>>/g/wdg
>>
File: D.jpg (42KB, 512x512px) Image search: [Google]
D.jpg
42KB, 512x512px
>
>>
>>55969158
israel
>>
>>55967241
what kind of heathen robs us of cruel angels thesis with no apology?
>>
>>55969003
You can feel superior when it comes to race or economic status, but if you have to use your choice of programming language (not even your fucking skill level) as your source of superiority (like this faggot here: >>55969230), you just sound pathetic.
>>
>>55969255
not him, but are you retarded?
>>
>>55969255
I'm not a language supremacist but I detest Python.
>>
File: 1470608007928.jpg (61KB, 680x735px) Image search: [Google]
1470608007928.jpg
61KB, 680x735px
>>55969233
You better hand over the manual memory management Andrei
>tfw not good enough at PS to put someone else's face on this picture who would be more relevant
>>
>>55969294
I think you are. Why do you detest python?
>>
>>55968175
Who the fuck is Terry?
>>
>>55969298
>tfw u dnot own PS btu ppl w/o int do
>>
>>55969306
leave newfag, and don't come back (for your own sake)
>>
>>55969306
A batshit bonkers schizo religious nut, who also happens to be a near if not genius level programmer.
>>
merge :: Ord a => [a] -> [a] -> [a]
merge xs [] = xs
merge [] xs = xs
merge xs ys = if hx < hy then hx : (merge tx ys) else hy : (merge xs ty)
where hx = head xs
hy = head ys
tx = tail xs
ty = tail ys

msort :: Ord a => [a] -> [a]
msort [] = []
msort xs | length xs == 1 = xs
| otherwise = merge (msort (take first_half xs)) (msort (drop last_half xs))
where first_half = length xs `div` 2
last_half = (length xs `div` 2) + (length xs `mod` 2)


I don't know why, but it seems like writing shit in Haskell is more intuitive than other languages. It just werks most of the time.
>>
>>55968175
>vod
Jesus Christ, just call it a fucking video.
>>
File: 1424895242657.jpg (51KB, 396x385px) Image search: [Google]
1424895242657.jpg
51KB, 396x385px
>grad 4 months ago with masters in CS
>by the end of it I hated programming
>only simulations really caught my attention anymore and even then group projects ruined it since it was always a carry the other guy episode
>barely programmed since I graduated


I'm not sure how to feel about this
>>
>>55969253
Im sorry anon , here you go
https://www.youtube.com/watch?v=omLgv9lJ9jE
>>
>>55969358
>but it seems like writing shit in Haskell is more intuitive than other languages
I still can't read any Haskell code.

Perhaps I should read a book on it rather than just trying to infer the meanings of things.
>>
>>55969371
>>by the end of it I hated programming
So you never actually liked programming did you?
>>
>>55969358
anon pls this is what patterns are for
merge :: Ord a => [a] -> [a] -> [a]
merge xs [] = xs
merge [] xs = xs
merge (x:xs) (y:ys) | x < y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys



>take ..., drop ...
use splitAt

>>55969399
post code and i will explain
>>
>>55969463
I'm new to Haskell, forgive me senpai ;_;
>>
>>55969484
i forgive you

(x:xs) matches a list with at least 1 element, the head goes into x and the tail into xs

you can also use
var@pattern
this will decompose the variable into the pattern but also keep the whole thing in the variable, e.g.
xl@(x:xs)

x is the head, xs the tail (and it only matches if there's at least one element), and xl the whole list
>>
>>55969423
I did, the only reason I went for CS was because I enjoyed programming throughout high school and was recommended that in that direction. It was only really after my juror year that it started becoming a drag.
>>
>>55969516
That's useful, thanks for the tip
>>
>>55969206
Thanks for the legit advice, friend.

I'm mostly concerned about student loan debt. I like the university experience but it is so fucking expensive.
>>
>>55969594
Join the National Guard.
>>
>>55969594
>I'm mostly concerned about student loan debt.
vote trump then
>>
>>55968867
>It was almost better when it was just full of C shitters.
Peak /dpt/ was when it was full of LISPers, we had daily Scheme generals, and people working through SICP together. I think a lot of those people went to lainchain, but that place is terribly slow.
>>
>>55968652
only if you write bad code. you should keep separate things separate
>>
>>55969636
a lot of them just got sick of image boards in general I think
>>
>>55969612
>Join the National Guard.
If you're diagnosed with something like clinical depression they won't let you join any branch of the military.
>>
>>55969628
r u shitten me

Trump is the guy who seems most likely to simply abolish the FAFSA and tell potential students to pull themselves up by their bootstraps.
>>
When the OS does a context switch of a process running to another one, does everything in the pipeline get thrown away or does it let remaining instructions execute and then store that context and bring in the new one?
>>
>>55969716
lmao how did you let them diagnose you, just lie
>>
>>55969636

But lisp is for lisp weenies.
>>
>>55969705
desu I'm kinda sick of the kind of rampant shitposting that goes on here. Is it really any better elsewhere?
>>
>>55969716
Everyone lies when enlisting.

Seriously join the guard, you get $200/month in drill pay, cheaper credits at a lot of universities, and they help pay your tuition.
>>
>>55969744
It tosses it. the OS doesn't have that kind of fine-grained control.
>>
>>55969791
>>55969744
Not to mention say this was a syscall to an atomic primitive.
>>
>>55969046
Internships yes. You can land some really good internships that will almost always lead to a full-time job, and most IT/CS internships are paid (I got 20$ an hour at mine, it practically was a full-time job except I got paid hourly instead of by a salary).

Like this anon said >>55969206 be competitive. I made a few apps because windows phone has no apps :^) but I also had a portfolio website using some fancy JS libraries, I worked on some emulators back when I frequented emu general on /vg/, I made some little music apps on Arch because I was bored one week and I applied to a metric shit ton of jobs before I even landed an internship.

If you're not looking to get a degree at all you'll have to go a little beyond, maybe even set up your own little freelance business, nothing major, just to have some legit experience you can put on your resume and a company name to label it with. Also open-source projects go a long way, if you've contributed a lot, they can practically be a substitute for a "I worked at such-and-such as a part-time Software Engineer". Once you get that first job that you can put on your resume, you're set
>>
>>55969516
You're learning Haskell? Why haven't you done H-99?

https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems

These will get you really comfortable with the syntax and patterns
>>
>>55969760
>lmao how did you let them diagnose you,
Because I was trying to get pills and help to fix my life, and I wasn't considering joining the military because I was a very antiwar at the time.

>>55969788
>Everyone lies when enlisting.

Ahh, alright. Sounds like a good deal. I'll look into it further.

>>55969836
Thanks for the advice, I'll consider it.

Unfortunately no opportunities for internships exist in my area and I don't have the budget to move, however I could maybe shenanigans it a little if it's a paid internship and I'd be paid enough to live.

I've already contributed to open source projects a little bit, I'll do more of that (rather than hacking away at my own game development projects that I will never ship).
>>
>>55969885
they're a clone of lisp 99 problems and they don't all transfer well
>>
File: 1463696945268.png (25KB, 396x400px) Image search: [Google]
1463696945268.png
25KB, 396x400px
>>55969807
>>55969791
How does it know what instruction was the last to actually finish execution then in a modern super pipelined cpu whose counter would be several instructions ahead of the actual last one finished?

Or does a modern OS give the CPU say ~200 instructions followed by a syscall so that it knows exactly how many it went before the switch?
>>
>>55969628
>vote trump then
There are tons of reasons to vote trump but I don't see this one at all
>>
>>55969906
He's learning the basics of Haskell, not the underlying meta
Dude doesn't even know about (x:xs) cmon
>>
I'm rewriting some code to go from raw pointers to smart pointers and for the life of me cannot get smart pointers in C++ into pairs.

What am I doing wrong?
    unique_ptr<Node<T>> ptr(new Node<T>());
pair<string, unique_ptr<Node<T>>> pair;
pair = std::make_pair("test", make_unique<Node<T>>(new Node<T>()));


I've tried like 10 different variations.
>>
>>55969904
Oh I don't mean like games, more utility stuff. The app I made for instance scans bar codes on game cases and catalogues them for you, also lets you buy some similar games on Amazon. You can even make a handwritten dictionary recognizer, that shouldn't take more than a month to make and ship and sounds awesome on paper if you know to phrase it.
>>
>>55970116
I think you have the argument for make_unique wrong. Unless Node<T> has a constructor taking a Node<T> pointer that's not going to work. You should pass make_unique the same arguments you would pass to the constructor. So if you want new Node<T>(), it's equivalent to make_unique<Node<T>>(). If you want new Node<T>(1), it's equivalent to make_unique<Node<T>>(1), etc.
>>
>>55970140
>You can even make a handwritten dictionary recognizer
what is that
>>
>>55970184
Instead of typing the words using a keyboard, recognize each letter using OCR. If you know a pictographic writing system like Kanji you could do that too
>>
>>55970263
how old are you?
>>
>>55970263
Do you know how convolutional neural networks work? If so then this is easily doable. If not, you've got a fuckton of reading to do.
>>
>>55969907
>whose counter would be several instructions ahead of the actual last one finished?
It doesn't inc the counter until the op is finished, that's how. Running an op is transactional.
>>
Number of elements in a two-deep array of constant depth:

one-based arrays:
array.length * array[1].length

zero-based arrays:
(array.length + 1) * (array[0].length + 1)


thoughts?
>>
Writing the README and some comments/documentation for my backlight manager for X11.

It can be used plainly like xbacklight (except this supports the sysfs interface too), or like an adaptive daemon.

Adaptive has various modes:
- desktop: it saves the backlight value set for the currently active desktop, this works well when you have different workspaces that require a different backlight setting
- window: it does the same for desktop, except it's based on the active window's WM_CLASS, first it tries the instance name, then the class name.
- luminance: it uses MIT-SHM and DAMAGE extensions to calculate the luminance of the screen contents in an optimized way, then it saves the backlight value you set with the luminance value of the screen contents, and based on the current luminance of the screen it interpolates the two enclosing values so it does a nice fade

Feels good man.
>>
>>55970410
what
>>
>>55970389
So are there then two counters then? One for official pc (ie next one to finish) and then another pc for keeping the pipeline going?
>>
>>55970359
22

>>55970373
Yeah but either way, it's not that hard. Once you know what to do it is pretty easy to actually do it. All of the "hard" work is getting a good training set and training it. Once that's done from that point it's just building a good tree searcher

Actually for most utility apps the hardest part is getting a good looking and fast UI
>>
>>55970421
>backlight manager
what do you mean?

backlight for windows?
>>
>>55970461
Backlight as in laptop's backlight, you know, the display brightness.
>>
>>55970451
>22
i'm 20 years old. what do recommend to be as good as you?

do you have a college degree?
>>
File: 1414018485744.png (195KB, 400x388px) Image search: [Google]
1414018485744.png
195KB, 400x388px
>reading through online tutorial
>example code doesn't compile
>>
>>55970511
If I were to write tutorials I'd do that on purpose. Go fix it.
>>
>>55970447
The interface and implementation of any sufficiently complicated architecture (like x86) are so radically different, you just have to accept the interface as a standard and let the implementation be whatever it will be.

Yes, the interface says the PC is incremented when an operation completes, so the interpreter is always in a valid state for saving the PC and doing PC offset jmps. Dumping the registers and restoring the registers will always put you in the same state sans any memory side effects, the interface guarantees that.
>>
>>55970540
Might not be a bad idea if the syntax or error messages had some inherent logic to them, but when you're just trying to figure out how to use a library and move on with your life it's a real pain in the ass
>>
>>55970551
ic

>sans any memory side effects

Does that mean if there was a read then write op to some address in the pipeline it could leave us in a corrupted state?
>>
>>55970444
He wants you to proclaim the superiority of 1-based array indexes
>>
>>55970586
No. The pipeline is invalidated, all operations' transactions are cancelled. If the read operation completed and the write was in the pipeline, then there was a context switch, that read op is lost until the context is switched back. That is a data race, that's what atomics are designed to resolve.
>>
>>55970540
Found Zed Shaw
>>
>>55970484
I have a bachelors CS, working on my masters only because I have a few ideas for some 3D lighting models I think could really help the field. To be "as good as me" shouldn't take you much since I'm not that good.

I went through some MIT opencourseware courses on machine learning, and took the Coursera course as well, I also spent a lot of my free time over sophomore summer working on a 3D game engine because I wanted to see if it was possible to do something like Unity in C++ (it's a pain, but not much feels better than getting a 10K cpp into a 8K dll). I read a lot of blogs from people whose programming level I might never reach, and I was proactive in taking courses I hadn't yet. I also read a lot of scientific articles on 3D graphics and lighting and AI, I built a robot drone a while back, etc.

So I'd say, be proactive. Actually go out and make things instead of reading about it all day long. I mean, I don't touch that robot drone, but I'd know nothing about AI and machine learning if I didn't actually build it because a lot of the things you will end up searching for won't cross your mind until you get to that point in an actual project. But most of all, scientific articles are the shit. Learn how to decipher them and how to turn a method into an actual program, you'll automatically be 1 step ahead of your peers. That's all I got, sorry if it's not all that helpful, like I said I don't really think I'm that good at all
>>
>>55970656
oh... but the length is the same with zero-vased indexing, don't need the +1
>>
>>55970410
array[offset1 - offset2 + 1]
>>
>>55970660
thanks for all the help, im ready to make the next temple OS now
>>
>>55970660
>that read op
that write* op
>>55970781
pm me
>>
File: g_info_graphic.png (2MB, 3840x2160px) Image search: [Google]
g_info_graphic.png
2MB, 3840x2160px
test
>>
>>55970874
Dude what the fuck how is "Shazam" only "medium" while "Design an esoteric language" is "hard"? One of those should be "easy" and the other should be "fuck you" or difficult at the very least. This whole list is shit.
>>
File: 1447472422862.png (194KB, 382x597px) Image search: [Google]
1447472422862.png
194KB, 382x597px
>>55967791
>searching how to do something that I don't quite have the solution for in C++
>check the stack overflow results
>accepted answer with 300 upvotes
>no explanation of the solution
>no explanation of the algorithm
>just "use boost lol"
WHY IS THE ANSWER ALWAYS INSTALL THIS MASSIVE LIBRARY JUST TO USE 1 FUNCTION FROM IT
>>
>>55970874
>v4.0
i never saw the v3.x
>>
>>55971106
post link to such stackoverflow question, I'm curious
>>
>>55971106
Because you're using stackoverflow. SO is known for that.
>>
http://www.strawpoll.me/10923859

kek 'no' is overtaking 'yes'
>>
File: file.png (5KB, 92x323px) Image search: [Google]
file.png
5KB, 92x323px
post your loc dicks
>>
>>55971144
>no "thats my fetish" option
dropped hard, made by close minded bigots
>>
>>55971159
>windows
You should not be in these threads.
>>
File: 1470354509492.jpg (34KB, 548x782px) Image search: [Google]
1470354509492.jpg
34KB, 548x782px
>>55971178
still, here I am and there is nothing you can do about it, nerd
>>
>>55970874
>122. Design a game engine in unity
>Design an image editing application in paint
>>
>>55970874
the difficulties are fucked, how is 22 even remotely on par with e.g. 94/95/99/112
>>
>>55971120
http://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c
This one is the most goto one I have because I really remember it from my first days of starting c++. Using std::string::find is a mostly ok suggestion, but the same poster immediately just suggest go use Boost because it has a bunch of other shit in it. The next post is also use boost, and the third post is using strtok with cstrings, which isn't completely bad but if your program is converting between std::string and cstring like 20 times it's going to look horrible.

and fuck look at the includes in the 5th or 6th answer which has 76 upvotes
#include <string>
#include <vector>
#include <iostream>
#include <istream>
#include <ostream>
#include <iterator>
#include <sstream>
#include <algorithm>

Like jesus man.
>>
>>55971331
looks shorter than the list of imports on a typical haskell module
>>
>>55971331
>86 upboats on comment
>I can't believe this routine task is such a headache in c++
>string manipulation
>routine task
pajeet...
>>
>>55971474
It absolutely is depending on the domain you program in.

>>55971397
Yeah but for splitting a string? Surely it won't be as bad...

>Search for "string split haskell" gives this:
http://stackoverflow.com/questions/4978578/how-to-split-a-string-in-haskell
>first answer is "install this library"
>look at source of said library
> http://hub.darcs.net/byorgey/split
>literally thousands of lines
>>
>>55971525
>http://stackoverflow.com/questions/4978578/how-to-split-a-string-in-haskell
second answer is to magically find some similar function and alter it slightly, instead of writing it yourself

fucking haskell
>>
File: 1414780135945.png (15KB, 515x482px) Image search: [Google]
1414780135945.png
15KB, 515x482px
Why do most languages have Int but not Nat, even though naturals are more fundamental than integers? It's sort of a pain having to check for negative numbers when you don't want to include them
>>
>>55971595
What is an unsigned int?
>>
>>55967224
what is the best language to use if i want to learn about robotics?
>>
>>55971605
>0
>natural
>>
>>55971595
unsigned integral types are a thing in most languages. They include 0 if that's your issue.

>>55971580
Funnily enough the most constructive one is the suggestion to use Regex.
>>
>>55971595
>naturals
>can't do 5 - 6 + 2 without underflow issues
>>
>>55971595
Unsigned ntegers are more fundamental to the computer than naturals
>>
>>55971648
That would work fine. The proceeding overflow would undo the underflow
>>
>>55970874
Maybe come up with a version where most of the challenges don't take days to do, or take out the short ones
>>
>>55971724
If it's truly a Nat type, it will have no upper bound and you will just have an error.
>>
File: 1442190675946.png (84KB, 599x717px) Image search: [Google]
1442190675946.png
84KB, 599x717px
Any good book on perl. I know the basics and I really really it. A scripting language with c-syntax is always a good thing, imo
>>
>>55971945
that error is called an integer overflow
>>
>>55971976
What will be the result of 3 - 4, and why would adding 4 again fix it, assuming these were unbound Nats?
>>
Meterpreter shell
>>
>>55969778
IRC maybe? telegram groups are kinda fun too
>>
>>55972000
the result of 3-4 would have a binary representation of 11111111... for however many bits you have, adding 4 would overflow it back to ...00000011. We can't assume they are unbound because this is computer science not science, thus it's proven fact that the machine representation is bounded. The error IS the overflow and underflow, if you mean that an exception is raised and terminates the program, that's for the implementation to do.
>>
>>55972000
>>55972084
you're talking about different things, for ordinary unsigned ints then yeah the underflows and overflows cancel out, but for a 'nat' which would be a bigint > 0, then 3-4 would probably generate some kind of error like an exception or give an invalid value like NaN
>>
need some help, begginner in c++

how do i obtain data from a web site and use it in my program? im trying to build a currency converter that looks up the data in the web only if the previous data is over 24 hours
>>
>>55972084
You can have a Nat type that would be unbounded given infinite memory, in the same sense that programming languages can be turing complete. A bounded unsigned type is not Nat, it is Z mod some number
>>
Is anyone good with python threading?
Every time I try it turns into a huge fucking mess.
Want to add threading to small project for me?
>>
>>55972177
>python
>a huge fucking mess
sounds about right
>>
File: 1452514664065.jpg (56KB, 1280x720px) Image search: [Google]
1452514664065.jpg
56KB, 1280x720px
>>55967224
>while loop doesn't work in C++
JUST
  real_num tol = 0.0001_r;
real_num no = N + 4*tol;
real_num nt = N;
real_num Ndiff = abs(no-nt);

while(Ndiff > tol)
{
/* code */
}

I've put print statements everywhere inside the code and it never prints out anything inside the while loop.
JUST
>>
>>55972216
Just threading, senpai.
http://pastebin.com/hXCz98tB
Wat do?
>>
>>55972265
Probably should remove
boards = ['b']

Was there for testing.
>>
>>55972173
I believe the original question of this discussion is why languages don't have nats, but sure if we just speak of a hypothetical machine with infinite memory we can abstract everything into being possible.

>>55972245
Did you check if Ndiff is actually greater than tol before the check? as well, why did you typedef float/double into real_num?
>>
>>55972265
i'm pretty sure OOP and threading in python are truly fucked, at least compared to other languages
>>
>
>>55971974
Anyone?
>>
I've decided to embrace the meme and learn Haskell, and by golly, I'm glad I did so. It feels so limitless and compact.
>>
>>55972265
>doesn't pass p
>splits 3 different times
>>
File: lena.png (465KB, 512x512px) Image search: [Google]
lena.png
465KB, 512x512px
Programming challenge:


Write a program that flips a random bit in a file.

>>
>>55972265
you could try in >>>/g/wdg
>>
>>55972330
That's not really a challenge, but I'll do it probably
>>
>>55972300
I mean that you can implement, in real programming languages, a data structure representing unbounded naturals. The only limit to it would be a memory allocation error when it ran out of memory.
>>
File: 1449652636587.jpg (55KB, 1280x720px) Image search: [Google]
1449652636587.jpg
55KB, 1280x720px
>>55972300
Ndiff = abs(nt-no) = abs(4*tol) = 4*abs(tol) = 4 * tol > tol

nt AND CORRESPONDINGLY Ndiff GET UPDATED IN THE WHILE LOOP
>JUST
JUST
>>
File: python-functions.jpg (91KB, 984x871px) Image search: [Google]
python-functions.jpg
91KB, 984x871px
Is there a way to automatically generate something like this for code?
Preferably python or C++.
>>
File: programming challenges 3.0.png (1MB, 3840x2160px) Image search: [Google]
programming challenges 3.0.png
1MB, 3840x2160px
>>55971115
>>
>>55972059
>telegram groups
>democratic by design
Famous last words.
>group limited to 200 members
Wow, a measure of insight.
Seems like you need to know people in advance to setup a community though.
>>
>>55972487
This is really bad way to explain python function dood
>>
>>55971974
https://shodan.me/books/Programming/Perl/
>>
File: flipped_lena.jpg (29KB, 512x512px) Image search: [Google]
flipped_lena.jpg
29KB, 512x512px
Horribly inefficient solution

iota[l_] := {Range@Length[l], l} // Transpose;
flip[l_] :=
Module[{i = RandomInteger[{1, Length[l]}]},
If[#1 == i, BitXor[#2, 1], #2] & @@ # & /@ iota[l]];
flipFile[s_] :=
Import[s, "Bit"] // flip // Export["flipped_" <> s, #, "Bit"] &;


flipFile["lena.jpg"]
produces the attached image
>>
>>55972554
I want something with an actual map, though.
¯\_(ツ)_/¯
Obviously wouldn't have that stuff.
>>
>>55972487
it couldn't possibly know what arg1, arg2 etc mean without you filling it in manually
>>
>>55972573
something like this?

http://stackoverflow.com/questions/6167266/generate-uml-class-diagram-from-java-project
>>
>>55972580
It would make the map while the program is running/ended, right?
I don't know if such a thing even exists. Why I'm asking.
>>
>>55972543
>>democratic by design
there are group admins
>>group limited to 200 members
look into supergroups, they're much better than normal groups anyways
and you can create custom invite links so you can invite people from /g/ or something. either way I've met a ton of people on Telegram who I didn't know before hand so it's not that important to know anyone when you set up a community
>>
>>55972487
Variable `ratval` was not defined in that scope
>>
>>55972607
>so it's not that important to know anyone when you set up a community
I mean you'd have to know people to set one up of reasonable size, or just go around advertising it. So is there a /dpt/ or /prog/ group?
>>
>>55972594
Something like that, yeah.
>>
What project on your resume do you think benefits your resume the most?
>>
>>55972562
>https://shodan.me/books/Programming/Perl/

Thank you :)
>>
>>55972735
a commercially successful product
>>
>>55972735
A programming language I designed and implemented.
>>
>>55972700
there's @letstalkprogramming but someone added a shit ton of Indians who don't speak English. there are a few /g/ groups but none of them are specifically about programming.
>>
>>55971630
Whether or not 0 is natural is entirely subjective
>>
>>55971595
Make your own class :) If you did it in a cool language like C++, it wouldn't even be a hassle to use.
One question though: What would you do if someone did "Nat n = 0;"? Would it overflow to maximum value for Nat?
>>
>>55967241
>2014+2 I still don't have an EVA
>>
>>55972854
>>55972875
>can't into the peano axioms
plens pls
>>
>tfw i'm literally too dumb to understand async network programming in C#
Should I just move to India?
>>
>>55972905
Yeah, they'll teach you
>>
>>55972905
https://msdn.microsoft.com/en-us/library/fx6588te(v=vs.110).aspx
>>
>>55972916
BTFO
>>
Lads, I am having disabling stomach pains right now and I know it's because I'm dehydrated and a monster shit is coming. What can I do to speed this up? I can barely stand.
>>
>>55972905
but it's not hard at all

what seems to be the problem
>>
>>55972924
Man I thought I was the only one that had that shit. Honestly I'd just grab my 3DS or laptop and sit on the toilet. Usually it's to debilitating to do anything, though. Godspeed anon.
>>
>>55972895
>peano axioms

Nat = 0 | (+1) Nat

0
>>
>>55972918
Async as in async/await. Besides this isn't nearly half of it. This just replies back to the client that sent the message, what if you want to relay it to another (multiple?) clients? Then mix in threads and all sorts of other nastiness.

>>55972938
Not sure, I just can't visualize the execution flow at all.
>>
>>55972892
Man I fucking want an Eva, where can I get one?
>>
>>55972735
An inclusivity and automatic trigger warning system.
>>
File: 1448232235863.png (532KB, 602x699px) Image search: [Google]
1448232235863.png
532KB, 602x699px
>>55972895
You do know that the construction of N from empty sets isn't part of the Peano axioms right?Peano axioms only defines the successor function and the principle of induction. It's a model of arithmetic on N, it has absolutely nothing to do with the construction of N or whether 0 is in it.
The only difference it makes is that N_0 is a monoid whereas N isn't, but I doubt you know what this entails.
>>
>>55973030
it means you can use N_0 in hadoop but not N
>>
>>55972924
Eat more fibre.
>>
>>55972975
imagine two guys on a telephone sitting in two separate rooms

it's like the most obvious abstraction

once you sent async request -- your method should either stop or only execute other things that don't rely on the result of that request

from that sender's point of view that asynchronous request went into the black hole and it can't never know what happened to it

then, "on other side of a city" callback method wakes up when request gets a response or fails, it analyzes the response and reacts accordingly. note that it is in a separate environment so you have to recreate your DBContext and other ORM things from scratch for callback method
>>
>>55971595
>What are unsigned integers
>>
>>55971595
{ x : Nat | x >= 0 }
>>
There is literally no reason to ever use a linked list instead of a vector.
>>
>>55973217
whoops

{ x : Integer | x >= 0 }
>>
>>55973220
how about
(X+Y) / 2Z
>>
Where are my stats bros at?

So I have a bunch of recorded data. 3 arrays, of which each index corresponds to each other:

>X, a recorded value taken from the real world
>Y, a mathematical prediction of what X should be
>Z, a number relating to Y, following some sort of exponential function, where higher Z means X will be lower.

How do I go about figuring out how to use Z and Y together to more acurately predict that Y will be? Right now I'm using:
correctprediction = (Y(i) * (1 / (Z(i) ^ S)))


Where S is just random numbers I throw in to see which gets me closest to a correct prediction. Is there a better way?
>>
>>55968455
Why do Rust posters have to do this in EVERY thread?
>>
>>55973279
>EVERY thread
I just brought back a dead /dpt/ meme from November faggot
>>
>>55973105
This much I can understand, the theoretical part is fine. It's more implementation details. Like what exactly runs in other threads, as background workers, as tasks... where the async begins and ends. Most of my issues are C# specific btw, especially now that they have added async/await... so I'm mostly just ranting. It all became too abstract for me at some point and I just lost track of it all.

Your example I could implement somewhat easily by just spawning two threads, having one as the listener and the other as the sender, and then communicating between them by using events. But that's not very scalable, so it's not the "right" way of doing things.
>>
>>55973225
element(s) removal
>>
>>55973030
The Peano axioms define addition and multiplication too, based on 0 and S, which makes N not only a monoid but a semiring. N\{0} is also a monoid, but only under multiplication. The von Neumann construction of the natural numbers from empty sets is only one implementation of the Peano axioms. I didn't even mention it, you brought it up.
>>
>>55973296
>a dead /dpt/ meme
Yes, that's right. You posted about Rust.
>>
>>55973336
>The Peano axioms define addition and multiplication too
No. Multiplication is part of the axioms of a ring. N is not a ring.
>N\{0} is also a monoid
It isn't. It doesn't have the additive identity.
>The von Neumann construction of the natural numbers from empty sets is only one implementation of the Peano axioms.
That's my point. The Peano axioms have nothing to do with how the Natruals are constructed.
>>
>>55973344
It's not your fucking language safe space dumbass
If you had a fucking brain you'd have read the image caption and realise I don't like Rust
>>
>>55973255
Y is usually a number between 1000-10000, while Z is a number between 0 and 3, so that would probably not work too well.

A value of 1 Z means the original prediction will be correct, a value of 2 Z means that X will be about half of what Y is, between there is an exponential curve.
>>
>>55973356
He said under multiplication.
N\{0} includes 1.
>>
File: mosaic.png (1MB, 10000x5025px) Image search: [Google]
mosaic.png
1MB, 10000x5025px
fail?
>>
I've been programming a little for a while in C# and Java, and haven't had to use an external library until this point.

I have to use Twitter, so I am trying to import Twitter4J into Netbeans. I've downloaded and unzipped it, and (think) I added it to my libraries. However, when I try and import anything in my code, I get an error saying that twitter4j cannot be found. Anyone able to help?

While I'm at it, is there a better IDE for Java than Netbeans? I only use it because I had to use it in comp sci 101.
>>
>>55973356
>>55973356
>No. Multiplication is part of the axioms of a ring. N is not a ring.
It is a semiring. The Peano axioms define multiplication inductively, from n * 0 = 0 and n * S(m) = n + n * m.

>It doesn't have the additive identity.
Learn to read. I said "but only under multiplication", with identity 1.

>The Peano axioms have nothing to do with how the Natruals are constructed.
Yes, that's what axioms are after all. The axioms say "0 is a natural number". It doesn't matter how 0 is constructed or built on any previous axiomatic framework, but in any construction of the axioms it is taken to belong to the naturals.

Just read it for yourself:
https://en.wikipedia.org/wiki/Peano_axioms#Arithmetic
>>
>>55973404
IntelliJ is my preferred IDE. This is mostly based off of appearance and ease-of-use, I haven't gotten to the nitty-gritty because I don't use Java often.
>>
What do I need to know before I can start manipulating images with code?
Algorithms?
>>
>>55973371
So
Z
1 -> X
2 -> 0.5X
Inf -> Y
?

>>55973387
>mosaic
What did you do to Karen?
Pls let her go
>>
>>55973473
yeah you need algorithms, and logarithms too, pref.
>>
>visit github
>Explore
>trending
>today
>top 4 repositories are Pokemon Go bots or maps
what the fuck is this shit
>>
>>55973500
pokemon go is crazy popular right now, sell your old pokemon stuff if you have them, i got $400 just off of some pokemon stuff that my mom got from yard sales and thrift shops
>>
>>55973404
You should add it to your list of dependencies for your build tool.
>>
* (code-char 1488)

#\HEBREW_LETTER_ALEF

What does this mean?
>>
>>55973542
My brother just gave a pikachu plush that made pikachu sounds when the paws are pressed to my 6yo cousin that knows 5 pokemon. It's probably 12+ years old.
I just spent 90 bucks on pokemon; bought X, pre-ordered Sun, bought a Darkrai keychain
>>
>>55973561
there are a lot of Hewbrew characters in unicode, starting at 1470, including 1488 (א/alef), and going up to 1524
>>
>>55973561
kek /pol/ stumped
>>
>>55973304
>Your example I could implement somewhat easily by just spawning two threads, having one as the listener and the other as the sender, and then communicating between them by using events
that's WAY too overcomplicated

in my case i had SOAP methods to other service that came to me in both sync and async varieties.

I first wrote in synchronous manner

var result=service.GetEmployees(par1,par2);
// do some shit to result


which expectedly led me to having to rewrite it in async manner:


var result=service.GetEmployeesASync(par1,par2,callBackMethod,someDataToRecreateEnvironment);
return;
}

private void callBackMethod(resultClass result, object someDataToRecreateEnvironment){
// check if failure
// recreate environment if needed: DBContext, ORM objects and shit
// do some shit to result
}


async/await allows me have functionality of second code block in a code that looks like first, synchronous, code block:

// inside async method
var result=await service.GetEmployees(par1,par2); // proper, Task<result> returning async method
// do some shit to result



Basically, all code that comes after await line transparently for you is isolated into separate callback method. When await line executes, it sends async request, saves environment somewhere (all locals of async method) and commits sudoku.

When response to request comes back, callback method wakes up picks up the environment of async method and proceeds to execute the rest of the code after await line

async/await is a syntax sugar for peeps who have chains of async requests and don't want to write lots of callback method manually

> background workers
are not needed for simple async requests
>>
>>55973466
I will give IntelliJ a shot.
>>
File: stallmanu.png (68KB, 948x640px) Image search: [Google]
stallmanu.png
68KB, 948x640px
It's art.
>>
What really is the etiquette for putting source code in .hpp files? i.e. member function definitions. Should it /all/ be left to the source file (.cpp) or not? I know it would be better to put it all in the .cpp so it's not recompiled every time, but what's the etiquette?

>>55973680
Still doing image stuff? Neato. It's great art.
>>
>>55973622
>async/await is a syntax sugar for peeps who have chains of async requests and don't want to write lots of callback method manually

That actually makes it a lot clearer, thanks.
>>
>>55973692
>Still doing image stuff? Neato. It's great art.

Yeah, for a laff mostly. Haven't had any ideas. Once the semester starts, I imagine I'll get a second wind for my other projects.
>>
>>55973722
At least it's something to do. What other projects have you on hold?
>>
File: Play V3.png (18KB, 649x293px) Image search: [Google]
Play V3.png
18KB, 649x293px
>>55973740

My various meme programming languages, actually fixing up my music player (rewrite is meh so far, just as hacky as original just with ID3 tags), etc.

Just some bullshit.
>>
File: trash bobby.jpg (132KB, 500x378px) Image search: [Google]
trash bobby.jpg
132KB, 500x378px
>>55973789
>dadrock
>>
>>55973798
>being this new

>>55973789
Looks better than I last saw it.
>>
File: Play V3 2.png (16KB, 649x254px) Image search: [Google]
Play V3 2.png
16KB, 649x254px
>>55973798

Sorry, that's the original screenshot. I fixed the UI a tiny bit.
>>
File: le trash fish.jpg (77KB, 637x476px) Image search: [Google]
le trash fish.jpg
77KB, 637x476px
>>55973811
It's all trash, son
>>
>>55973843

Not all rock that was recorded prior to 1990 is dad rock, you know.
>>
File: Penn Jillette-AES-093348.jpg (65KB, 400x600px) Image search: [Google]
Penn Jillette-AES-093348.jpg
65KB, 400x600px
>>55973851
>all rock
>>
>>55967977
look mom I posted it again! C++ only takes up 33% of the programming language space. It's so bad :(
>>
>>55973903
It's such a big shit it occupies a whole third of all the designated shitting space.
>>
On a scale of 0 to TO THE WINDOOOOWWWW, how hard would it be to write a downloader in C that uses multiple threads to write to the same file? And what problems would I need to overcome?
>>
>>55973903
so does Java
>>
QUICK, MAKE A PROGRAM IN YOUR LANGUAGE OF CHOICE

THAT PROGRAM MUST HAVE A GLOBAL VARIALBE "SIZE", WHICH IS BOUND TO AN INT.
THAT INT DETERMINES THE DIMENSIONS OF THE CHESS BOARD THAT THE PROGRAM PRINTS

PIC RELATED, AN 8x8 and 11x11 OUTPUT
>>
>>55973981
No knifebird, no dice.
>>
>>55973985
I'll FUCKING STAB YOU YOU PIECE OF SHIT
>>
>>55974010
With what, faggot?
>>
guys, does javascript have pattern matching?

what fp features does javascript have?
>>
>>55974023
>>>/g/sqt/
Also, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
>>
>>55974023
>guys, does javascript have pattern matching?
no
>what fp features does javascript have?
none
>>55974036
pattern matching ≠ regexes
>>
>>55974048
>none
all the introductory books I've read claim that javascript is a lisp in c's clothing
>>
>>55973981
import Control.Monad (forM_)

_SIZE :: Int
_SIZE = 8

main =
let rep = concat . replicate (_SIZE `div` 2) in
let board = rep [rep " #", rep "# "] in
board `forM_` putStrLn
>>
>>55974048
https://en.wikipedia.org/wiki/Pattern_matching
>Sequence patterns (e.g., a text string) are often described using regular expressions and matched using techniques such as backtracking.

Also
>first class citizen functions with proper env capturing are not fp features
ha!
>>
>>55971630

#!/usr/bin/env ruby

file = File.new ARGV[0], File::RDWR

# Find a random byte in file
seek = rand 0..(file.size-1)
file.seek seek
byte = file.read(1).ord

# Flip a random bit
mask = 1 << rand(0..7)
byte ^= mask

# Write it back to the same location
file.seek seek
file.write byte.chr
>>
>>55974059
alt

let rep = ([1.._SIZE `div` 2) >>=) . const
>>
>>55973230
Hello Ranjit
>>
>>55974082
What?
>>
>>55974059
that seems complicated
size = 8

invert = map opp
where opp ' ' = '#'
opp '#' = ' '

main = mapM_ putStrLn cb
where row = take size (cycle " #")
cb = take size (iterate invert row)
>>
>>55974087
>Refinement Types
>http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/about/
>http://goto.ucsd.edu/~rjhala
>Ranjit Jhala
>>
>>55974131
He didn't invent them you fucking muppet
>>
>>55974139
whatever you say, poo-in-loo
>>
>>55974139
>haskell curry
>curry
>>
>>55974158
Curry's an English surname, and always has been you idiot
>>
>>55974164
and the british empire colonized pooland
>>
What's a fast yet easy to implement prime number algorithm out there?
>>
>>55974184
sieve of eratosthenes
>>
>>55974184
sieve of eratosthenes
>>
New thread: >>55974194
>>
>>55974058
they say that, but it lacks basically everything that makes a lisp a lisp - homiconicity, code as data, macros, cons-lists as the basic data structure, etc. and adds in more mutability, bad type coercion rules, imperative constructs as part of the core language, etc.
>>55974068
different type of pattern matching, they don't refer to the same thing at all
>first class citizen functions with proper env capturing are not fp features
are you trying to tell me that Go and Fortran are functional languages?
>>
>>55973981
; chess.sat - chessboard in saturn
; alternate ' ' and '#' to make chess tiles
; board is a square of size SIZExSIZE

main:
int SIZE, 8

int r, 0
int c, 0
int mod_result
int check_result, 0

col_loop:
cmp c, SIZE
jeq exit

row_loop:
cmp r, SIZE
jeq nextline

mov mod_result, r
mod mod_result, 2
cmp mod_result, check_result
jeq print_space
out stdout, '#'
jmp after_space
print_space:
out stdout, ' '
after_space:
inc r
jmp row_loop
nextline:
inc c
out stdout, newline
mov r, 0
cmp check_result, 0
jeq set_cr_1
jne set_cr_0
set_cr_1:
mov check_result, 1
jmp col_loop
set_cr_0:
mov check_result, 0
jmp col_loop

exit:


Probably the hardest thing I've done with this.

Outputs for 8 and then 10:
 λ saturn chess.sat
# # # #
# # # #
# # # #
# # # #
# # # #
# # # #
# # # #
# # # #
λ vim chess.sat
λ saturn chess.sat
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
λ
>>
>>55974229
wtf, tell me more about this saturn
>>
>>55973981
int i, j;
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
if ((i ^ j) & 1)
putchar('#');
else
putchar(' ');
}
putchar('\n');
}
>>
>>55974202
>different type of pattern matching, they don't refer to the same thing at all
It still is pattern matching. The answer to "guys, does javascript have pattern matching?" is yes. Think about what you write.

>are you trying to tell me that Go and Fortran are functional languages?
I'm trying to tell you they have functional programming features.
>>
>>55970116
It's
unique_ptr<Node<T>*>
>>
>>55969306
Terry Davis.

Schizophrenic who hears the word of God, and God told him to make an operating system. So he creates HolyC (a variant of C) and a compiler for it. Then he uses that to write TempleOS, which is vastly different under the hood from any OS you've used. There's some features in there that I think none of the major 3 OSes have, because it's architecture is so different.

He could be a well-received, high-paid software engineer at some prestigious company, if the schizo didn't make him yell about niggers and jews all the time.
>>
>>55975149
>HolyC
it's funny because it's a pun on the holy see
>>
>>55973981
i am very rusty at this:

chess:{`0:,/x#((x#" #"),"\n";(x#"# "),"\n")}
chess@5
chess@7


https://github.com/kevinlawler/kona
Thread posts: 335
Thread images: 37


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