[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k] [s4s] [vip] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Home]
Board
Settings Home
/g/ - Technology



Thread archived.
You cannot reply anymore.



File: haskell.png (818 KB, 1280x719)
818 KB
818 KB PNG
No time for love edition.

What are you working on /g/?

Previous thread: >>62856162
>>
I'm bored.
>>
rate my rust code
https://github.com/cgati/yes/blob/master/src/main.rs
>>
>>62868575
well suggest me an alternative then?
like the ancient irc, mailling list eh?
it's easy to use(like just click a link and you in), popular.
i can understand that there is concern about your privacy when all your chat stuff go through their server though.
so suggest a alternative pls.
>>
Has anyone tried using Python's async tools with PyQt5? (through Quamash or otherwise)

Noticed any performance problems?
>>
>>62868669
going to their house
>>
>new thread before bump limit
Kill yourself.
>>
>>62868640
>Cow
For what purpose?
>>
>>62868701
sooooo you can only colaborate with people within your reasonable travel distance eh?
>>
>>62868706
It was apparently at 309 when he posted, maybe someone just deleted a post afterward
>>
>>62868728
>new thread exactly at bump limit
Should still kill himself.
>>
In other news I changed the way strings are assembled in my project I posted yesterday. This removed the need to convert everything to string when appending. For example
    std::string message = "unexpected type ";
message += (type->kind == TOT::TypeKind::Boolean ? "bool" : "int");
message += "["; message += std::to_string(type->dimension); message += "] ";
message += "instead of "; message += (expected->kind == TOT::TypeKind::Boolean ? "bool" : "int");
message += "["; message += std::to_string(expected->dimension); message += "] ";

becomes
    std::ostringstream message;
std::string lhs = type->kind == TOT::TypeKind::Boolean ? "bool" : "int";
std::string rhs = expected->kind == TOT::TypeKind::Boolean ? "bool" : "int";
message << "unexpected type " << lhs << "[" << type->dimension << "] instead of " << rhs << "[" << expected->dimension << "]";
>>
>>62868621
reposting from last thread

Can someone tell me if my English translation of <AnyType extends Comparable<? super AnyType>> as a parameterized type (java) is correct?

This parameterized type will take any arguments that implement Comparable.

That's all it means, right? That AnyType from here on out in the class/method will refer to anything that is implementing Comparable.

Thanks.
>>
>>62868710
To avoid copying "y\n" in the one time setup.
>>
>>62868826
AnyType needs specifically to be comparable to some supertype of AnyType.
>>
>>62868669
irc is flawless
>>
>>62868706
>>62868728
>>62868743
>not waiting for end of page 10
>>
Downloaded a large C project
Copied one of the structs in a h file and edited it under a new name in the same .h file
Try to compile a C file that uses the original struct, but with the name replaced with my new struct

dereferencing pointer to incomplete type


I don't get it
>>
>>62868640
> This commit increases output throughput as measured by target/release/yes | pv > /dev/null
> and target/release/yes aaaaaaaaaaaaaaaa | pv > /dev/null after 20s from (3.8 MB/s, 30.2 MB/s) to 4.5GB/s.
> As a baseline, the GNU coreutils 8.21 implementation gives (140MB/s, 769MB/s).
GNU-fags BTFO again.
>>
>>62868640
jesus fucking christ, is this the power of rust?
>separate /src directory for one file
>66 lines for the program
this would be 10 lines of C
>>
File: rust_safe_control.png (72 KB, 648x454)
72 KB
72 KB PNG
>>62869018
muh safety and muh control bruh
>>
>>62868999
You mustn't have declared it properly.
>>
>>62869018
>this would be 10 lines of C
https://github.com/coreutils/coreutils/blob/master/src/yes.c
>128 lines
>>
>>62869054
Yes, this is the power of coreutils.
https://github.com/coreutils/coreutils/blob/master/src/true.c
81 lines for int main(){return 0;}.
Also, that includes documentation.
>>
File: 1494135535093.jpg (53 KB, 1024x578)
53 KB
53 KB JPG
>want to use Rust
>want to use the piston_window crate
>error: Could not compile `bitflags`.
>>
File: filthyfrank_gun_mouth.jpg (11 KB, 480x270)
11 KB
11 KB JPG
>>62869125
>>
>>62869018
>>62869054
Both are OMG OPTIMIZED.
>>
>>62869155
>OMG
kys
>>
C is a shitty language
>>
Is there even a decent language out there? C is too low level, C++ is a clusterfuck, Erlang and Elixir are too slow on computation and niche, Python, Ruby, Java are dogshit slow, C# has too few libraries (though I'd love to use .Net Core with GTK on Linux), dont even get me started on Rust. Does anyone know of a good language?
>>
>>62868999
This would suggest you're using the type when only a forward declaration has been defined. Is your full struct defined further down the file than when you're trying to dereference it?
>>
>>62869077
It's not about documentation tho, it's about speed: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ , https://matthias-endler.de/2017/yes/ . Naive 3-lines solution would be orders of magnitude slower.

You can actually see FreeBSD using the same approach as the Rust implementation https://github.com/freebsd/freebsd/blob/master/usr.bin/yes/yes.c , and OpenBSD folks not only not giving a fuck about speed, but also wasting your time on useless "pledge" syscall just in case there's a vulnerability in the other 3 lines: https://github.com/openbsd/src/blob/master/usr.bin/yes/yes.c . I guess this is the price of "safe C".
>>
>>62869176
>C# has too few libraries
wut?
how do you define a good language?
>>
>>62869176
> Is there even a decent X out there?
> dont even get me started on <actually decent X>
Every time.
>>
>>62869039
>>62869182
I'm a cunt, I typo'd the name.
>>
>>62869192
the official connect for MySQL on .Net is broken right now, and GTK doesnt even work on .Net Core, once these are fixed I'd jump shit as I love C# and .Net though
>>62869198
>no native polling support
>no libraries for linux system programming
>decent
>>
>>62869155
Gahnoo is never optimized.
>>62869183
You can do it high performance without close to 100 sloc. Your approach is bloated as hell.
>>62869176
>c
>too low level
There are libraries for that.
>>
38th for lisp is the most powerful programming language
>>
>>62869237
>no native polling support
What are the mio and tokio crates.
>no libraries for linux system programming
What is the libc crate.
>>
>>62869280
>implying mio and tokio do poll() and select() using the Linux API
>implying the libc API is sufficient
Rust is simply not ready senpai
>>
>>62868640
fn fill_up_buffer<'a>(buffer: &'a mut [u8], output: &'a [u8]) -> &'a [u8] 

