[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: 317
Thread images: 26

File: dpt kaguya.jpg (579KB, 1280x1115px) Image search: [Google]
dpt kaguya.jpg
579KB, 1280x1115px
old thread: >>60594100

What are you working on, /g/?
>>
>>60599509
Lisp is the most powerful programming language.
>>
rate my language inspired by RPN, written in C
https://github.com/Guad/batt

a code example:
proc reverse_number
over 1 < @end if
10 *
over 10 % +
swap 10 / swap
reverse_number
end

getln 0
reverse_number
println
>>
>>60599535

What makes Lisp special?
>>
haskell!
>>
>>60599538
trash / 10
>>
>>60599538
great, now implement it using truffle
>>
>>60599563
parentheses
>>
File: what a great day for penis.jpg (18KB, 200x238px) Image search: [Google]
what a great day for penis.jpg
18KB, 200x238px
I gave rust a chance, and I couldn't shake off the sick feeling of being surrounded by webdev transplants and identity politic idealogues, both in their documentation, and their IRC channels.
Also, I was writing a bunch of stuff C style anyway, why even bother if I'm just evading the static safety system anyway.

Should I just double down on C++?
What other language should I try next?
>>
File: skilled.webm (3MB, 720x404px) Image search: [Google]
skilled.webm
3MB, 720x404px
/dpt/-chan, daisuki~~

Ask your much beloved programming literate anything (IAMA)

>>60599563
It's a programmable programming language.

>>60599509
Thank you for using an anime image.

>>60599509
>What are you working on, /g/?
A little utility program for gnu+linux but i haven't decided what programming language yet (Crystal?)

>>60599504
constexpr is powerful, you can, for example, hash or filter a string in the static environment.
>>
File: karen haskell.png (818KB, 1280x719px) Image search: [Google]
karen haskell.png
818KB, 1280x719px
>>60599566
tbhdesu
>>
>>60599625

definitely learn C++
>>
>>60599625
>language shopping
>visiting IRC channels for languages
just stop 'programming' and do the world a favour honestly
>>
How difficult would it be to replace systemd/write an init system in Haskell?
>>
>>60599509
>What are you working on, /g/?
Shitty irc client in Go, that should ultimately be able to automatically do xdcc requests.
>>
>>60599654
does haskell even have IO?
>>
>>60599633

>It's a programmable programming language.
Sounds like a buzzword to me. What does that mean in practice?
>>
File: 1478729596027.jpg (85KB, 580x563px) Image search: [Google]
1478729596027.jpg
85KB, 580x563px
>>60599568
>>
>>60599528
it might be implemented using inline assembly or compiler intrinsics which don't work at compile time
>>
>>60599633
Can you go into more detail on constexpr?
To what extent can I precompute by program at compile time?
>>
>>60599707
you could do factorials my friend
you could meme yourself into the code
>>
>>60599654
Harder than in C, easier than in Python
>>
File: AfterDPT.jpg (95KB, 331x670px) Image search: [Google]
AfterDPT.jpg
95KB, 331x670px
What is this? A little g-string or something?
>>
>>60599765
just your average programming underwear
>>
>>60599654
step 1
>add yet another subsystem which implements the haskell runtime
step 2
>replace systemd with something even shittier
>>
Seriously though, write compile time rational numbers rounding /dpt/
>>
>>60599821
Seriously though, no.
>>
>>60599821
just use templatehaskell and splice (round n)
>>
I want to build my own mathematical parser
>>
File: dragon3.gif (183KB, 650x510px) Image search: [Google]
dragon3.gif
183KB, 650x510px
>>60599707
You can compute any expression where its variables are fixed in the static environment.

An example that an anon posted some days ago

#include <cstddef>

constexpr auto cstrlen(const char* s)
{
std::size_t l = 0;
while (*s++) ++l;
return l;
}

constexpr auto has_repeated_characters(const char* s)
{
auto o = s + 1;
auto l = cstrlen(o);
for (std::size_t i = 0; i < l; ++i)
if (s[i] == o[i])
return true;
return false;
}

int main()
{
return has_repeated_characters("moose");
}



https://godbolt.org/g/j9rAUI

As you can see, the result is computed in the static environment.

>>60599676
You can extend the language as you want

http://practicaltypography.com/why-racket-why-lisp.html
https://www.wikiwand.com/en/Extensible_programming
https://www.wikiwand.com/en/Language-oriented_programming

some Lisps even embed C

(define (foo a b)
(#C
int c = a + b * 9;
return c;))
>>
>>60599958

I'm seeing a lot of textbook definitions but I'm not seeing the thing in practice.
What does it mean, what does it look like?
>>
>tfw you tried to have a dialogue with d-chan-fag and they didn't answer your questions
>>
>>60599958
C++17 contexprs are hawt
>>
>>60600096
what are you referring to? extending lisp or c++ constexpr?
>>
>>60600138

Extending Lisp.
What does it look like when I "extend Lisp", and why would I want to do such a thing?
>>
>>60600158
>>60600096
I agree. The article was filled with prose and not much in terms of practical examples.
>>
Reminder that Paul Graham still hires lisp hackers
>>
>>60600239
Someone has to maintain HN
>>
>>60600158
what programming language do you know?
>>
>>60599538
Is this Forth?
>>
>>60600303
its based on forth
>>
>>60600301

A patchwork of a few things. I know a bunch of Java, C++, PHP and Python but I don't have a lot of work under my belt.
>>
I made some VHD in Win Server 2012r2 and i wonder why i can't switch it to dynamic disk, it's grayed out, it's always basic disk
>>
>>60599538
Looks cool
Is @end a special form, or can I say @swap?
>>
>>60599538
using git branches to separate the c from the c# version is not a good idea.
>>
>>60600398
The @ character indicates that the next statement should be placed on the stack instead of being executed, so yeah, you can use @ with any statement

>>60600408
I don't really wanna continue with the C# version so I just kinda left it there
>>
>>60600432
yeah but for example, you said in the readme to look in the example folder where is only present in the C# branch
>>
>>60600464
Whoops, will fix
>>
>>60599538
a few odd things in the code but looks good overall.
>>
File: sweat1-300x277.jpg (39KB, 300x277px) Image search: [Google]
sweat1-300x277.jpg
39KB, 300x277px
fuck me i absolutely cant design UI code without shitting up the rest of the app
>>
>>60600613
it's not possible to write good ui code unless you're using html, css and react
>>
>>60600692
wipe this meme off the face of earth
you can make very pretty UI if you try hard enough
>>
What's a good parser generator that's both for C and LALR?
Is Bison good?
>>
people still use C?
>>
what the fuck man can any android developers tell me how i can let a user select a folder and then get all the paths to files in that folder

it's fucking ridiculous how many layers of indirection i have to go through in whatever i've looked up, initiating what seems to be the right intents and "building document URI"s in the result of the intent completion and using a contentresolver to query the resulting document URI and using another contentresolver on the URI to find all children URIs and using a contentresolver for the "MediaStore" which fails if the path isn't the "external device", blah blah blah holy fuck what a waste of thinking, this is literally two lines of code on any operating system
>>
>>60600842
Yeah well you should have made webapp and used jquery, noob.
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); she's super duper cute; and she's a blast to write in! Say something nice about her, /dpt/!
>Features
https://dlang.org/comparison.html
>GC
https://dlang.org/spec/garbage.html
https://dlang.org/blog/2017/03/20/dont-fear-the-reaper/
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>Standard library
https://dlang.org/phobos/index.html
>Books
https://wiki.dlang.org/Books
>>
What is the K&R equivalent for Python?
>>
>>60600909
That's even worse mascot than the lisp alien
>>
>>60600909
what compels people to shitpost about dead languages nobody cares about?
>>
>>60600842
Use https://github.com/passy/Android-DirectoryChooser for a directory picker.