Generics and how they interact with lifetimes feels like a horrible mistake.
>>
>>62869243
>focusing on sloc this much
It's about readability as well. But whatever way you format your code, you still have to allocate a buffer on the stack, copy the argument into the buffer as many times as possible and then call write in an infinite cycle.
>>62869297
>implying mio and tokio do poll() and select() using the Linux API
No one uses poll and select anymore, grandpa, mio uses epoll on linux: https://github.com/carllerche/mio/blob/master/src/sys/unix/epoll.rs , and tokio uses mio.
>>62869300
There are no generics here tho.
>>
>>62869300
How so? I don't know much about Rust in general; are generics the problem here, or lifetimes?
>>
>>62869334
>no one uses poll and select anymore
You just exposed your lack of experience in linux system programming, gg. Come after class so grandma can teach you how to program.
>>
In a curses program, I have
main_win = newwin(LINES-1, COLS, 0, 0);
stat_win = newwin(1, COLS, LINES-1, 0);

but nothing is showing up when I output to main_win. stat_win works as expected.
Do I have to do anything with stdscr beforehand? At the moment I'm just writing to stdscr, but calls to clear() also clear stat_win, which deletes any status messages before I can see them unless I block with getch() or something first.
>>
I am going to start writing a MIPS assembler. I am already familiar with the architecture and its instruction set, having worked with it in the past and programmed directly in assembly, my only question is... what's the correct layout for the .data section? Ho am I supposed to translate those declarations in binary?
>>
>>62869359
Oh, right, let me correct myself - only retards use poll and select on Linux right now.
>>
>>62869359
>>62869394
You guys appear like you know what you're talking about. Maybe you can bless me with a quick "poll vs epoll vs select" post?
>>
>>62869176

Languages really exemplify the whole "worse is better".

If you ask anyone who's studied the matter reasonably for an objective worst language in general use, you'll be pointed at Javascript or PHP. But these languages run the vast majority of websites.

Answers on "best" languages would be more varied, but when people describe Haskell, oCaml, F#, or Clojure, they are talking about languages just about never used in business.
>>
I think I'm just going to kill myself. I no longer feel motivated to do anything programming related either from lack of investment or my shitty vision making using a computer annoying. All the jobs on offer are shitty web dev or application dev with C#/java. I don't have any other interests or hobbies. Even if I got a job I'd never spend the money.
>>
>>62869411
https://jvns.ca/blog/2017/06/03/async-io-on-linux--select--poll--and-epoll/
>>
>>62869176
Just use C++ while keeping the clusterfuck to a minimum. It can get insane if untamed, I'll give you that, but it's IMHO still the most versatile language if used correctly. STL containers alone are a perfectly valid reason to use C++ over C.
>>
>>62869334
Yes, and 80 lines is not needed for that. Not close.
>>
>>62869125
>piston
Are you doing gamedev?
>>
>>62869466
Yep
>>
>>62869125
I found piston to have terrible documentation. Did this change?
>>
>>62869077
/* Act like "true" by default; false.c overrides this.  */
#ifndef EXIT_STATUS
# define EXIT_STATUS EXIT_SUCCESS


WTF. So "false" is just "true" with a compile option. Couldn't you just read argv[0] and work this out at runtime or something?

https://github.com/coreutils/coreutils/blob/master/src/true.c#L38

>Those six lines of indenting

 if (STREQ (argv[1], "--help"))

Did they.. did they need a macro to replace strcmp()?


initialize_main (&argc, &argv);
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);


What are these memes?


/* Note true(1) will return EXIT_FAILURE in the
edge case where writes fail with GNU specific options. */


I'm fucking dying
>>
>>62869387
look at what a comppiler shits out
>>
File: 1507089847868.png (1.38 MB, 1920x1080)
1.38 MB
1.38 MB PNG
>2017
>C++ does
>not
>have
>ranges
>>
>>62869479
I'm not sure (since I can't even get the libraries to compile so I didn't do much with it) but so far the documentation isn't that great. I'm coming from SFML which has much better documentation so it's a bit frustrating.
>>
>>62869504
C++17 on the horizon though, let me find the doc...
>>
>>62869176
Why do you want a "good" language?
>>
>>62869528
I mean C++20 ffs
>>
>>62869548
C++20 is over-hyped.

The modules TS, currently is a joke. Better off writing old #includes instead because the C++ modules brings close to nothing new to the table.

C++ will never have a standard build system. C++ will never have a standard package management system.

Range v3? I saw what it is. If you don't adopt UFCS (which not going to adopted), there is almost no point in having ranges.

Even after that, the C++20 update will be a broken ass update and it'll take C++23 to fix all those. Remember C++11?

Why can't there be the perfect language?
>>
>>62869595
because nobody cares about making a "fixed" C++ apart from the faggots who believe fixing it involves adding a GC
>>
What's an actual, relevant piece of software I could develop in my free time using C++?
>>
>>62869595
>standard build system
>standard package managing system
Cmake is the standard where I am.
It supports modules just fine, no need to involve C++ in that shit.
C++11 is a fine language, bitching about it probably means you are one of those people who claim they love science.
>>
>>62869504
I think at this point, there are really only three options:
1. Use a library like boost or ranges.
2. Roll your own range code to be compatible with STL iterators (just something to emulate python's range(...)).
3. Do something like
std::array<int, N> arr; std::iota(arr.begin(), arr.end(), 1);

and hope for the compiler to optimize it away (the most pajeet tier option).

>>62869595
>>62869548
I'm looking forward to/hoping that there are metaclasses. Those seem fun and interesting. C++17 really made template metaprogramming much more bearable with fold expressions and structured bindings.
>>
>>62869667
>Cmake is the standard where I am.
Where in the standards does it say that CMake is the standard? Also, I'd rather start fire with rocks rather than use CMake abomination. You need a proper project manager, like cargo, pip, or dub. Bjarne wants this done but won't do anything about it. Because he knows people would rather use VS instead of shitmake.

>bitching about it probably means you are one of those people who claim they love science.
What is that supposed to establish?
>>
>>62869667
>one of those people who claim they love science
This so much lol.
>>
Any Javafags here? I want to kick your ass
>>
>>62869721
I just checked a bunch of projects in my field, they all had a CMakeLists.txt in their project, you can use whatever you want.
I agree that cmake is a pain to work with, but you just need to learn how it works and then it is fine. (just like any other tool).
I also write a lot of projects that use ROS and they use catkin which is basically a nice interface for cmake.
I have never used VS, but it might be the only IDE that doesn't make it easy to use cmake.
As I see it, you can learn to write cmake in a day, then writing it manually is fine.
If anything, I would love to see improvements in cmake so it could become the standard.
There are so many ways to use cmake, so a standard way to include a library or module would be great.
>>
>>62869825
>would love to see improvements in cmake so it could become the standard
Not taking years to build a new release would be a good start.
>>
>>62869813
umm yes kick me daddy
>>
>>62869813
What's your favourite lang?
>>
>>62869825
If ISO C++ drops the new build2 system in favour of shitMake, I will quit my job and kiss C++ goodbye. Plain and simple.

FUCK Cmake.
>>
>>62869848
>>62869852
Hope you're ready to get beat up nerds
>>
why does this eat an entire core?
while true:
for i in ["/","-","|","\\","|"]:
print "%s\r" % i
>>
>>62869937
>Python
>>
>>62869237
>>no libraries for linux system programming
>systems programming
>libraries
LMAO nigger just make them syscalls yourself you fucking faggot.
>>
>>62869903
Just fuck my shit up, daddy!
>>
>>62869937
>why does an infinite loop without blocks on disc or network IO eats an entire core
Gee, I wonder.
>>
>>62869176
>I'd love to use .Net Core with GTK on Linux)
Please. If you are planning to use .NEET don't come to linux. For good reasons, we don't want them
>>
>>62869953
i made a typo, the "true" is supposed to be "True"
and yes its python 2 code taken directly from LPTHW, a somewhat /g/ approved tutorial book
>>
When describing your project on a portfolio, is it ever necessary to talk about any of the actual implementations you've made?
For example would you mention the use of operator overloading in C++ as part of the design of it?
>>
How could I go into a program that is given a name, googles for an image of that name, and stores it in my pc.
>>
>>62870064
Sure, if that implementation makes it stand out in some way. So no, I wouldn't mention operator overloading, because it's C++ 102 material.
But if you can say something like "fully asynchronous backend", then definitely do.
>>
>>62870115
Google probably has an api
>>
File: 1506518724786.jpg (58 KB, 551x551)
58 KB
58 KB JPG
>>62869969
>zed shaw
>approved on /g/
>>
>>62870064
You don't write about what you did, you write about what you achieved. It's a subtle difference.
>>
>>62869969
>and yes its python 2 code taken directly from LPTHW, a somewhat /g/ approved tutorial book

HAHAHAHA
>>
>>62870142
I've heard and seen those in action, but I am not sure if one should pay for it.

And I've tried checking it out and creating an account but it just.. asked me for a credit card number.
I'm not so sure..
>>
>>62869643
Define relevant.
>>
>>62870171
https://wiki.installgentoo.com/index.php/Programming_resources#Python
its on the /g/ programming books section. listed last and probably least but I've got a copy nonetheless and I intend to give it a read
>>
>>62869643
OS, compiler, game engine.
>>
>>62870196
Just don't listen to him on the subject of C.
>>
>>62870233
thanks for the suggestion, i have K&R for that. plan on getting into that after i finish this
>>
and heres something i like to do is make a simple proportion calculator. babbys first babby scripts
print "Format is a/b = c/x\n The script calculates for X"
print "integer for a:",
a = int(raw_input())
print "integer for b:",
b = int(raw_input())
print "integer for c:",
c = int(raw_input())
x = b * c / a
print "%i / %i = %i / %i" % ( a, b, c, x)
print "x = %i" % x
>>
Is there ever a reason why C++ classes shouldn't be inherited as virtual all the time?
So for example if C1 is inherited by C2 and C3, then C4 inherits both C2 and C3, that'd cause the issue where virtual would be needed. But why isn't that always the case? Is it just a legacy issue?
>>
>>62870344
Big class hierarchies are a thing of the past. Also composition over inheritance.
>>
>>62870344
>C1 is inherited by C2 and C3
STOP RIGHT THERE, MULTIPLE INHERITANCE FAGGOT
>>
Okay, so my ISP provide me a router, which only let's me connect through a NAT pool using PPPoE.

I would like to know if I can bypass this and let anyone on the internet access my pc.
I can access my router's admin site in LAN, and change it. But when I remove the NAT pool feature to that network, i cannot receive a WAN ip. Maybe some kind of proxy or something. Or another router in the middle.

I can also edit the network, I can select PPPoA, 1483 bridged, MER, or routed.
and IPoA.

Any ideas?
>>
>>62870344
Because "virtual" makes things slow, you should avoid using "virtual" in the first place. Oh, and multiple inheritances should be avoided even more so.
>>
>>62870183
>paid
then just parse the html from a normal search
>>
File: 4vGKP16.png (73 KB, 682x631)
73 KB
73 KB PNG
>rustc is actually a collection of C++ preprocessor macros
At last I truly see.
>>
if your lang has let or var its shit
>>
>>62870551
Nice joke. There are retards that'll actually buy this shit too
>>
>>62870567
mine has auto
>>
>>62870551
What is that picture supposed to establish?
That's not ``C++ processor macros``.
>>
>>62870368
>>62870375
Is multiple inheritance a relic of the past then?
>>
>>62870604
yes, you won't see it anywhere nowadays
>>
https://users.rust-lang.org/t/its-gfx-rs-all-the-way-down/13339
>>
Is there a way to bypass the NAT pool my ISP puts me in?
>>
Maybe I'll try in a different way.
For my router to connect into the network, It must have Network Address Port Resolution (NAPT) enabled.

I would like to bypass this or do something so that my IP (my pc) gets to be accesible to the internet.
I would like to deploy a server using DDNS, specifically No-ip2.
Help plz.
>>
>>62870664
Network Address Port Translation, sorry. (NAPT)
>>
>>62870677
sorry man you might have better luck in >>>/wsr/
>>
>>62870664
Port forwarding is what you want, or connect PC directly to wall.
>>
>>62870115
there has to be an api for that, google loves making apis for everything
>>
>>62870698
thanks
>>
>>62870764
They changed that api and I think the search one to subscription only.
>>
>>62870764
and abandoning them shortly after
>>
Oh my, Steve Klabnik answered to me on reddit.
>>
>>62870567
I do agree
>>
>>62870788
literally who
>>
Why do I see quotes in text written like this in K&R?
``...'' (backticks and double single quotes)
instead of
"..." (double quotes)
for example
``an unambiguous and machine-independent definition of the
language C''
>>
>>62870918
Because the book is from the last century
>>
>>62870918
Don't you have anything else to worry about?
>>
>>62870918
Because " and ' used to be slighted to the right in some old X11 fonts.
>>
File: discount.png (242 KB, 1921x1080)
242 KB
242 KB PNG
I'm having some bother on this programming task, could somebody please give me a hint? I'm not asking you to do my work for me. when a quantity is entered e.g.20 "invalid input" is returned
>>
If I statically link a binary, will I still have libc dynamically linked? Can I link in libc as SCU (
#include <stdio/printf.c>
instead of
#include <stdio.h>
) without having to edit the standard library?
>>62871194
You've flipped the < sign on line 18 around.
>>
>>62871217
I'm a fucking idiot, thanks for that. Programming fascinates me yet confuses me so much. Can't wait until I git gud.
>>
>>62871194
To start off, you need to post code to a codepad / gist.github / whatever. Then ask a specific question.

For this particular problem, learn how to use your debugger. Set a breakpoint and step through your code.
>>
I'm programming in C# Wpf and named a KeyUp event "KeyUp" it gave me a warning that I shouldn't do that for obvious reasons. I changed it but I cant compile t anymore since it gives me this error: "The event 'UIElement.KeyUp' can only appear on the left-hand side of += or -=" if I click it nothing happens (It should tab me to the error) and it's also not an error in my code but in MS autogenerated stuff. So my question is obvious: Why am I still fucking using Microsoft once and once again they prove that they can't do anything right, they fucked up everything buy hiring shitskins and sjw. What linux distro should I use that looks like Windows but with the bonus of actually working?
>>
File: 1507207686253.gif (3.27 MB, 483x351)
3.27 MB
3.27 MB GIF
>mfw went from programming at 1366x768 to 1920x1080
>>
>>62868640
0/10
it only considers the first argument and it doesnt implement --help and --version options
http://www.gnu.org/software/coreutils/manual/html_node/yes-invocation.html
>>
I started out with C a few weeks ago and I really wonder:

Why is C programming so goddamn /comfy/?
>>
>>62871553
Because it makes you feel like you're still in the 90s.
>>
>>62871553
Because it's pure. Just look at the mirai botnet source code and tell me that's not comfy.
>>
What language has the highest percentage of white people?
>>
>>62871664
C
>>
File: 1506458370855.png (40 KB, 467x400)
40 KB
40 KB PNG
Any idea how can I create a deck of cards with this?
enum Suit { CLUBS, SPADES, HEARTS, DIAMONDS };

enum Value { ACE = 1, JACK = 11, QUEEN = 12, KING = 13 };

struct Card {
Value v;
Suit t;
bool opened;

// initializes a closed card
void init(Value _v, Suit _t) {
v = _v;
t = _t;
opened = false;
}
}

I have something like this, but it doesn't work because i and j aren't of type Value and Suit. I have no idea what to do here.
void Game::create_deck() {
for (int i = 0; i < 13; i++) {
for (int j = 0; j < 4; j++) {
Card card;
card.init(i, j); // this doesn't work
deck.push(card);
}
}
}
>>
>>62871664
>>62871668
Actually I take that back. Common Lisp is the whitest language.
>>
File: bjarne2.jpg (25 KB, 293x324)
25 KB
25 KB JPG
>>62871664
c++
it's got the P H E N O T Y P E
>>
>>62870551
Now do an implicit return in the first function
>>
>>62869479
piston has good docs wtf
>>
>>62871553
C is only "comfy" for FizzBuzz
>>
>>62868621

var pins = [
[1, 4, 4, 1],
[1, 2, 3, 1],
[2, 6, 0, 8],
];

Can a good Javascript web dev help me with this: I need to single out each of those numbers from each array...inside the other array so I can test to see if they are odd or even. So I can find which one of them is has no odd numbers.

Thank you in advance, an anon really helped me yesterday so hopefully I'll get a hand again
>>
>>62871719
t. rust shill who has never used the language.
>>
>>62871725
nested for loops?
>>
File: diversity.png (136 KB, 1222x550)
136 KB
136 KB PNG
>>62871664
Rust, this is why they are so interested in diversity, to begin with.
>>
>>62871745

You mean:
for([1,4,4,1])...
for([1,2,3,1])
?
Testing them all one by one?
>>
>>62871749
the majority of /g/ is a "minority" according to this
>gay
check
>political beliefs
check
>underage
check
>neets
check
>autism, mental illness
check
>programming socks
check
>>
>>62871553
Go is /comfier/ :)
>>
>>62871664
A line of C a day keeps the women and pajeets away.
>>
>>62871794
>projecting this hard
>>
>>62871749