File[] files = (new File(directoryPath)).listFiles();


Use File#getPath() on each of these files, and you're done.
>>
>>60600909
see
>>60599355
>>60599364
>>
>>60600974
i'll be testing this out in a minute, thanks my dude

do you recommend any other libraries to cover up general annoyance with the android API, atleast for semi beginners
>>
>>60599538
unsafe
>>
>>60599355 (Cross-thread)
>C#'s tools are completely free and open source.
Yes, I know; I never implied they weren't.
>C# can be used in other frameworks that have absolutely nothing to do with .NET.
I am wrong on this, sorry; however, most applications of C# do use .NET. And most learning resources require it too.
>I don't understand why you see the ability to utilize .NET Core and the .NET Framework as a negative.
First, it's relatively big. To use a simple .NET application, I'd need to download the Core or the entire Framework. And if it's a program that uses an older version of the framework, I'd have to use that too!
My second grievance is that its OOP design is a mess. This goes to Java too. Now, I'm not one of those people that thinks OOP has not place in software, it's just that its generally preferred design implementation is terrible, and it forces you into having to use OOP for the most part. Finally, it's really abstracted. Some might like this; some might not. I'm on with the latter side. This is my preference though.

>>60599364
https://tour.dlang.org/tour/en/gems/functional-programming
https://garden.dlang.io/
Thanks to dlang-chan for being a general-purpose systems language, she doesn't have to stuff shit in classes all the time. So she can adopt a lot of paradigms effortlessly.

>>60600935
I think she's cute! Though she's not a mascot. I don't have that authority.

>>60600951
Calling something you don't like is not shitposting. I'm trying to educate other anons on a language I love. I don't do
>if u don't use D gb2 >>>/reddit/
>only plebs don't like D LOL
etc.

>>60601016
I've addressed those above.
>>
File: 1488183809920.png (383KB, 1250x1425px) Image search: [Google]
1488183809920.png
383KB, 1250x1425px
>>60600839
I still use Fortran and I get shit done faster than any other babbys using memelangs like Go or Haskell.
>>
>>60601260
Also isn't only the .NET Core available on linux; as in you don't have all of .NET available to you on linux?
>>
Did I do it right?

#include <iostream>

int main() {
const int its = 9;
char arr[its];

const char emptyChar = ' ';
const char magicChar = '*';

for ( int i = 0; i != its; i++ ) {
for ( int y = 0; y != its; y++ ) arr[y] = emptyChar;
arr[0 + i] = magicChar;
arr[its - 1 - i] = magicChar;

for ( int y = 0; y != its; y++ ) std::cout << arr[y];
std::cout << std::endl;
}

std::cin.get();
return 0;
}
>>
>>60598958
myself, I'm interested in language semantics
it might just might be fun
It would be a neat way of standardizing recipes across platforms

You could have ingredients inherit from ingredients and recipes from recipes
And once it's in a form like that there are lots of things you could do other than make changes to recipes, like scale them up or down.

I need a good name for it
>>
>>60601260
>Calling something you don't like is not shitposting
I don't have a fucking clue what this language is, I dont dislike it, making huge, agenda-driven posts with anime avatarfagging about your language nobody wants to use is obnoxious as hell, I dont shitpost about my favourite obscure languages, they're obscure for a reason
>>
>>60599535
what does that buzzword even mean?
>>
>>60601294
>char arr[its];
This is invalid C++.
>>
>>60601275

Linux also has Mono.
>>
>>60601322
>I don't have a fucking clue what this language is, I dont dislike it
That's why I'm sharing the glory of her with my favorite anons.
>making huge, agenda-driven posts with anime avatarfagging about your language nobody wants to use is obnoxious as hell
I'm not really avatarfagging. I try to only use her as the first post. And my agenda is out of pure love. Also, they're not "huge." I generally try to only make one post about it, and it's usually only a sentence long. I regret my recent namefagging though. With regards to "nobody wants to use," that's what I'm here for! The biggest obstacle to dlang-chan being a popular girl is misunderstanding and general ignorance. Her parents are a big issue with regards to this.
> I dont shitpost about my favourite obscure languages
Good, because shitposting is bad. You could talk about it though; this is a thread about programming.
>they're obscure for a reason
And such reasons might be bullshit.
>>
>>60601374

You are incorrect.
>>
>>60599535
fpbp
>>
>>60601374
It is not, as long as its is const. Which it is.
>>
>>60601383
I forgot about, mono. But I believe mono's implementation isn't 100%.
>>
>>60599655
why not make it accept XDcc requests instead to maximize your user base?
>>
>>60601384
your posts are shitposts, languages dont take off for good reasons, and just because you 'love' something you're still pushing your obnoxious agenda on people just like doorknocking christians with pamplets
>>
>>60601383
momo sucks dude
>>
>>60601400
>>60601416
Dumbasses. C++ doesn't support VLAs.
You're relying on a non-standard compiler extension here.
$ cat shit.cpp 
#include <cstddef>

int main()
{
size_t n = 10;
int arr[n];
}
$ g++ shit.cpp -Wpedantic
shit.cpp: In function ‘int main()’:
shit.cpp:6:11: warning: ISO C++ forbids variable length array ‘arr’ [-Wvla]
int arr[n];
^

Stupid sepplesfags don't even know their own language.
>>
>>60599778
kek
>>
>>60601450
Oh wait, fuck me, I forgot to put const.
>>
>>60601425