Why can't they just admit that minorities aren't smart enough?
>>
>>62871788
No, iterate the child arrays.
>>
File: 1477649514690.png (54 KB, 888x434)
54 KB
54 KB PNG
>>62871814
>>
>>62871788
i mean like
    for (int i = 0; i < arrA.length; i++)
for (int j=0; j < arrB.length; j++)
arr[i][j]

>>
>>62871815
well there is a reason why they are the minorites though.
natural selection at work
>>
>>62871679
dunno try casting it to the enum
>>
>>62871733
Nah; I was actually working on a menu system game in rust playing around with piston and I found the doc to be better than Love2D's
>>
>>62871821

Thank you for the help, but I'll I've learned so far is For, While, If/else so you are probably much more advanced than me (miles probably) and I have no idea of what you are talking about.
>>
>>62871815
That would be a PR disaster. Why do that if you can have your PR person(female ofc) talk about diversity all the time while you keep the core team 100% white and male.
>>
>>62871850
menu system for games*

in order to learn the language.
>>
File: 01239012930123.png (29 KB, 741x568)
29 KB
29 KB PNG
>>62871749
>woman or perceived as a woman
it's not even funny anymore
>>
Who Sepples 2: Sepples harder, here?
https://en.wikipedia.org/wiki/JAI_(programming_language)
>>
>>62871903
>wants to make a better language than C++
>it's still a clusterfuck of punctation and complicated exceptions
>>
>>62871903
Hi, Jonathan. No, I'm not going to waste my time and give you money by watching your twitch streams. Well, until you start streaming PUBG or something like that.
>>
>>62871871