It's close enough. You've got WinForms. Do you really need much else?
>>
>>60601450
Really?
Make n const and it will compile.
"its" was const in >>60601294
>>
>>60600158
Not that guy or a lisper, but as a Forth programmer (which has equally powerful metaprogramming) the main reason I have for extending the compiler is custom data structures/parsing and control flow.
Being able to just take a nicely formated table of some mapping, say names to colors, have it look like an ascii table in the source code, and being valid syntax is just incredibly nice and neat.
It may seem trivial (oh, what's the big deal, just put things into array or some map/dict initializer syntax and it works in any language), but it adds up, and later when you wanna add stuff to your constant table, or event handler table, when it's expressed in super neat human readable format it's a pleasure to work with.

And of course by virtue of having direct control of the compiler you can compute anything you want at compile time.
C++ constexpr are cool? Pleb tier compared to Forth. You can turn ANY existing Forth function or expression to a compile time constant by just switching off the compiler, run the code, switch back to compiler and compile top of stack as a literal (be it integer, address, string or even another set of words, i.e another program computed at compile time).

I feel handicapped in other languages after having used Forth extensively.
>>
>>60601450

It's const silly.
>>
>>60601444
>your posts are shitposts
Nah, I just explained why, and you've given terrible reasons why.
>languages dont take off for good reasons
Money, advertising, timing, and misinformation are good reasons why she hasn't reached her potential.
>and just because you 'love' something You're still pushing your obnoxious agenda on to people just like doorknocking christians with pamplets
This is a terrible analogy. Making one post, that's generally small, a thread is not as nearly obnoxious as that, and comparing one post to someone coming to your house like that is retarded.
Try again. Actually, don't. You have no idea what you're talking about.
>>
>>60599509
>emacs
would be nice if I had three hands or 18 fingers
>>
>>60601551
>Money, advertising, timing, and misinformation are good reasons why she hasn't reached her potential.
There's also the fact that we don't need yet another competing standard for a technologically crowded space.
>>
>he doesn't write his software in 100% pure assembly language
>>
>>60601551
you've been shitposting for several threads, and programming languages aren't video games, they don't need a marketing campaign
>>
>>60601567
And you would say the same about Rust and Go, right?
>>
>>60601609
they're both shit, yeah
>>
File: ebina.gif (774KB, 540x655px) Image search: [Google]
ebina.gif
774KB, 540x655px
>>60601586
as a code artisan, i crafted my own implementation of RC4 in x64 to protect my private stuff.
>>
>>60601567
I disagree. Languages are tools, and having many tools is a good thing.

>>60601606
Here's your (You). And by advertising, I mean spreading accurate and good information on what she is capable of. But please, stay mad.
>>
>>60601450
Why doesn't C++ support VLA and C does?
>>
>>60601638
nobody has been spreading misinformation about your programming language, people just dont give a shit
>>
>>60601641

VLA was a C99 addition
VLA was also a mistake
>>
>>60601641
I think the Clang c++ compiler supports vla
>>
>>60601627
>RC4
*ARC4
>>
>>60601609
Go at least tries to fill a new niche space for easily written C with incredibly easy to write concurrency, Rust is just SJW's overcomplicating C for no real reason
>>
>>60601664
C99 and C11 support it.

>>60601660
Why exactly is it a mistake? It's just a portable alloca, with convinient syntax.
>>
>>60601649
You seem to care a lot about me talking about a programming language in a thread about programming, shitposter-kun.
>>
>>60601668
Fuck off Ron.
>>
>>60601682
>Why exactly is it a mistake?
100% useless and actively harmful (no way to detect or recover from running out of memory).
To actually use them safely you have to already have a reasonble cap on N, in which case you can just use that cap as a constant N.
>>
>>60601740
>100% useless
no
>>60601740
>actively harmful (no way to detect or recover from running out of memory).
same for recursion
>>
>>60601757
>no
Yes.
>same for recursion
Generally, yes.
But recursion on (non degenerate) tree-like structures is fine because of logarithmtic behavior where you know you wont go deeper than a dozen or so.
>>
I have no idea what is(what they used for) runnable and thread in java
>>
>>60601740
What if you get n from the size of data already on the stack?

size_t n = strlen(str);
char newstr[n];


Wouldn't using a constant N, as large as the string can be, put you more at risk of busting the stack?
>>
>>60601740
You clearly don't know the wider implications and uses of VLAs, you filthy sepplesfags.
voif myfn(size_t n, int arr[static n]);

int w = 10, h = 20;
int (*arr)[w] = malloc(sizeof *arr * h);

Or you can just use it normally if you can reason that the array size is going to be an appropriate size.
>>
File: hqdefault.jpg (12KB, 480x360px) Image search: [Google]
hqdefault.jpg
12KB, 480x360px
>>60601649
>>60601705
*shitposts gratuitously on both of you* YYYEEEEEEEEE NOTHING PERSONNEL KID :3 ~ <3 ^_^ :^)
>>
>>60601808
I don't know java, but I'm assuming a thread is a thread and runnable is something that can be run.

Just a guess though.
>>
>>60601865
xD
>>
>>60601889
D~~B=
>>
>>60601808
Read the fucking API. Java actually has great online documentation.
>>
>>60601823
>Wouldn't using a constant N, as large as the string can be, put you more at risk of busting the stack?
You have to be able to handle the worst case n regardless, so however long str can possibly be, your function must be able to allocate it, so just make it statically sized to begin with (and make analysis easier as a bonus)
>>60601824
>You clearly don't know the wider implications and uses of VLAs
I know them perfectly well, and they are pretty useless too, minor niceties.
But they can be orthogonal to the automatic storage case, I wouldn't really object if those were the only valid forms.
>>
>>60601907
>pretty useless too, minor niceties
Those grape ARE pretty sour, aren't they?
>>
>>60601940
What are you talking about?
>>
>>60601907
worst case n can't be know since vla are for dynamic problems.
>>
testing
>>
>>60601960
If you don't have a reasonble worst case n you definitetly shouldn't be using VLAs because you are going to blow the stack that way.
That the irony of VLAs (they actually can't be used if n can vary greatly or completetly dynamically), and why they're a miss-feature.
>>
not testing anything (just a useless post)
>>
>>60599509
How would I best go about extracting data from some 250.000 saved web pages (with another 500k to 3.5 million web pages to come)? The data and format of the web pages is all consistent (though the amount of data on each page varies).

Normally I'd use Python plus BeautifulSoup to do this kind of thing, but it's too slow. I've never dealt with this much data before... at least I'm learning a lot!
>>
>>60600909
> garbage.html
kek
>>
>>60599563
Homoiconity i.e. data has the same format as the language:

;; This is a function call to prin1 with arguments "ayy", "kek" and "lel" (in C-style, equivalent to prin1("ayy", "kek", "lel")
(prin1 "ayy" "kek" "lel")
;; This is a list consisting of the symbol prin1 and the strings "ayy", "kek" and "lel"
'(prin1 "ayy" "kek" "lel")


This allows for uniquely powerful macros, for example. Because the syntax is like this (i.e. there is essentially no syntax), you can completely change the syntax of the language at runtime. For an extreme example, here's a subset of python reimplemented in Common Lisp: https://common-lisp.net/project/clpython/manual.html#python-syntax

Yes, that is literally entering valid python code into the lisp interpreter and it working correctly.
>>
>>60602022
The problem with beautifulsoup is that it needs to read the entire file into memory then parse it. Then in python you might get the text out(memory copy, probably done ahead of time by bs4, which slowed it down even more), then you take that memory and finally output it somewhere.

Depends on how it's formatted, you might get away with something very cheap like a text search for a <div>, then just decode HTML and output on the fly, until the </div>.

Although you'll likely run into a billion nested tags on large pages which is why you need an HTML parser.

It all depends on consistent the data is. If very consistent, a custom solution would be much, much faster.
>>
will I go to hell if I add mutable instance variables to my language?
>>
>>60602127
yea
>>
>>60602140
what if I use unsafe blocks
session Counter(unsafe! @x)
on count from _
unsafe!
@x := @x + 1
end
loop
end
end
>>
will i go to hell if i add i/o to my language?
>>
>>60602127
Nah, you'll just be sentenced to talking care of every NEET that posts in /dpt/.
>>
>>60602176
no
>>
>>60602107
The data is a very consistent
<tbody><tr><td><a>what I want</a></td></tr></tbody>
But it continues until the end of the file and there's typically high tens to low hundreds of these entries.

So I'm gonna have to load the entire thing into memory anyways. At that point, would it be worth coding a custom solution? I'm not sure what would be bottlenecking the speed there... I can't imagine using beautifulsoup would be much slower than manually searching through the file
>>
>>60602284
I fucked up

Remaining half of the post is supposed to be
"But it continues until the end of the file and there's typically high tens to low hundreds of these entries.

So I'm gonna have to load the entire thing into memory anyways. At that point, would it be worth coding a custom solution? I'm not sure what would be bottlenecking the speed there... I can't imagine using beautifulsoup would be much slower than manually searching through the file
"
>>
>>60602284
beautifulsoup is doing a lot behind the scenes, it's creating a huge tree of your webpage and all it's tags. and no, you don't need to load the entire thing into memory.

Even a quick sed solution might be(and probably would be) faster. Try something simple like just:

sed -rn 's/.*<td><a>([^<]+).*/\1/p' input.html


This makes the assumption that the only instances of <td><a> is in your table and it contains no tags(or at least '<').
>>
>>60602176

You'll go to hell if you don't add I/O to your language.
>>
>>60602391
Well I was oversimplifying with the structure, there's a few more tags in that <tr> and so forth.

Thanks for telling me beautifulsoup does that much behind the scenes though. I'll try lxml instead, it should be faster. If that doesn't work I'll probably just write my own thing.
>>
theoretically speaking
you are working as freelancer
you country want you to give them 20%
you dont want that
how would you hide your income from state?
Where would you stash your money
>>
>>60602444
pay your taxes pajeet
>>
>>60602460
b-but im no indian
im from europe, the poor europe, eastern europe
my state didnt do shit for me, i dont want to give them money
>>
>>60602444
it is simple friend
at 20% taxes you work 9.6 months for yourself and 2.4 months for the state
simply find out which months you are working for the state and take a vacation then
good luck and prosper
>>
>>60602444

get paid in buttcoin

of course you will be taxed when you cash out your coins to real currency, but at least you can stick it to the man
>>
>>60602536
bitcoin value is changing very fast, i may lose money
also, how would i cash money, if i use bank they will know
>>
>>60602509
/dpt/ is on fire today, I can't stop kekking
>>
>>60602460
IRS pls go
>>
>>60602444
Just use creative accounting. You only get taxed for profits and not revenue. This means that you could reduce the amount of taxes you take by arguing that specific purchases are company purchases and thus you don't get taxed.
>>
>>60602906
This. The trick is not to pay less taxes, the trick is to make less money (on paper)
>>
>>60602460
Taxation is theft.
>>
>>60603005
Then stop electing people who tax you, also expect them to keep providing government services.

Let me know how that goes.
>>
File: 1425434850693.jpg (69KB, 480x720px) Image search: [Google]
1425434850693.jpg
69KB, 480x720px
Maybe one of you guys can help me with this really quick.
With a given pixel color, such as #FF0002 or something like that, I want my program to:
# find a pixel on the screen with that color
# then left click it
>>
>>60603040
I'm using Python btw
>>
>>60603036
>Then stop electing people who tax you
I don't.

>also expect them to keep providing government services.
I don't.

>Let me know how that goes.
I can't. Because there are too many shitters in this country.
>>
>>60603040
You're at least 10 years too late to be writing this kind of bot for any game my friend
>>
>>60603040
Grab a screenshot of the screen, turn it into a matrix of colors via bitmap, then iterate through it and compare each color in the matrix. If it's the one you want, break out of the loop and move the cursor to it and click
>>
>>60603040
http://scikit-image.org/docs/dev/user_guide/numpy_images.html
>>
>>60603083
You don't even need that kind of fancy stuff, just PIl would be enough.
>>
>>60603098
I didn't see it as being very fancy. It's the same shit, just this one is plugged into numpy.
>>
>>60599509
Are backend web devs welcome here (node, python, ruby)?
>>
>>60603160
>Are backend web devs welcome here
yes
>(node, python, ruby)
no, just java and c#
>>
>>60603111
I consider numpy to be fancy
>>
>>60603160
If it's relevant to the language itself or your code. Not the latest shit framework, *.js, webshit crap.

There's a containment thread for that.
>>
>>60603160
dynamically typed languages a shit
>>
>>60603200
I consider anything above assembly as being fancy-pants masturbation tools.
>>
File: 1453653416676.jpg (73KB, 500x500px) Image search: [Google]
1453653416676.jpg
73KB, 500x500px
>>60603160
>backend web dev
>>
I feel like I absolutely should finally learn me some Python to be more valuable. But I don't want to.
>>
Is there any way to run my windows executable without cmd or a batch file or an IDE?
So far when I do it, it opens a console and but I can't copy or paste anything. Can I somehow replace the console it runs in
>>
>>60603308
Then don't.
>>
File: 1491151749883.jpg (240KB, 1081x810px) Image search: [Google]
1491151749883.jpg
240KB, 1081x810px
>>60601275
I would simply like to hold you up for one short while. What you're alluding to as Linux, is in fact, GNU/Linux, or as I simply the other day began to call it, GNU + Linux. Linux is not an OS on its own, but really another free component of a completely working GNU setup fashioned into something proper by the GNU central libs, shell utilities and essential setup components completing a full OS.

A sizeable amount of computer holders use a changed version of the original setup everyday, but do not know it. Through a particular turn of events, the version of GNU which is widely applied now is often called "Linux", and many of its holders do not know that it is really the GNU setup, designed by GNU.

There is in fact a Linux, and this population are using it, but it is simply a part of the setup they use. Linux is a kernel, the part of the setup that distributes the machine's resources to the other programs that you run. The kernel is an essential part of an OS, but cannot work on its own; it will work only in the shadow of a fully developed OS. Linux is normally applied in combination with the GNU OS, the whole setup is really GNU with Linux added, or GNU/Linux. All the "Linux" releases are really releases of GNU/Linux.
>>
>>60603317
Right click to paste, highlight and right click to copy.
>>
File: 1495557600844.png (374KB, 1119x826px) Image search: [Google]
1495557600844.png
374KB, 1119x826px
>>60603335
DAMN DUDE WHAT A HILARIOUS REPLY
HOW LONG DID IT TAKE YOU TO THINK OF THAT
>>
>>60603376
What the fuck are you going on about?

Irrelevant of what program is running, that's how copy/paste in the windows console. Or you use alt+space, e
>>
>>60603403
You're confusing cmd with the windows console
When you run an executable on its own you can't copy/paste
>>
>>60602481
>my state didnt do shit for me, i dont want to give them money
So then take them to court and explain that the state is demanding payment despite not upholding their end of the social contract.

>>60603057
Maybe consider moving to a country full of like-minded people?

>>60603209
Frameworks are literally just libraries though.

>>60603317
Just navigate to the EXE's directory and type the program's name.
>>
>>60603317
And I thought I was retarded.

>>60603441
>Maybe consider moving to a country full of like-minded people?
It doesn't exist.
>>
File: what.png (35KB, 2080x1148px) Image search: [Google]
what.png
35KB, 2080x1148px
>>60603437
>>
>>60603441
>Just navigate to the EXE's directory and type the program's name.
I specifically don't want to do this, I want to be able to just run the executable with a double click and paste in what I need in to the program/console
>>
>>60603484
Ok, thank you
>>
>>60603476
>It doesn't exist.
So why doesn't somebody make one?
>>
>>60603441
>arguing with libertarians
>arguing with gatekeepers
look at this mad lad
>>
>>60603491
Just right-click in the console window and choose paste.
>>
I already told you alt+space, e. You argued, you fucking cunt, you didn't even try it. Fuck you.
>>
>>60603529
I got tested and my IQ was 93
Blame my genes not me
>>
>>60603507
Because it would be incredibly difficult. It's hard enough to move enough like-minded people into the same U.S. state. Think about having to find some unclaimed land to build a new country on? It's nealry impossible unless we had someone charismatic, rich, smart, and principled enough to do it. Even then, other countries (mostly the U.S.) would hate it; because even though we talk a big game about freedom, it's all a facade.
>>
>>60603551
>we
To clarify "we" as in the United States.
>>
>>60599538
No variables? Kek I'll just
::
{ LAM var }
BIND
:: LAM var DUP ;
ABND
;


Out of here
>>
>>60603491

Anon, if it's a console program, you should only be running it from within a console or a shell script. If it's a GUI program, just navigate to it in explorer or run it from the start menu search function.

>paste in what I need
Since Windows 10, the standard command line supports copy and paste. If you don't have Windows 10, use ConEmu64 as your standard terminal emulator to get this functionality. Alternatively, if your program is reading from stdin, you could paste your data into a file, and run it like....

./myprogram < somefile.txt
>>
>>60603590
>Since Windows 10
You could copy/paste since XP.
>>
>>60603590
>Anon, if it's a console program, you should only be running it from within a console or a shell script.

So if I want it to run on its own I'll have to make it a GUI program? Can I have separate console that I can run with it without having to go cmd, setting the path directory and executing

I just want the program to run with a double click without having a batch file that just automates the process
>>
goddamn this thread is so much better without the gatekeeper and the other programming language theorists
>>
>>60603672
Yes, if the program has subsystem console.

https://msdn.microsoft.com/en-us/library/fcc1zstk.aspx

Don't listen to "sempai", he knows fuck all about anything.
>>
>>60603687
>>>/r/abbit/

More seriously does anyone have a good link to a quick rundown on variadic templates?
>inb4 C++ standard
>>
>>60603672

>So if I want it to run on its own I'll have to make it a GUI program?
Have to? No. I'm saying you SHOULDN'T ever run it except in a console or shell script. If it's a console program, then it is designed to be run in the context of a console. Fuck's sake...

I always have a terminal emulator open, regardless of operating system. If you're a programmer, you should do the same. Keep your makefile and binary in the same directory, so that while developing, you can run make to build it, and then run the same program without changing directory or typing out a relative path.
>>
>>60603832
Yeah, we get it, you're ultra l337. Now please do everyone a favor and fuck off.
>>
>>60603855

It's not a matter of being 1337. It's a matter of using the right fucking tools. Your compiler is a command line tool. The program you are building is a command line tool. The command line was designed to run command line programs. If you run a ton of command line programs, it makes sense to have a command line open at all times.

Fuck's sake.
>>
>>60603906
It also makes sense to double check your shoe laces to make damn sure they're tied, wouldn't want to trip while gloating about how cool you are for having 20 terminals open on 4chan.
>>
>>60603855
play nice anon-kun

daily reminder that babun is the only acceptable way to use windows
>>
File: 22.jpg (17KB, 300x180px) Image search: [Google]
22.jpg
17KB, 300x180px
I hate it when search for something and the results are from reddit. I have yet to read anything on that site that is remotely accurate.for anything

Look at the top comment here on /r/CompSci right now http://archive.is/Vd0KM

I cringe reading that upvoted comment and the choir of shill comments afterwards. The article in question is correct, and is referring to Math.random() and rand and other language specific implementations. The author is ranting against the terrible practice of defaulting to a non-CSPRNG these days as a premature optimization. Math.random() or rand (ruby) is not cryptographically secure for use cases such as hashing, signature generation, ect, ordinary PRNGs are unsuitable.The Web Cryptography API introduces window.crypto.getRandomValues, a method that returns cryptographically secure random values, at a performance cost or you have your software get it directly from /u/random

Time to kill *plebbit results in every single search I do in the future
>>
>>60603921

Why do you presume that having a terminal open is about coolness? It's about practicality you fucking dunce! You are running a program that was designed to run in a specific context. When you intentionally avoid using a terminal, it's as if you are going out of the way to make things hard on yourself.
>>
>>60603946
When it comes a ponyfag, trap wannabe tripcunt that acts like an elitist cunt.. I just poke at it, it's easily insulted.
>>
>>60603962
I agree, you're very cool with your terminal. Please tell me more.
>>
>>60603971
Nice projection.
>>
>>60603971
Stop being retarded. Also it's not ruby's fault she can't program.
>>
Please redpill me on emacs
>>
>>60604008
This is ableist speech, please direct yourself to the nearest CoC and atone for your sins.
>>
>>60604032
CoC sounds too patriarchal for xyr. Xi call it a "Contributor Covenant".
>>
>>60603960
The main place where non-cryptographic RNGs are needed is in sampling.

The system CRNG may be efficient to use, since it's already initialized and has access to entropy but for a simulation program you need repeatable randomness. That is, a random number generator which your program supplies the seed. You can't debug it otherwise.

A CSRNG should not be the default, unless it's fast as shit and you supply the seed. It wouldn't be secure without a long key anyway, which the program isn't expected to give.

Fuck those cunts, a regular mersenne twister has its purposes.
>>
>>60603960
Yeah. Whenever I have to browse reddit for some answers, the comments also seemed to be made for the purpose of stroking the commentator's dick.
>>
>>60604053
C stands for COCK

#TRIGGERED
>>
>>60604029
Good tool
https://tuhdo.github.io/emacs-tutor.html

There's some issues, #1 it's still single threaded, and elisp is kind of ridiculous to work with but this is all getting fixed whenever guilemacs is released which will take another few years.
>>
>>60603981

Look, you've got a program that can run any other program by typing in its name, choose where that program gets its stdin, stdout, and stderr (redirect to/from files/other programs), and set its command line parameters. It is designed specifically for this task. There isn't much reason to use anything else, with the exception of a shell script. CMD may not be the best terminal emulator, but it's not your only choice. You can run things in powershell or in third party shells/terminal emulators.

But whatever you do, don't try and use a hammer as a screwdriver.
>>
>>60604079
If you hit a screw hard enough, it's eventually go in. The threads will be stripped, it'll do a 45(or even a 90), but you'll get it in there.
>>
>>60604100
this is how babies are made btw
>>
>>60604079
The original topic of discussion was a console application the guy only wanted to double click. You don't have params or redirection.

The only thing that's left is you sperging on him that he needs to have a terminal open 24/7.
>>
>>60604068
>a regular mersenne twister has its purposes.
Xorshift my dude
>>
>>60604234
>LFSRs
That's nice, why is that superior to a mersenne twister?
>>
>>60604249
It's not if you need huge periods apart from being more performant than unoptimized MT, but empirically it passes a lot of randomness tests many don't (including MT). There's a paper by Marsaglia where he implements some tough tests, I applied them to xorshift1024 for one of my classes and ended up with way better p-values.
>>
>>60604290
Note I'm talking about a specific PRNG and not LFRS in general. Fibonacci for instance is pretty ass
>>
>>60604290
Then why do almost "rand" implementations use a MT? Or older ones with that knuth polynomial thing.
>>
>>60604315
>LFRS
I always have trouble with this acronym as well, it doesn't seem natural without thinking about what it stands for. Although I usually do LSFR.
>>
>>60604349
Lithuanian Socialist Federal Republic?
>>
>>60604318
Honestly same reason why we still use C. It's well tested/known and has been around forever while doing the job. In the meantime this doesn't mean we don't have many issues because of it. Look at
pcg-random.org for a comparison.
>>
>>60604357
I wish, I think it's dyslexia or mental retardation.

>>60604362
Ok, if it's faster and better. Irrelevant of efficiency, how that cause "many issues".

This isn't a CSRNG or anything with consequences, if it's used as such that's a problem in the application which uses the algorithm.
>>
>>60604194
>The original topic of discussion was a console application the guy only wanted to double click.
I think what Ruby is trying to say is that this is fundamentally a bad idea and he refuses to support you with it.You mistake his explanation of why it's bad for sperging because he never actually outright said it's bad. Well, I'll say it for him: it's bad. Don't do it.
>>
>>60604389
Thanks ruby supported #524(totally not ruby). I didn't say fuck all about your original, I'm not sure I even read it completely. I just saw you sperging about consoles and decided to fuck with you until you removed you tripcode, starting samefagging as anon and then not post for a few weeks.

This isn't the first time I do this. Get help, your mental state isn't perfect.
>>
>>60604387
>This isn't a CSRNG or anything with consequences
That's where you're wrong though. Uncertainties quantification for instance requires good behavior from your PRNG, otherwise you might see two random variables being correlated when they shouldn't be.
>>
>>60604424
>I am proud of being autistic: the post
>>
>>60604424
>Get help, your mental state isn't perfect.
>decided to fuck with you until you removed you tripcode
>This isn't the first time I do this

are you okay anon? do you need to talk?
>>
>>60599509
>SICP
>striped socks
>pantsu

people order these together, don't they?
>>
>>60604431
If it passes rigorous statistical tests, shouldn't that qualify as a good RNG? You might find a correlation between truely random values as well.
>>
>>60604424
>Thanks ruby supporter #524(totally not ruby)
KEK
>>
>>60604424
>>60604503
but i'm not ruby though
>>
>>60604452
Maybe, what do you want to talk about?
>>
>>60604510
>i sexually identify as an annoying tripfag
>EVER SINCE I WAS A BOY
>>
Ruby when are you gonna get a real job and stop trying to avoid the real world?
>>
>>60604500
The point is MT doesn't. Also we can merely show a lack of "enough randomness", not prove actual randomness (which makes sense since our computer programs are deterministic). But if you think MT is random enough for non mathematical programs you're right. It's just slow and has a huge state for little benefits in such applications.
>>
>>60604527
It's only been here about 3-5 years, it didn't even know C back then. I'm pretty sure as a boy he showed a promising future for his parents, but now that it identifies as a female horse I'm not too sure.
>>
>>60604535
i'm not ruby but since everyone now thinks i am i assume you're addressing me

i'm currently a junior at ucsc, i live with my mom and plan on getting a job and moving out as soon as i graduate
>>
Trying to figure out Java API for JSON. Then how to how to use Java API for MySQL. Then idk, my second class starts in the fall. Honestly I'm excited, I got a 4.0 on my first class. Feels good man.
>>
Everyone talking shit about ruby when this "Anonymous" guy has been shitposting since 2003 sm.h
>>
File: Foot_on_white_background.jpg (5KB, 230x153px) Image search: [Google]
Foot_on_white_background.jpg
5KB, 230x153px
>>60604630
shitpost for confirm
>>
>>60604630
Wait a minute.. What's wrong with shitposting?
>>
I've downloaded wikipedia as a large .txt file and I'm writing a program to efficiently search it.

My goal is to be able to type in "meme" and get back every paragraph that contains the word within milliseconds.

So far I've written the part that stores the paragraphs and can return any paragraph in the file based on their unique ID in basically constant time. Obviously longer text takes more time since it has to be read in but there is absolutely no difference in performance between retrieving the first paragraph stored and the millionth paragraph stored.

It's taking 1 second to return 100,000 same sized paragraphs from disk, I think that's good.
>>
>>60604657
just use grep you retard
>>
File: GREP.jpg (80KB, 853x470px) Image search: [Google]
GREP.jpg
80KB, 853x470px
>>60604671
>>
>>60604671

Oh wow yeah great idea I'm totally doing this because I couldn't find a way to search text files that already existed. That's the only reason people do anything.
>>
>>60604686
>people only ever do anything because they couldn't find a way to search text files that already existed
>people live on ways to search text files and consume such ways as sustenance
>mfw
>>
File: almost chad feel.jpg (106KB, 644x781px) Image search: [Google]
almost chad feel.jpg
106KB, 644x781px
>>60604706

Exactamundo
>>
>>60604657
>downloaded wikipedia as a large .txt file
I've downloaded a wikipedia backup a while ago, it was in some format(zim, zap, zed or some shit). It was a file with offsets to lookup tables, those lookup tables were compressed and pointed to compressed data. It was about 70-80 GiBs compressed, but allowed you to lookup data while only decompressing the relevant data.

As a text file, unless it has a good format where you can seek everywhere it will be inefficient as all hell.
>>
>>60602176
Yes. No good programmer really needs it.
>>
>>60604686
Reinventing the wheel is a waste of time.
>>
File: eggy.jpg (59KB, 500x526px) Image search: [Google]
eggy.jpg
59KB, 500x526px
>>60604754
>he only ever writes boot code
>>
>>60604734

Is that 70GB one including images? This is text only so it's much smaller.

As I said, it's constant time to get any specific paragraph no matter where it is in the file.
>>
>>60604772
Thumbnails, not full images. It's not a backup of wikimedia and from what I recall the one without thumbnails was maybe 30 GiB.
>>
>>60604657
After you finish, you should look at the source for GNU grep to figure out how other people solved the problem. There's also a really good discussion about why GNU grep is so damn fast that you might be interested in here if you haven't seen it: https://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html
>>
File: 192.png (217KB, 600x600px) Image search: [Google]
192.png
217KB, 600x600px
/dpt/ how to load arbitrary hard disk data into ram? i want to see what happens when i execute my porn
>>
>>60604194

>only wanted to double click
Also wanted to copy paste text into the program. Oh hey, it's not like you've got a wide variety of ways to input data into a command line program via a fucking terminal emulator.

>>60604424

Yeah, that wasn't me. I just took a fucking hour break to play some Binding of Isaac.

>>60604535

Professor of Computer Science isn't a real job? Because I'm getting my PhD to become a fucking professor, or at least get a decent research position.

>>60604555

>But now identifies as a female horse
Yeah no.
>>
>>60604811
It's not that interesting.

$ chmod +x porn.mkv
$ ./porn.mkv
-bash: ./porn.mkv: cannot execute binary file: Exec format error
>>
>>60604535
>Wagekeks, everyone

>>60604706
Whom are you quoting?

>>60604811
Read it into a string and then use undefined behavior to jump to it.
>>
>>60604815
That's nice, tell us more about how you're pissed off. We're all dying to here more.
>>
>>60604834
>her OS can't execute arbitrary binary files
embarrassing tbqh
>>
>>60604795

That's different to what I'm doing, they're optimising for linear searching and leaving the files as they are whereas I'm actually processing the data to optimise it for many searches so that you can search it over and over and get back results almost instantaneously.
>>
>>60604857
You're right, file formats are bullshit. Everything should be executable.
>>
>>60604811

malloc a buffer
fopen
fread
fclose
cast buffer to function pointer
yolo

>>60604846

I'm going to be honest. What really pisses me off is how utterly boring your attempts at banter are. I'm going to take a shower.
>>
>>60599661
Don't be ridiculous. Haskell is definitely NOT the best tool for every job or even most jobs in industry, I can tell because I work with it daily, but it's a very good language overall. How can you do anything useful without IO?
>>
Don't reply to tripfags.
Hide tripfags' posts.
Don't talk about tripfags.
>>
>>60604938

Fucking tripfags
>>
>>60604811
#include <cstdlib.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, char const** argv) {
FILE* fin = stdin;
if (argc >= 2) fin = fopen(argv[1]);
if (!fin) fin = stdin;
int size = 0, capacity = 256;
char* data = malloc(capacity);
while ((data[size] = getc()) != EOF)
if (size >= capacity - 1)
data = realloc(data, capacity *= 2);
if (fin != stdin) fclose(fin);
data = realloc(data, size + 1);
data[size] = 0;
int pagesize = getpagesize();
if (mprotect(data - ((unsigned long) data)%getpagesize(),
pagesize, PROT_READ | PROT_WRITE | PROT_EXEC) != -1)
((void (*)()) data)();
return 0;
}

disclaimer this will probably segfault quickly and you should be worried if it doesn't
>>
>>60604955
oops forgot #include <stdio.h>
>>
>>60604938
This tripfag has been here for years, he deserves our love and support.

I believe in you ruby, you can become a horse if you want to!
>>
>>60604908
You left out an important step. How do you determine the size of the file? You need to know that both for malloc and fread.
>>
File: 1483916387615.png (602KB, 963x720px) Image search: [Google]
1483916387615.png
602KB, 963x720px
>>60604446
>>60604457
>>60604527
>>60604706
>>60604769
>>60604845
>>60604857
Who said this?
>>
>>60604955
wow this shit doesn't even compile at all oops
fixed version:
include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, char const** argv) {
FILE* fin = stdin;
if (argc >= 2) fin = fopen(argv[1], "r+");
if (!fin) fin = stdin;
int size = 0, capacity = 256;
char* data = malloc(capacity);
while ((data[size] = fgetc(fin)) != EOF)
if (size >= capacity - 1)
data = realloc(data, capacity *= 2);
if (fin != stdin) fclose(fin);
data = realloc(data, size + 1);
data[size] = 0;
int pagesize = getpagesize();
if (mprotect(data - ((unsigned long) data)%getpagesize(),
pagesize, PROT_READ | PROT_WRITE | PROT_EXEC) != -1)
((void (*)()) data)();
return 0;
}
>>
>>60600126
Are they implementing constexpr parameters yet? Using template arguments for that stuff is goddamn obnoxious.