Because it's wasted time & money.
>>
>>62871927
he streamed pubg for like a month straight
>>
>>62871843
arrA and arrB are the first and second arrays (respectively) inside the pins array?
>>
>>62871941
> time
Whose time, the PR lady's? Who cares.
> money
Barely any in comparison to the salaries Mozilla pays to the (white male) Rust developers it employs.
>>
>>62871965
yeah but thats just pseudocode
>>
what benefit does recursion have over loops?
>>
i'm working on a ray tracer in C, what is the best way to parse a CSV file?? i've been looping thru using fgetc but i'm having such a hard time i think i'm actually retarded
>>
>>62872070
Some algorithms are easier to express via recursion. You should never use it in practice tho, unless it's a tail recursion and your compiler supports TCO.
>>
>>62872106
>You should never use it in practice tho
if your algorithm requires an incremental stack you should just make it recursive instead of implementing your own stack within in a loop
>>
>>62872084
I use fgets and parse a line at a time
>>
>>62872152
No, you should not, the default stack size for a linux thread is 8Mb only, and it can be configured to be even less than that, while an explicit stack data structure on the heap can use all the memory you have.
>>
>>62872106
>You should never use it in practice tho
Found the webdev. If you never have to use recursion, you're almost certainly not doing anything worthwhile.
>>
>>62872229
>8Mb only
you act like that's small, thats still millions of recursions
>>
https://github.com/ghc/ghc/blob/master/libraries/ghc-prim/GHC/Tuple.hs

he babbys rate my tupel implementation
>>
>>62872084
Use a library and include it in your source tree and #include the .c files. There's probably some very good one around, I always hate doing this kind of stuff in c.
>>
>>62872229
Why are program stacks so small?
>>
>>62872304
thats not small at all, local variables dont use much memory
>>
>>62872249
I do high-throughput network stuff in C++, so I care about performance and memory usage. Sometimes I design a solution recursively and then code it iteratively because I can't risk overflowing the stack and can't afford the price of repeated function calls performance-wise.
>>62872252
>every recursion is a factorial
No, it's not, each recursion cycle can use a lot of stack space, and the problem itself can be huge.
>>62872304
Because C won and Forth lost. Overwise we would have infinite stacks, several of them, and no heap.
>>
>>62872364
If you're using a shitlang that won't let you put arbitrary datatypes in your stack.
>>
>>62872285
>{- Manuel says: Including one more declaration gives a segmentation fault.
>>
>>62871903
Sepples2 already failed

http://users.monash.edu/~damian/papers/HTML/ModestProposal.html

Was good proposal at the time. Dated now because C++ has added so much.
>>
>>62872367
>each recursion cycle can use a lot of stack space
>can
most of the shit people use recursion for doesn't, if what you're doing would use alot of stack space then obviously you shouldn't be making it recursive
>>
>>62872285
Do i see that right that haskell can't have tuples with an arity > 62?
>>
>>62872423
Reworking the syntax of a language never succeeds. It just manages to completely break compatibility and doesn't fix more fundamental issues.
>>
Best way to grasp and understand Big-O notation? My discrete professor is very not good at explaining it
>>
I'm trying to compile something by manually including all the .c files. Is there some tool to do this automatically by compiling, grepping for missing symbol errors, finding where said symbol is defined, and #including it?
>>
>>62872479
Look up articles on Complexity Theory.
>>
>>62872479
You need to do something (what's between the parantheses) times, where N is the amount of something else (usually input data)
>>
>>62872285
>>62872449
Aren't tuples just cheat for the lack of multiple return values?
>>
>>62872285
Yeah, I have encountered that abomination. I used up to 'z' in a tuple based library and decided that anyone who needed more could add the fucking thing themselves. Subsequently, I dropped Haskell and now do most of my projects in a scheme dialect.
>>
>>62871832
The "male brain theory of autism" is so widely discredited it's not even funny. Anyone could see it's not true of course; is an autistic dude your image of stereotypical manliness? Obviously not.
>>
>>62872503
If you have tuples and pattern matching, then there's no need for multiple return values. Example:
fn foo() -> (u32, bool) {
(12, true)
}

fn main() {
let (a, b) = foo();

assert_eq!(a, 12);
assert!(b);
}
>>
>>62872535
>is an autistic dude your image of stereotypical manliness
a sterotypical image of what constitutes an attractive man isn't the only type of masculinity
thinking logically instead of emotionally is masculine
being an autistic programmer to men is what being a cat lady is to women
>>
>>62872481
just write a makefile already
>>
>>62872609
Don't write makefiles. Write a makefile.am and a configure.ac
>>
>>62872503
> Aren't tuples just cheat for the lack of multiple return values?
It's actually the exact opposite, m8.
>>
>>62872479
https://www.youtube.com/watch?v=RJhZ5SD1AvY
https://www.youtube.com/watch?v=23btiMw7SqY
>>
>>62872609
No, what I want to do is, I have two projects, musl libc and sbase. I want to compile a binary from sbase and include the standard library. Not statically link it, I want it integrated at compile-time, but the same results (flat binary).
So I've edited yes.c to begin like this,
#include <multibyte/wcrtomb.c>
#include <string/memchr.c>
#include <string/memset.c>
#include <math/__signbitl.c>
#include <math/__fpclassifyl.c>
#include <math/frexp.c>
#include <string/strnlen.c>
#include <errno/strerror.c>
#include <multibyte/wctomb.c>
#include <internal/syscall_ret.c>
#include <stdio/__stdio_close.c>
//#include <exit/exit.c>
#include <errno/__errno_location.c>
#include <internal/libc.c>
#include <thread/__wait.c>
#include <thread/__lock.c>
#include <stdio.h>
#include <stdio/__stdio_write.c>
#include <stdio/__stdout_write.c>
#include <stdio/__stdio_seek.c>
#include <stdio/ftrylockfile.c>
#include <stdio/ofl.c>
//#include <stdio/fclose.c>
//#include <stdio/fflush.c>
#include <stdio/stdout.c>
#include <stdio/__stdio_exit.c>
#include <stdio/__lockfile.c>
#include <stdio/__towrite.c>
#include <stdio/funlockfile.c>
#include <stdio/__overflow.c>
#include <string/memcpy.c>
#include <string/strlen.c>
#include <stdio/fwrite.c>
#include <stdio/fputs.c>
#include <stdio/fputc.c>
#include <stdio/putchar.c>
#include <string/strncmp.c>
#include <stdio/vfprintf.c>
#include <stdio/fprintf.c>
#include <stdio/perror.c>
#include "libutil/eprintf.c"
#include "util.h"
#include "arg.h"

This is obviously tedious, and I get some conflicts:
In file included from ../sbase/yes.c:33:0:
./src/string/strlen.c:5:0: warning: "ALIGN" redefined
#define ALIGN (sizeof(size_t))
^
In file included from ../sbase/yes.c:3:0:
./src/string/memchr.c:6:0: note: this is the location of the previous definition
#define ALIGN (sizeof(size_t)-1)

This is presumably since they reuse identifiers, can I auto-rename them to avoid this conflict based on what-includes-what heuristics?
>>
>>62872645
Don't write makefile.am's and configure.ac's. Write configuration files for actually good build tools.
>>
How come an average programmer only produces 20 lines of code a work day? Isn't this very low? I'm just a novice, but it seems like you'd be able to produce more (good) code than that in a work day, since that works out to about 2.5 loc/hour which seems abysmally low.
>>
>>62872687
because writing code is 10% of programming, the other 90% is figuring out what code you need to write
if you're doing alot of typing and not alot of thinking then you're just doing data entry really
>>
File: urhkmezc0vnz.png (1.03 MB, 1200x1198)
1.03 MB
1.03 MB PNG
Rust 1.21 is out: https://blog.rust-lang.org/2017/10/12/Rust-1.21.html , kinda boring release.
>>
>>62872503
tuples are better than multireturns, because they represent a first class datatype
>>
Why are most rustlets vimcucks?
>>
when implementing hashtable. I have basically just store 2 different hashes to lesser the collision change. The other option would be to store the key to the slot but that would require extra malloc + free for every used slot or having fixed max length for key.
What to do?
>>
>>62872761
Vim is quite popular overall, it's just a reflection of that.
>>
>>62872761
because only transvestites use it.
>>
File: books.jpg (218 KB, 450x735)
218 KB
218 KB JPG
>tfw valgrind clean
>>
>>62872797
>his language doesn't have borrow checker, so he has to use valgrind
Sucks to be you.
>>
>>62872762
Store a longer key instead of 2, same exact thing.
>>
>>62872761
>atom
>vscode
>>
>Be retarded
>Still can't figure out how to stop my while loop that parses text from html pages after it reaches the end in Java
>>
>>62872823
>his language uses unsafe blocks
>his language has COC
>his language isn't even mature
dumb nu-male poster
>>
>>62872666
Bumping this.
>>
>>62872666
why do you want to integrate it at compile time?
You can also have gcc do link time optimization if that's what you're after
>>
>>62872856
have you tried reading the documentation
>>
>>62872873
Because LTO is slightly worse than SCU, as I understand it. I want the equivalent of a static binary compiled with LTO though.
>>
File: Sophie_Wilson.jpg (291 KB, 640x426)
291 KB
291 KB JPG
>>62872863
>he doesn't like unsafe immature CoCs
I bet you're not even wearing programming socks right now.
>>
>>62872889
Yes.
>>
>>62872915
>>>/lgbt/
>>
>>62872926
have you tried reading the documentation while actually comprehending what you're reading?
>>
>>62872891
I'm not aware of a tool for this
for macros and static functions defined in the .c files I think you could get away with some scheme like appending the filename to all macros and functions, ie replace ALIGN with ALIGN_memchr in memchr.c
That should be possible to do (semi) automated
That might even be enough since I don't think two files will have equal symbols that are visible outside their respective compilation units, might be wrong though
>>
>>62872945
I try.
>>
>>62872995
But if it #includes a header, you need to either replace that with all the .c files or dynamically find where a certain name is defined. And if file A defines something, then includes file B that uses said macro, then that won't work.
>>
>>62868621
Learned what sorted does.
Makes my life a hell of a lot easier :)

thank you anonymous user.
>>
>>62873018
What exactly are you using to read the data?
>>
>>62872687
It depends on the task you were given. If you have to fix a buggy as hell project you spend most of your time trying to understand what is going on and why. If you shall write someting from scratch you hopefully write more code per day.
Also consider >>62872704 as a good answer.
>>
What's the best way to deal with roasties asking you for advice?
>tell them to go read the docs in a polite but terse manner
this is what I do now
>intentionally give them bad advice that gives them bad habits but compiles
if they fail something because of it they might tell the professor who assumes i was giving what i thought was good advice, and i obviously can't correct him
>tell them to fuck off impolitely
will cause too much trouble

Any other options?
>>
How do I free memeroy* on a system with no MMU?

*not a mistake, memeroy is in fact what i meant
>>
>>62873115
tell them you're gay and you hate women and hopefully you'll get fired
>>
>>62873115
>they might tell the professor who assumes i was giving what i thought was good advice
"Prof! I asked Anon to do my homework for me and then he told me to do XYZ and it didn't work! Please punish him"
This would never happen. If you want to fuck with them go ahead but they'll probably come back to you when they have more problems

>Any other options?

>give them the most terse almost-answer you can think of
"Anon how do I execute a program on linux in C?"
"Just call fork(), and then pass the process as an argument to execv()"

>tell them you're busy
This usually doesn't work unfortunately
>>
>>62873047
well yeah it only works for stuff that's in .c files, not for macros in headers
Maybe you could try running all your .c files through the preprocessor first, and then including the resulting intermediate files, which would take care of all macro collisions. Since you can declare stuff twice if it's the same (iirc), having multiple copies of headers shouldn't matter. If the headers contain definitions that may be a problem. However, since (atleast gcc -E) leaves a comment about where which file begins, maybe you could cut all the headers away and just include each once right at the start of your program
>>
>>62873117
Don't you just do whatever the fuck you want if you don't have MMU? Like, who is going to stop you?
>>
>>62872761
Ah, feels good to be a part of Rust+Vim master race!
>>
>>62873117
Just use forth
>>
>>62872666
>name conflicts in #defines
You're pretty much fucked, and this is entirely C's fault. You can try #undef'ing them, but if they have the same name and different values, then you're exceptionally fucked
>>
>>62872666
>The power of #includes
Enjoy
>>
>>62872599
>being an autistic programmer to men is what being a cat lady is to women
I wasn't talking about attractiveness, and autistic thinking is only "logical" on the surface (I have autism and struggle every day with the irrational, self-defeating conclusions my brain insists on drawing), but I love this comparison. I would go so far as to say that a lot of cat ladies probably have undiagnosed autism, since the condition is much less well understood in women.
>>
>>62873148
>fired from university
>>62873172
Well, the point is giving bad advice that still works, like introducing memory leaks, buffer overflows, undefined behavior, O(n^n) behavior where possible, etc. If they tell the professor they got help from me (or other people), they might get the impression I'm extremely incompetent.

Almost-answer is a bad idea, it might cause them to learn something and will point them in the right direction. Ignoring them is trivial.
>>62873179
Hmm, that's a reasonable idea. For each "compilation unit" run preprocessor, then rename each variable name to a random value, then #include them.
>>
>>62873288
Very irrational, anon.
>>
saw a method in some code that looks like this
private void mainLoop() {
this.messageListener.start();
this.queueListener.start();
this.messageListener.join();
this.queueListener.join();
}


why would you start a thread and join them after that?
>>
>>62873288
>rrational, self-defeating conclusions my brain insists on drawing
thats not autism, that's anxiety or depression. it's possible to have both. cat ladies are the opposite of autistic. They have too much empathy instead of too little.
>>
>>62873308
if you do manage to get that stuff running I'd love to see some benchmarks against just using LTO
>>
>>62873326
The first join will block as long as messageListener thread runs, effectively blocking the main thread and stopping the application from terminating. Then once the thread doesn't do work anymore, it'll unblock, queue will join, and the program will terminate.

Essentially it waits for the threads to finish.
>>
>>62873326

To stop the main thread from exiting.
>>
>>62873308
>they might get the impression I'm extremely incompetent.
...If you want the professor to think you're competent then just show the professor that you're competent.

>>62873308
>then rename each variable name to a random value, then #include them.
Sounds like you're trying to invent hygienic #include, lol. Also the 'static' keyword in C assumes that different .c files are part of different compilation units, so you might have to deal with that as well. Moral of the story is that what you're doing is not at all how C is supposed to work.
>>
>>62873358
>They have too much empathy
This is one of the current theories of autism FYI

>thats not autism, that's anxiety or depression. it's possible to have both.
Autism on the higher functioning side is almost always co-morbid with a combination of anxiety, depression, and ADHD-like brain activity. Anxiety and depression in patients with autism is sometimes treated with stimulants for example, which is pretty much the opposite of what they would give to a non-autistic person (serotonin reuptake inhibitors, benzos, etc.).
>>
>>62873326
could you just use queueListener.run() here to get from 3 threads to 2?
>>
>>62873399
I dont know, I can't see a person with autism having too much empathy when they have trouble reading others or even acknowledging they exist in full-blown cases
>>
>>62873402
>queueListener
don't know, this is a java program btw

class messageListener extends Thread { }

class queueListener extends Thread { }
>>
>>62873427
I could talk about my individual experiences, but it's not just me

https://spectrumnews.org/opinion/viewpoint/people-with-autism-can-read-emotions-feel-empathy/
>Many of these individuals said they experience typical, or even excessive, empathy at times.
>One of our volunteers, for example, described in detail his intense empathic reaction to his sister’s distress at a family funeral.

https://www.thedailybeast.com/a-radical-new-autism-theory
(That's "new" 8 years ago, so not so new anymore...)
>A groundbreaking study suggests people with autism-spectrum disorders such as Asperger’s do not lack empathy—rather they feel others’ emotions too intensely to cope.
>Virtually all people with ASD report various types of oversensitivity and intense fear.
>The Markrams argue that social difficulties of those with ASDs stem from trying to cope with a world where someone has turned the volume on all the senses and feelings up past 10
>>
I'm looking for a good configuration file format for my program. This what I've come up with. Which one looks best, or are there any suggestions?
1.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<reddit>
<subreddit>foo</subreddit>
<subreddit>bar</subreddit>
</reddit>
<rss>
<url>http://foo.com</url>
<url>http://bar.com</url>
</rss>
<console format="$NAME\n$URL\n$DESCRIPTION" />
<mail host="smtp.foo.com" port="25" />
</config>

2.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<reddit>
<subreddit>foo</subreddit>
<subreddit>bar</subreddit>
</reddit>
<rss>
<url>http://foo.com</url>
<url>http://bar.com</url>
</rss>
<console>
<format>$NAME\n$URL\n$DESCRIPTION</format>
</console>
<mail>
<host>smtp.foo.com</host>
<port>25</port>
</mail>
</config>

3.
reddit.subreddits=foo,bar
rss.urls=http://foo.com,http://bar.com
console.format=$NAME\n$URL\n$DESCRIPTION
mail.host=smtp.foo.com
mail.port=25

4.
reddit=foo,bar
rss=http://foo.com,http://bar.com
console=$NAME\n$URL\n$DESCRIPTION
mail.host=smtp.foo.com
mail.port=25
>>
>>62873524
Personally I like TOML, it's like INI on steroids.

[reddit]
subs = ["foo", "bar"]

[rss]
urls = ["foo.com", "bar.com"]

[console]
format = "..."

[mail]
host = "..."
port = "..."
>>
File: 1507308970511.png (18 KB, 190x175)
18 KB
18 KB PNG
Does anyone know how to cause buffer underwrite in C?
>>
>>62873548
yes, start with a negative offset
>>
>>62873542
TOML is nice, but library support is pretty bad.
>>
>>62873524
(config
(reddit
(subreddit "foo")
(subreddit "bar"))
(rss
(url "http://foo.com")
(url "http://bar.com"))
(console (@ (format (lambda (name url description) (string-append name "\n" url "\n" description)))))
(mail (@ (host "smtp.foo.com") (port 25))))
>>
>>62873696
you need a library to parse basic text formats?
>>
can anyone explain to me how buffer overflows lead to vulnerabilities
>>
>>62873797
The whole god damn reason to use TOML or YAML or JSON or whatever is so you don't have to fucking write it yourself.
Get a brain, friend.
>>
>>62872441
The problem is recursion always adds extra overhead (unless it is optimized away by compiler). only times you should use recursion is when you have to and you are sure that the depth is limited
>>
>>62873696
https://github.com/toml-lang/toml#user-content-implementations
Looks pretty decent to me.
>>
>>62873797
My goal is not to write a TOML compliant parser, so I don't see the need of writing one myself.
>>62873774
(/ 10 scheme)
I did look at Clojure a while ago, but it never stuck with me. I don't know why though.
>>
>>62873825
There's plenty of toml processors around since literally anyone can make one. I'd worry more about correct YAML or JSON in all of the widespread shit though.
>>
Why is recursion preferable to loops in practice?
>>
>>62873810
Essentially you can inject some code into the stack and modify the RIP to jump into your code and execute it.
>>
>>62873873
It is easier
>>
>>62873825
a parser for any of those formats can be done in like 20 minutes, perhaps you should get a brain
>>
>>62873826
yeah and we should write our programs all in one block to avoid function call overhead right
>>
>>62873915
It's not easier, but it makes the code look cleaner. It's slightly less intuitive to read, so learning materials, classes etc. aimed at beginners make a big deal about recursion. That way people will not be as limited by their linear thinking.
>>
>>62873924
Oh believe me, I'm one of those "I should remake this library/engine/OS/CPU because I don't like it a bit" autists. But one thing I would not waste any brain power on is writing a config file format parser.
It's a solved problem, you'd only be adding more busywork for yourself.

"Code you don't write is code you don't have to maintain"

-- Wise Old Man.
>>
>>62873924
>JSON compliant parser
>20 min
It takes you 20 minutes just to read the spec.
>>
>>62872549
Doesn't seem like a real reason.
>>62872654
This doesn't make sense at all.
>>62872729
Looks like a valid reason.
>>
>>62873975
http://www.json.org/
That is whole json.
>>
>>62873970
it's not even a problem, nothing needs to be maintained, it so simple it's not even an issue, it's like 100 lines of code, if parsing a config file takes brainpower for you then you should do it because you really need the practise
>>
>>62873366
I would too. SQLite does something like this, see https://www.sqlite.org/amalgamation.html.
https://stackoverflow.com/questions/2719311/tool-to-create-an-amalgamation-combine-all-source-files-of-a-library-into-one-fo
Maybe this would work:
>run gcc -E on everything
>locate their header file
>any identifier not in the header file gets replaced with a guid
Thoughts?
>>62873382
See above. 'static' keyword shouldn't be a problem if they're GUIDs, or?
>>
>>62873826
Sometimes there's nothing wrong with adding extra overhead. Some programs only need to run one time, for instance.
>>
>>62873942
no, the compiler generally does this for you when necessary. not always for recursion calls though
>>
>>62873995
ok, so now you have 18 minutes left to write a JSON parser. Go for it boy!
>>
>>62873995
http://seriot.ch/parsing_json.php
>>
>>62874018
you missed the point
optimizations that save a small amount of processing time for a large amount of human effort aren't good programming practise (until you actually need it)
>>
>>62873825
The whole reason to "invent" TOML or YAML or whatnot is because you were unable to use a parser for an existing language so you had to fucking write it yourself.
>>
i need a program that tells me all the urls in a given website, how should i do it?
>>
How fortuitous it is for me to discover this thread at this hour!
I have made the decision to take up the task of learning how to program computers and I have chosen to learn by this book which teaches you the concepts of computer programming with assembly for Intel microprocessors on the GNU/Linux operating system.
Seeing that the other posters in this thread has asked for assistance with their programs, I will do the same.
Attached to this post is an image of the assembly code that I have made.
When the program is executed via terminal, it does not process completely and stops at line 29, according to the GNU debugger, with a segmentation fault error!
Truly, I do not know why this error occurs. I have gone through the program in my mind and, as much as I know about computer programming, it should work! There must be something that I do not have the right idea about, which is why I am asking someone with more knowledge and experience of assembly to aid me in solving my problem.
>>
>>62873524
subreddits = ["foo", "bar"]
rssUrls = ["http://foo.com", "http://bar.com"]
consoleFormat = "$NAME\n$URL\n$DESCRIPTION"
mail = {host: "smtp.foo.com", port: 25}

You should change consoleFormat if you're not using shell variables. This is lua, if you want something less bloated (e.g. it's only a small program) just use json with a similar structure.
>>
>>62874047
curl URL 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2
>>
>>62874047
use any regex parser
>>
>>62873696
TOML would have been better if it didn't include the datetime part and the inline table part.
>>
File: 1499621626413.jpg (76 KB, 1024x1024)
76 KB
76 KB JPG
>>62873997
>nothing needs to be maintained
So young, so naive.
>>
>>62874034
Yeah, such optimizations are only practical when the effectiveness of the program is limited by available computing time. If you're developing a model for some scientific research that is going to get limited runtime on a rented supercomputer, knock yourself out with pursuing minute optimizations for months.
>>
>>62874047
Check for the sitemap.xml and if there isn't one, generate it
https://code.google.com/archive/p/sitemap-generators/wikis/SitemapGenerators.wiki
>>
>>62874089
yes, I wrote my JSON equivalent data parser in about 20 minutes maybe five years ago and I run thousands of files through it and it hasn't needed to be touched since because it's a really fucking simple file format
brainlet programmers I swear
>>
>>62874047
xpath
\\a[@href]
>>
>job application asks for a simple search algorithm on a 2d maze
>people post recursion solutions
Please stop applying here guys
>>
>>62874061
JSON has some nice features. It has plenty of libraries (with support for data (de)serialization) and is less verbose than XML.
My problem with JSON is the lack of embedding comments. The ability to have comments in your configuration file is a big plus.
>>
>>62874065
>>62874070
i mean in an entire site, not just the root url.
i guess i could do what you say recursively for every url i find

>>62874106
holy shit thanks to this i might not need to code anything at all
>>
>>62874171
wget then parse
>>
>>62874171
>i guess i could do what you say recursively for every url i find
You can, but websites won't like this and may not respond in the way you expect. You even run the risk of falling into spam traps and the like.
Using the sitemap provided by the site is the most "polite" thing to do--that's what it's there for, and generating one with a robust tool that is smart enough to follow standards and avoid traps is the next best choice. If you are looking to disobey robots.txt or something this might not help you, but you should probably avoid doing that anyway.
>>
>>62874153
Some JSON parsers respect javascript style comments, but YAML has '#' comments right in its spec.
>>
NEW THREAD!!!

>>62874250
>>62874250
>>
>>62874261
Too soon m8
>>
>>62874153
Just make up your own syntax.
>anything with key="comment" gets ignored
>an array that only contains another array gets ignored
or similar
so you can do
{
"subreddits": [
"foo",
"bar"
],
"rssUrls": [
"http://foo.com",
"http://bar.com"
],
"consoleFormat": "$NAME\n$URL\n$DESCRIPTION",
"comment": "asdasdasd",
"mail": {
"host": "smtp.foo.com",
"port": 25
}
}
>>
>>62874115
Would "floodfill" and a queue (breadth-first) be good enough?
>>
>>62868621
learning .net
>>
>tfw can't grok Rust lifetimes
>>
File: ultimate_rage.jpg (16 KB, 249x229)
16 KB
16 KB JPG
>>62871679
>>62871679
Are you here?
>>
>>62874443
fucking static cast you idiot or use Suit/Value for the loop indice
>>
>>62874429
They're... lifetimes. What's not to get? If you're unsure you can spam the lifetime syntax everywhere. Just denotes that if variable foo exists as a reference to bar then bar must also still exist for the entire time foo is dependent on it. Mostly the compiler does that shit invisibly. It prevents use after free and such memory errors.

Look at any example of that in other langs and you'll get where lifetime is necessary.
global b; 
{
a = "text";
b = &a;
} // a leaves scope and no longer exists
print b;

WHOOPS SHIT IS FUCKED NOW
>>
>>62869037
>python
>safety

rustfags unironically believe this




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.