Also do you know if they're breaking constexpr counters ( http://b.atch.se/posts/constexpr-counter/ ) yet? I want to build intelligent static allocators but I don't want to waste the effort if all of my abilities to make counters will just get broken because they're "useless edge cases."
>>
>>60604955
Non-portable. I don't think you need POSIX functions to do this.

>>60604996
What's with the horse meme?
>>
>>60604908
Won't work because the heap pages should be noexec. Proper way is to use mmap
>>
>>60605023
/mlp/ fag who occasionally posts pony shit on /dpt/.
>>
>>60604996
It still doesn't make tripfagging right. I respect the guy's (girl's) knowledge, but that's about it. His attention whoring is abhorrent. Aaaand I just broke the last rule I posted. Fuck.
>>
>>60605023
>Non-portable. I don't think you need POSIX functions to do this.
Pretty sure you do if you want anything interesting to happen other than the OS putting its foot down and being like "no you may not execute this memory because it is not executable memory." Unless you want to do it in kernel mode.
>>
>>60605040
Only retarded newfags try that hard to fit in and adhere to le epic 4chan culture
>>
>>60605016
fuck
(pretend there's a pound sign in front of the first line pls kthx)
>>
>>60605060
ruby pls
>>
>>60605060
wew
>>
>>60605069
>ruby
But ruby is taking a shower right now, remember how he told us all he's going to take a shower?

I love tripfag blogposts, they make me feel like I have friends.
>>
>>60602022
You should consider F# and the HTML type provider. F# is strict by default, but it has sequences, which are like Haskell's lazy lists.

You can then pipe the data being read from the HTML into whatever it is you want to do, and it should use constant space. I don't remember the size of the chunks it uses, but they're usually reasonable.
>>
>>60605060
>le epic 4chan culture
>>>/r/ibbit/
>>
This is a thread for mentally deficient people, right?
>>
>>60605134
well i mean obviously???!?!?!?!?!?!??!?!?!?!!?!?!??!?!?!????!?!!?!!?!?!?!?
>>
Is there another version of this thread with an IQ requirement of at least 60?
>>
500 lines in
core compiler complete
pretty printing & ast complete
coming soon:
- lexer
- parser
coming not so soon(?):
- FFI
- instance vars (mutable)
- tuples?
- syntax cleanup (begin...end blocks?)
coming very far from now:
- typechecking
coming never(?):
- pattern matching

WHY AREN'T YOU USING NVLANG GOYS?
>>
>>60605134
deficient in what sense?

please respond, I've spent the last decade trying to figure out what is wrong with me.
>>
>>60605169
A good roadmap.
>>
>>60605142
obviously???!?!?!?!?!?!??!?!?!?!!?!?!??!?!?!????!?!!?!!?!?!?!?

What do you mean by obviously???!?!?!?!?!?!??!?!?!?!!?!?!??!?!?!????!?!!?!!?!?!?!?

Aren't we obviously???!?!?!?!?!?!??!?!?!?!!?!?!??!?!?!????!?!!?!!?!?!?!? reasonable people?
>>
>>60605231
By using botnets, memes and CIA niggers.
>>
>>60605231
please do not post lewd pictures of underage traps with severe food addictions
>>
>>60603061
Im still learning and i wanted to apply what ive learned so far by making a bot.
>>60603064
Thanks anon. This worked
>>
>>60605010
you could have a dynamic buffer and use fgetc
>>
So whats the advantage of counting from 0? Why not start with 1?
>>
>>60605336
Because N+0 = N.
>>
>>60605336
0 is the initial object in the counting category.
>>
>>60605336
array indices need to start at 0 because they aren't just ordinals, they're distance measurements, specifically they count the distance of the element from the beginning of the array and it would be nonsense to have the array start at a distance of 1 from its beginning rather than 0
>>
>>60605336
integer division sometimes comes into play in indices. You want it to round at 0.
>>
>>60605365
(to elaborate, it's nonsense because it's a tautology to say an array starts zero units away from its beginning, whereas to say it starts one unit away from its beginning is mathematically impossible)
>>
>>60605382
Jerk your mathfag cock as much as you want, give a PRACTICAL reason.
>>
>>60605393
TIL math is not practical.
How's third grade going, Jimmy?
>>
>>60605393

Not having to subtract one from all of your array indices. Arrays contain (or in the case of C, are) a pointer to their first element. You add the index, get the element. Add 0, get first.
>>
>>60605412
Why do you like Ruby? Ruby is such a shit language compare to literally every other scripting language, such as Python, Lua and Javascript.
>>
i fixed some feedback what do you guys think
https://pastebin.com/jxg3DEzQ
>>
>>60605407
Very good actually, without your abstract mathematical masturbation without any practical purpose I was able to accomplish a lot with elementary arithmetic.

It was a good day.
>>
New thread.
>>60605428
>>60605428
>>60605428
>>60605428
>>
>>60605426
>I was able to accomplish a lot with elementary arithmetic
Wow sounds a lot like array indexing!
>>
>>60605466
Yeah, it was real simple. You could learn a lot from ignoring your topology shit when dead simple shit is right in your face.
>>
>>60605289
Not a problem!
>>
>>60605421

Compared to Python, Ruby is actually pleasant to work with. Python feels inconsistent in many ways. Functions like map and length are naked top level functions, while sort and reverse are methods on the native list data structure. In Ruby, these are all implemented as methods. With the exception of a few methods that are located in modules, nearly everything in Ruby is done by message passing. Furthermore, Ruby's blocks beat out Python's lambdas by far.

Compared to Lua, Ruby is more feature complete out of the box, and also isn't weakly typed. Lua likes to use the hash table for everything, while Ruby has a native array type and a native hash table type. It also has real objects.

Compared to JavaScript, Ruby was not designed in less than a month, and isn't chock full of inconsistencies in its type system. It also comes with a lot more out of the box, and doesn't have its users creating large numbers of interdependent single function libraries.

Ruby is a great language for creating what can effectively be considered shell scripts on steroids. It is perhaps the best language for string and array processing tasks, where programmer time is much more important than runtime cost.
>>
>>60605336
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
>>
I have almost no experience with a wide variety of languages so I ask you turbonerds

Which language provides a sleep(cylces)?
Thread posts: 317
Thread images: 26


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