[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: 383
Thread images: 35

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

http://mattgemmell.com/what-have-you-tried/
http://www.catb.org/~esr/faqs/smart-questions.html

What are you working on ?
>>
File: file.png (56KB, 666x209px) Image search: [Google]
file.png
56KB, 666x209px
FUCK YOU ATOM
>>
What monospace font do you use for coding?
I use hermit https://pcaro.es/p/hermit/

its pretty comfy
>>
i've got to search an ordered list for a number and if it's already there i don't add it to the list. What would be the best way to implement this? The list is made of nodes with that int value and a list type previous and next pointers.

Recursion?
>>
>>57174553
Consolas, all day, every day.
>>
>>57174546
Have you checked the PATH?
>>
>>57174546
> ATOM
> not using jetbrains products in eval('getCurrentYear())'
>>
>>57174546
> cmd
not using glorious zsh

am I in wdg?
>>
>>57174557
I've got ;C:\Python27 in my path, do I need to do it for atom as well?
>>57174567
I like atom because it runs faster than Notepad++ and its pretty sleek
>>
>>57174554
Iterate across the list until you find the number or a larger number. If it's larger insert your number before it.
>>
>>57174553
Fira Code.

>>57174554
>Recursion?
Why not? You could also use a loop though.
>>
>get bugfix request
>pic related

what
>>
>>57174580
I'm not gonna run a fucking virtual machine for some shitcode for learning a roguelike library

I know I should be posting this in AGDG - but the issue is with the IDE, not the code itself
Don't get me wrong. I have Linux machines. I'm just on my Win7 machine right now and don't feel like physically moving over to a Linux machine to develop, since I'm comfy right now
>>
>>57174582
> I like atom because it runs faster than Notepad++ and its pretty sleek

its time to upgrade your thinkpad anon.

>>57174589
ligatures make it harder to read my code for me. Im too used to the old style.
>>
>>57174596
cygwin exists and contrary to popular belief it HAS gotten much better.
>>
>>57174582
You may want to look up and see Atom's docs. Also, try restarting the computer if you've just changed the PATH.
>>
>>57174622
you dont need to restart. just relog.
>>
>>57174601
It's not a thinkpad! It's just a kinda low tier PC
Besides, atom is easier to configure
>>57174619
Every time I try to install and use cygwin, I run into countless problems, like not being able to search for it and find it at ANY time (I don't keep a text document where I have certain programs installed on my drive, and would rather not clutter my taskbar to the point of having a SCROLLING taskbar)
>>57174622
>>57174633
Alright, I'll relog, but I don't think that'll solve the innate issue of not being able to parse arguments through atom cmdline (if there's a way, PLEASE tell me)
>>
>>57174589
Fira code is boss as fuck.
>>
>>57174596
Why aren't you using PyCharm or even VS Code?
>>
>>57174638
use conemu along with cygwin for that stuff.
though cygwin comes with mintty so that should be enough
>>
>ligatures
>>
>>57174601
>>57174648
I like it because the ligatures make coding a bit less boring for me.
>>57174638
File bug? Atom's pretty immature, isn't it?
>>
File: umaru.jpg (282KB, 640x961px) Image search: [Google]
umaru.jpg
282KB, 640x961px
>>57174554
>an ordered list
Then use binary search
https://en.wikipedia.org/wiki/Binary_search_algorithm

>>57174553
https://github.com/belluzj/fantasque-sans
>>
>>57174671
thats what im saying why do we need ligatures?
that shit just makes reading my own code more confusing.
>>
File: file.png (153KB, 631x473px) Image search: [Google]
file.png
153KB, 631x473px
>>57174653
Because this is what I'm greeted with when I go to download it. I don't like hefty things that are "material" and look like they'll put me through a hundred different install screens
>>57174672
Not quite sure what you mean by that. The script package I've loaded, or my files I'm parsing? I'm just trying to run the basic py -2.7 command, which should enter python 2.7 shell for shit, but arguments don't get passed. I can run py, python, python3, etc, but not py -[argument]
>>
>>57174673
>linked list
>binary search
you wot m8?
>>
>>57174690
>2016
>using linked lists
>>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/mman.h>

constexpr ssize_t SIZE = 128 * 1024 * 1024;

template<typename T>
static unsigned char f(unsigned char *p, T i)
{
unsigned char res = 0;
res += p[i + 0];
res += p[i + 1];
res += p[i + 2];
res += p[i + 3];
res += p[i + 4];
res += p[i + 5];
res += p[i + 6];
res += p[i + 7];
return res;
}

template<typename T>
static void bench()
{
unsigned char *map = (unsigned char *)mmap(NULL, SIZE, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

for (int i = 0; i < SIZE; i++) {
*(volatile unsigned char *)(map + i);
}

struct timespec a, b;

clock_gettime(CLOCK_MONOTONIC, &a);

for (T i = 0; i < SIZE / 8; i++) {
__asm__ volatile("" : : "r"(f<T>(map, 8 * i)));
}

clock_gettime(CLOCK_MONOTONIC, &b);

printf("%ld\n", (b.tv_sec - a.tv_sec) * 1000 * 1000 + (b.tv_nsec - a.tv_nsec) / 1000);
}

int main()
{
bench<unsigned>();
bench<int>();
}


74434
38411


Who would have thought that using twice as many instructions makes your code run 2x slower. Surprise surprise (said nobody who knows anything about CPUs.)

(reposted with better templates)
>>
>>57174677
you've reminded me of my hatred for C++.
>>
>>57174686
Have you tried spelling it out, i.e. "python" instead of "py"?
>>
>>57174686
Holy shit, kill yourself.

You're never going to make it.

Also:
python test.py <argument> <argument>
>>
>>57174713
you have again reminded me of my hatred for C++.
>>
File: file.png (7KB, 433x57px) Image search: [Google]
file.png
7KB, 433x57px
>>57174724
>>
>>57174701
>not reading the problem statement
>getting weeny after the fact
>>
>>57174677
What optimizations? I already told you that my f is bigger than my g.
>>
>>57174742
-O3 baisically means "just fuck my shit up"
>>
File: file.png (3KB, 419x41px) Image search: [Google]
file.png
3KB, 419x41px
>I completely looked over "Command arguments" due to the stress I had falsely gained
good job me im fucking gay
>>
>>57174734
>'"python -2.7"'
What's with the triple quoting? Show us what you're entering at the prompt. You're not retarded enough to type
"python -2.7"
, are you?
>>
>>57174742
Shut the fuck up and do your own homework. You must be some retard if you thought that 2x code bloat does not ruin performance. You probably listened to some shill on hackernews who told you that there is no longer a need to use anything but Javascript and Go in the current year because we have hyperthreading, branch prediction, and pipelining.
>>
File: file.png (22KB, 610x285px) Image search: [Google]
file.png
22KB, 610x285px
>>57174774
Eh, no, I'm not. I'm not a beginner to this shit, but I'm more familiar with Linux dev than Windows dev. It drives me crazy, using Windows, but at least I've got a nice chair at my windows machine
>>
>>57174776
javascript is the future!!
>>
>>57174758
Nah, I have just switched to Windows. If you had posted that like 15 minutes before I might have looked into this further, but I don't care enough to analyze this in-depth.

Only the assumption of more code leading to higher execution times is retarded. Feel free not to believe me. I don't care.
>>
>>57174776
>You must be some retard if you thought that 2x code bloat does not ruin performance.
I seriously hope you don't mean this generally.
>>
>>57174776
>wow a retard
>>
OKAY.
It's running, but not in python 2.7
I've set program arguments to 2.7, and COMMAND argument to main.py
Do I still have to put the dash behind 2.7 to get it to work? This progress is making me a little less dead inside
>>
>>57174785
>environment variables
Try that field.
>>
>>57174821
>fuck using a better solution that would solve this issue, install screens are scary :(
>>
>>57174835
apt-get ftw
fuck install screens!
>>
>>57174835
Sorry, I like working in atom. If vim worked well with windows, I'd be using that instead
>>57174827
Trying
>>
>>57174845
>If vim worked well with windows,
but it does
>>
>>57174845
P Y C H A R M
Y
C
H
A
R
M
>>
>>57174690
he said nothing about linked lists
>>
>>57174841
apt a shit though
>>
>>57174845
>If vim worked well with windows

?
>>
File: file.png (21KB, 397x157px) Image search: [Google]
file.png
21KB, 397x157px
>>57174853
My machine is the most glitchy piece of shit known to man, I probably shouldn't be devving on it of all things when I get miscellaneous undocumented errors all the time (I think a stick of ram went bad and my hard drives are failing)
>>57174827
So environment variables worked - despite the error it outputs. The error is linked to SDL2 and libtcod / or python having discrepancies between 64 and 32 bit

Though I'm not sure how to streamline fix this, download all the same bit libraries/python/SDL2 and have it isolated in a specific instance so it doesn't start trying to fall into discrepancies once more
>>
>>57174808
This isn't Stalinist Russia. So what do you think?
>>
>>57174865
see >>57174554
>The list is made of nodes with that int value and a list type previous and next pointers.
>>
>>57174845
>If vim worked well with windows
it does
>>
>>57174878
the fuck has that to do with vim
>>
>>57174785
Are your games free software?
>>
>>57174845
try emacs
>>
>>57174880
https://en.wikipedia.org/wiki/Loop_unrolling
>>
>>57174845
>>57174878
>>57174821
I'm imagining some fucking retarded wallowing around in the mud and stabbing himself in the leg with a fork, all the while complaining that his current situation is less than desirable.

Nigga, step out of the mud. Wash yourself off.

There are modern tools to help you avoid all of these trivial things that you can't seem to figure out.
>>
>>57174546
It doesn't invoke it through shell. Remove the quotes around py -2.7
God it's so silly when they do this
>>
>>57174882
This is a double linked list, not a linked list.
>>
>>57174917
>some fucking retarded
HA, A TYPO
>>
>>57174889
I keep getting crashes with vim
>>57174892
Nope. Of course not, they're bought games, on a WINDOWS machine. That's besides any point, though, get out with that meme you hecking drongus
>>57174903
Not much a fan of emacs, honestly. It seems like it'd be efficient for others, but I found it doesn't jive with me that well.
>>57174925
Please read the thread
>>57174917
Come on, mate. I want to solve an issue, rather than default to giving up and using something else
>>
>>57174926
>a double linked list, not a linked list.
I don't even need to rephrase this to make it sound stupid. It has a typo and everything.
>>
>>57174939
>Nope. Of course not, they're bought games, on a WINDOWS machine. That's besides any point, though, get out with that meme you hecking drongus
You should leave this place then. /g/ is for people that love software freedom, not for people who create non-free software.
You are not welcome here
>>
>>57174939
so on your weird pc vim and notepad++ runs worse than fucking Atom?
I smell bullshit.
>>
>>57174952
It's correct.
>>
File: you-have-to-go-back.gif (348KB, 350x233px) Image search: [Google]
you-have-to-go-back.gif
348KB, 350x233px
>>57174939
>bought games
You have to go back
>>
>>57174939
You should use nice proprietary software like Visual Studio (TM). Free software like vim and python are like a virus.
>>
>>57174713
>Who would have thought that using twice as many instructions makes your code run 2x slower.
instruction count is merely a hint, you need to check the actual instructions to get an estimate of runtime. You can easily come up with single instructions that take longer than functions with 100s of instructions(not doing the same thing, of course).
for example a simple memory read or write can take hundreds of cycles under certain conditions.
>>57174776
calm down m8, your example stands, but there are also examples where unsigned is faster than signed, such as division by 10 or modulo 4
>>
>>57174939
>I want to solve an issue
No, that's what you'd like to think you're doing.

If you wanted to solve your issue, you'd solve the issue.

You might think your issue is "this Atom configuration isn't working".

Your issue is actually "I currently am unable to develop in Python to test this library/framework."

To solve this issue, you can employ modern techniques and tools to cut out some of the in-between.

Look, I know you probably think that you need to be doing everything you can via command line, without those pesky "tools" and "features" getting in the way, but they are there to help you!

Step out of the mud, anon. Use a modern tool, designed to solve your issue quicker and make your life easier.
>>
>>57174959
It's more about workflow than processing ability, but...
>>57174990
>>57174983
meme boys leave
>>57174959
Notepad++ has this issue where it flickers for a minute before opening. Atom opens in 3 seconds flat.
>>57174997
I can't disagree with you, so I'll just call myself retarded and be fine with that fact. Eventually, maybe I'll have a bit of clarity and actually do the right thing, but right now, I want to do the wrong thing, because it's bugging me to shit.
>>
>>57174990
>Free software like vim and python are like a virus.
Not really, only copyleft is.
>>
>>57174993
>You can easily come up with single instructions that take longer than functions with 100s of
Wtf are you talking about. The shitty unsigned code uses literally the same instructions as the int code plus more instructions spliced in between. You don't need to read fucking Agner to know that that's shit code.
>>
File: asdasdasdasd.png (26KB, 639x286px) Image search: [Google]
asdasdasdasd.png
26KB, 639x286px
alright lads i am going to build a software analyser, which of these do you think is most straightforward
>>
>>57175051
Depends. Are you going to do it from scratch or use a parser library, profiler, debugger etc.?
>>
>>57175051
they all seem interesting
>>
>>57175051
Some code metrics are pretty easy (like ratio of comments to source code)
Test coverage shouldn't be too bad
Hot spots/performance bottlenecks obviously requires you to run the software and time it rather than doing static analysis, but other than that is OK.
>>
>>57175014
>Notepad++ has this issue where it flickers for a minute before opening.
for the love of god repair your os
>>
>>57175051
Performance is cool and good to know.
>>
>>57175014
>3 seconds flat
jesus christ
>>
>>57175086
I'd LOVE to know how to.
I've run various MS utilities, CHKDSK (which almost always starts repairing stuff when it's run), system file checker utility (cant recall the name but it scans system32 iirc) sfc scannow or whatever it is. I've done this all multiple times -- sfc doesn't return any issues, chkdsk is the only thing that does
>>57175101
? I mean it is on my SSD but still it's pretty nice and polished innit?
>>
>>57175106
3 seconds is atrocious
>>
>>57175106
Nigger, it's time for an OS re-install.
>>
>>57175075
using javaparser, sorry should have mentioned

>>57175084
i was thinking test coverage, code metrics looked p easy
>>
>>57175106
The only way to repair a Windoze installation is by reinstalling. Backup everything and start from zero again.
>>
>>57175124
Try antipattern detection, or control flow graphs.
>>
>>57175106
Call the Microsoft support hotline.
>>
>>57175114
>>57175117
>>57175126
I'm gonna cry, damn. I don't want to lose these years of feelings with this operating system, but if I have to, I guess I have to. Do you know if I could still maintain the official license for Win7 + reinstall Win7 _at all_? There's no way in hell I'm moving away from Windows 7.


And, moving 5TB of information is going to be a difficult task. Or is it just the C: (ssd w/ winOS on it) that I have to backup from? I'd figure so, unless Windows installation formats all connected drives regardless? I've never reinstalled, only initial installed. Well, I've reinstalled with Linux, and that wipes the fuck out of everything because I'm too lazy to do it the correct way (my fault, yes, I know) but I'm unsure on Windows. Only really worked with win3.1 with reinstalling shit
>>
hey /dpt/ I'm writing an equalizer program that takes input from a gyroscope and prints out to the console such that:
               0
0
R
RR
RRR
RR
R
0
L
LL
LLL

is printed out to the console.

I've already normalized the input from the gyroscope into values between -39 and 39, but I'm having troubles printing them out in the format shown above. (-39 to 39 given the console is 80 chars wide). Any help?
>>
File: CvMZ66TUsAITQ4O.jpg:large.jpg (93KB, 1282x782px) Image search: [Google]
CvMZ66TUsAITQ4O.jpg:large.jpg
93KB, 1282x782px
>modern languages
>>
>>57175176
Pardon my autism but that was supposed to be 'centered' i.e. the 0 is the center of the scree, R is right and L is left
>>
>>57175175
>There's no way in hell I'm moving away from Windows 7
Yep, you're never going to make it.
>>
what are some cool (web browser) applications that require almost no server-side resources (i.e., processing, state tracking etc, other than sending files)? e.g. games, maps, ...
>>
>>57175180
Wait what, am I reading that shit right? You tried to evaluate 1 + 2 and it had to make a fucking HTTP request to do so?
>>
>>57175198
If you could infer from what I've said before, I meant in the sense of Winmdows operating systems. I USE LINUX SYSTEMS ON A REGULAR BASIS. Even BSD, but that's just for hosting web

So, don't meme me, you goddamn drongus
>>
>>57175175
>moving 5TB of information
You shouldn't be doing this, it should be on a removable drive

unless you're running a server
>>
>>57175175
If you measure your HDD space in TB, you may be able to just install it as a second OS on a separate partition.
>>
>>57175217
You don't understand. I use Linux primarily, and 7 is a piece of shit compared to 10 from a developer standpoint.

10 is quickly becoming my primary dev OS, whereas before I only had 7 in a VM when I needed it.
>>
>>57175204
Yes and github was down at the time so it failed to evaluate it.
But screen is not from but some random tweet (ironically twitter is currently down)
>>
>>57175204
Apparently it loads features of the language on a "need-now" basis. And if such features cannot be downloaded ... and since addition seems to be a feature now ...
>>
If a function takes a char as a parameter, can I feed it a blank space to print spaces? i.e.

print_chars(' ');
>>
>>57175240
ERROR: That's not irony.

Please go read some examples of irony for more information.
>>
>>57175248
>loads features of the language on a "need-now" basis
>addition is a feature
webdevs, everyone
>>
>>57175180
>\Users\cuckold
also
>falling for the meme lang meme
>>
>>57175251
Generally yes, but what language?
>>
>>57175203
"Single Page Apps" they're called. Anything you could also do as a 90's desktop program.
>>
>>57175260
C
>>
>>57175218
...Yup, it's on a removable drive. I just disconnect the drive, install Windows 7 on the SSD again, and fucking just connect them afterwards. Again, me proving how fucking stupid I am
>>57175238
I don't like 10 for its' freshness. As in, things may change for the worse, or for the better-- I'd rather have something I know isn't going to be fucked with, something that's fairly stable. Ten is new. That's fine, if you want bleeding edge, that's fine. I don't, though.
>>57175234
Eh, my SSD is only a few gigs. It's secondary drives that are TB-sized. (To gloat, I've got about 30TB in external drive space from the times I did simple FTP hosting for my large group of pals-- I know how terribly slow it can be but it was just for fun)
So I'll just archive everything onto an empty external and reload Win7 to the SSD fresh.
Or... should I not? I'm not too educated on the ins-and-outs of SSD lifespans, so if anyone could give me a pointer or two on if it's a bad idea or not and why and such, etc etc, that'd be very much appreciated. I apologise for this discussion detracting from the /dpt/ in the sense of programming, so a simple sage is in order
>>
>>57175238
>10 is quickly becoming my primary dev OS
dafuq? You mean the "I'll update my telemetrics, you don't know shit" OS?
>>
File: firefox_2016-10-21_18-02-38.png (41KB, 587x687px) Image search: [Google]
firefox_2016-10-21_18-02-38.png
41KB, 587x687px
>>57175033
yeah, i meant in general, not for that specific case, which is of course slower
although it does surprise me that it takes twice as long, given that the lea's can be ran in parallel with the adds. ICC actually generates very similiar code for both(but gcc and clang don't, and icc is niche).
>>57175051
check out jawa
>Jawa is intended to be used very differently from most projects similar to it. Instead of trying to produce a human-readable disassembly or nearly-compilable Java, it’s intended for people that want to dive into or automate work on JVM bytecode.
http://jawa.tkte.ch/
>>
>>57175270
Yup
>>
>>57175261
whatever, I'm looking for examples other than the things I mentioned
>>
>>57175279
>I apologise for this discussion detracting from the /dpt/ in the sense of programming, so a simple sage is in order

you are not excused faggot
>>
>>57175291
7 is the same now
>>
>>57175303
Why don't you just fucking eat a tube of Pringles if it bothers you so much?
>>
>>57175258
If you look closely, it was trying to download "core", so I suspect that the initial installation literally installed only a downloader and prompt and nothing else.
>>
>>57175176
when i is below 0, print 39-abs(i) spaces and abs(i)Ls
is this what you need?
>>
>>57175291
It may surprise you to find out that most people either don't care, or don't care enough to the point that the con outweighs the pros.

Frankly, I care about functionality, convenience, and performance first and foremost.

People can argue about the political stuff until they're blue in the face. Meanwhile, I'll be using whatever tool helps me the most.
>>
>>57175310
you can easily disable updates on 7
>>
>>57175326
Yeah, something like that. Just fishing around for ideas right now, seeing if anyone had a good idea
>>
>>57175279
10 really isnt that different from 7 from a user standpoint imo. Lots of under the hood changes, some of them bad but tons are a benefit. Minor fuckup to the UI. I dont see much reason to stay on Win 7 anymore, it's kind of the same case with XP. Vista was a good reason not to move up but 7 came out and very quickly XP started to fail out. Same now, win 8 was atrocious from every aspect but 10 changes a lot and there's not too much reason not to take the 10 mins it's gonna cost and just learn 10.

But seriously just use linux fulltime.
>>
File: file.png (18KB, 603x320px) Image search: [Google]
file.png
18KB, 603x320px
>>57175367
Uh oh
>>
>>57175356
>Frankly, I care about functionality, convenience, and performance first and foremost.
I guess you've never, ever had problems with windows update or other services using too much CPU/RAM...
>>
>>57175388
7 was pretty atrocious for this, particularly the near-undiagnosable svchost.exe using chunks of CPU and RAM for no apparent reason.

I haven't had that issue with 10 at all, so far. On the same hardware, everything is quicker, from my anecdotal experience.

Virtual desktops and good native multi-monitor support are some of the big features that really stand out, but I'm digressing at this point.

>>57174526
Working on a modular plug-in system for a service I'm developing.

I'd like to be able to build a .DLL and load it into the service without recompiling or stopping the service, so I'm researching now.
>>
>>57174582
atom is literally the slowest editor out there
>>
>>57175377
if they removed the button, try disabling the service.
>>
>>57175512
That's not the problem-- the problem is, I've never once updated Win7
>>
>>57175375
what's the issue? i can write you some simple code to implement >>57175326 if that's the issue
>>
>>57175473
atom can't open files larger than 2 bytes.
>>
>>57175522
oh, kek
>>
>>57175527
    int i;
int middle = 40;
char space = ' ';
char right = 'R';
char left = 'L';
char zero = '0';
if (number < 0){
print_chars((middle + number), space);
print_chars(abs(number), left);
}
else if (number == 0){
print_chars((middle - 1), space);
print_chars(1, zero);
}
else if (number > 0){
print_chars(middle, space);
print_chars(number, right);
}

is what I have now. I don't have the gyroscope with me now so I can't really test it... came in here to see if anyone had a better implementation or if I could find something wrong with my code.
>>
>>57175627
Oh and here's print_chars();
void print_chars(int num, char use);
int i;
for (i = 0; i < num; i++){printf("%c", use);}
>>
How can I shorten this?
main = readMaybe <$> getLine >>= \x -> case x of Just n -> (sequence . replicate n) getLine >>= print . fmap (foldr (+) 0) . sequence . fmap readMaybe

Reads number, then reads next n numbers and prints the sum.
>>
>>57175707
reconsider your code
>>
>>57175707
Why does it need to be on one line?
>>
>>57175707
print sum(input() for x in range(0, input()))
>>
>>57175729
well I can't think of anything

>>57175745
here's more readable version
full = do
hSetBuffering stdout NoBuffering
maybeN <- readMaybe <$> (putStrLn "How many numbers?" >> getLine)
sumN <- case maybeN of
Just n -> do
strings <- sequence . replicate n $ getLine
let ints = sequence $ readMaybe <$> strings
folded = foldr (+) 0 <$> ints
return folded
Nothing -> return Nothing
putStrLn . (++) "Sum equals: " . show $ sumN
>>
>>57175755
>range(0, input())
>>
>>57175765
are you sure you just want it to do nothing if bad input is given, rather than just fail with an exception
>>
>>57175765
>>57175784
for instance

main = do
n <- read <$> getLine
xs <- replicateM n (read <$> getLine)
print (sum xs)
>>
>>57175768
just 2 letters and makes it clearer for people not familiar with python
>>
>>57175707
Rewrite in C++.
>>
FINALLY finished my algorithm for calculating slope in 3d

I am not so good at math

http://pastebin.com/6mgR7Fnu
>>
>>57175805
>2 letters
, is not a letter and it's actually 3 characters.
>>
>utf16
for what purpose?
>>
>>57175849
the space isn't needed though
>>
http://arstechnica.com/security/2016/10/most-serious-linux-privilege-escalation-bug-ever-is-under-active-exploit/

It's over. I'm with Microsoft now.
>>
>>57175801
>>57175784
>>57175765

or
main = readLn >>= (`replicateM` readLn) >>= (print . sum)

replicateM is from Control.Monad
>>
File: file.png (1MB, 870x975px) Image search: [Google]
file.png
1MB, 870x975px
Post devspaces
>>
File: leaf bsp tree.png (24KB, 1024x768px) Image search: [Google]
leaf bsp tree.png
24KB, 1024x768px
I modified my node BSP into a leaf BSP, but I'm not sure if the results are correct.

There are two things that worry me: I have to explicitly mark the splitter polygon as "used", I shouldn't need to do that because coplanar polygons are automatically marked as used and the splitter is a coplanar polygon.

It also creates more nodes than necessary, probably because unlike the node BSP, this insists on splitting the room in half first.
>>
>>57175995
hey I'm learning some linear algebra which is similar to that, can you explain what you're doing?
>>
Why do people care if your language compiles to JS or not?
Why not just write JS if that's what you wanted?
I just don't see what use-case it has. If you're doing web browser specific things you're not gonna interface well if you write C and compile to JS, for instance.
>>
>>57176111
You mean the algorithm I'm using? It's just modified node BSP code.
>>
>>57176160
>Why not just write JS if that's what you wanted?

Type safety?
>>
>>57176160
Writing JS is awful.
But it's the only browser language so you have to.
Why not make the writing part less awful by writing TypeScript and transpiling to JS?
>>
>>57176160
I mean more the purpose for using it and

I looked it up and it seems like some sort of culling algorithm for rendering polygons.. or one which provides triangles for rendering from the polygons in a scene
and something about the doom engine
>>
File: anal beads.png (4KB, 479x91px) Image search: [Google]
anal beads.png
4KB, 479x91px
>>57175707
Write(Range(0, ReadInt()).Select(x => ReadInt()).Sum());
>>
Why do people care if your language compiles to machine code or not?
Why not just write machine code if that's what you wanted?
>>
>>57174322
>Lisp defines lists, not sets
how are you going to implement a set if not as a list? an array? that doesn't necessitate creating a brand new language instead of a lisp dialect
>and it doesn't give the opportunity to define operations between elements.
are you talking about prefix notation? why would that bother you?
>>
>>57176244
BSP trees can be used to render polygons in exact back-to-front or front-to-back order, no matter where the camera is. So no need to sort polygons at run-time, just traverse the tree. It can also be used for collision detection, because you can easily reject large numbers of polygons. It also lets you do really fast line of sight checks.

But it really only works for static scenes. It's possible to move node's content, but only by along the splitting plane and as long as it does not intersect with any other node. If you have dynamic/moving content, you need to store them in some other way.

Doom uses a 2D node BSP tree, Quake and Quake-derived engines uses a 3D solid leaf BSP tree.
>>
>>57176338
ew
>>
>>57176409
>how are you going to implement a set if not as a list?
some form of hash table maybe?
a list would be pretty inefficient when you always have to scan for duplicates
>>
File: 36743.gif (855KB, 500x281px) Image search: [Google]
36743.gif
855KB, 500x281px
>>57176409
>how are you going to implement a set if not as a list? an array? that doesn't necessitate creating a brand new language instead of a lisp dialect


>implement a set as a list or array
>>
Chromecast functionality stopped working in all of our Android apps after a firmware upgrade on the Chromecast. Now it's up to me to plow through someone else's codebases (Android app + Chromecast app) and see what's wrong. Great way to start the weekend.
>>
>>57176464
It's sure as hell better than the clusterfuck in >>57175707
>>
#include <stdio.h>

int get(unsigned long long a, int index) {
return (a & (1 << index)) >> index;
}

unsigned long long set(unsigned long long a, int index, int value){
return (a | (1 << index));
}

int main(void){
unsigned long long b = 0L;
b = set(b,31,1);
printf("%lld\n", b);
printf("%d\n", get(b, 31));
return 0;
}

so i am guessing this prints a negative value because ther eis a sign bit in there, it's sort of annoying

it doesn't hurt if i am going to use the integer as a true/false vector right?
>>
>>57175707
sweet nigga jesus, what are you doing

>sequence
>replicate
>fmap
>foldr
>another sequence and fmap

Fucking hell.
>>
>>57176496
see >>57175913
>>
>>57176506
nvm figured it out
>>
lisp macros better be fucking god tier because so far, I've seen nothing haskell can't already do
>>
>>57176612
macros are good but lisp fags use them when functions are more appropriate
>>
>>57176549
I like it.

It's not really shorter, though, and at some point, the abstraction dick-measuring just gets counter-productive.

What happens if the user types "cat"? And is that language dynamically typed by default?
>>
why does this exist?

https://sourceforge.net/projects/loic/
>>
>>57176673
it breaks

there's no reason to care in such a basic program
>>
I realized that empty files take up 0 bytes, whereas text files can take up many KB's. Because of this, I've wrote a program that takes an existing text file, and for every line in it creates a new empty text file with a name of that line. This way, you can store infinite textual data. It's pretty clever in my opinion.

import sys

def create_files(lines):
for line in lines:
open(line.rstrip(),'a').close()

print("Files created. Enjoy your saved space!")


if __name__ == '__main__':
if (len(sys.argv) > 1):
try:
with open(sys.argv[1]) as f:
create_files(f.readlines())
except FileNotFoundError:
print("There's no file here.")
else:
print("Usage: python py-finite.py filename.txt")

>>
>>57176673
>>57176721
and it's not at all dynamic

it's static and pure
>>
File: latest.png (381KB, 447x596px) Image search: [Google]
latest.png
381KB, 447x596px
I'm trying to make some functions for a template in C++ (I'm printing out a Grid, but I need multiple "printGrid" and "initializeGrid' functions, so templates seemed like a decent solution)

Why doesn't my IDE (QT) recognize that printGrid uses template T?

template<typename T>
void initializeGrid(Grid<T>& grid, T value)
{
for(int row = 0; row < grid.numRows(); row++)
{
for(int col = 0; col < grid.numCols(); col++)
{
grid[row][col] = value;
}
}
}
void printGrid(Grid<T>& grid)
{
for(int row = 0; row < grid.numRows(); row++)
{
for(int col = 0; col < grid.numCols(); col++)
{
cout << grid[row][col] << "\t";
}
cout << endl;
}
}


I get the error "use of undeclared identifier 'T' "

Any ideas?
>>
>>57176740
Then how does it know readLn is going to return something that can be summed?
>>
>>57176739
https://us.pycon.org/2017/speaking/
>>
>>57176755
type inference and type class constraints
readLn gets a line from stdin, converts it into a type that can be read (from a string)
then when we sum it we know we must also be able to add it
so it builds up constraints

you end up with a procedure (main) that can print the result of anything that can be both parsed AND summed

then when you compile it, it'll either complain that it's ambiguous (because you haven't specified which type main should work on) or pick a default (like Double or Integer)
>>
>>57176755
>>57176819
and in other cases, like the very first readLn

replicateM n x
performs the action x, n times
n must be an int (a fixed size integer)

so it knows THAT readLn must be giving an int, so it picks the int version of that procedure
>>
>>57175707
iota(0, readln.to!int)
.map(line => line.to!int)
.sum
.writeln;
>>
>>57176837
Woops actually forgot .each to read lines but yeah use a decent language instead.
>>
>>57176743
Shouldn't you define the template before printGrid too?
>>
>>57176856
I'm not sure... I'm pretty new to templates, but I'll try it out
>>
>>57176338
>filename
what did he mean by this?
>>
G-guys, g-give me pointers?
>>57176727
>>
>>57176623
only bad Lispers. i don't really use Clojure but they've got the right idea. a lot of lisp newbies really fuck themselves with overuse of macros
>>
>>57176885
Do you know what anal beads are?
>>
>>57176898
yes
>>
File: example.png (108KB, 827x871px) Image search: [Google]
example.png
108KB, 827x871px
I'm writing a program in Python and I want to be able to take an input file by having my program appear in the windows "Right Click ---> Open With" menu.

Is this possible in Python? How do I do it?

>pic related
incase i explained this poorly
>>
>>57176856
Yeah, this solved the issue
>>
>>57176925
That's not related to Python.
That's Windows Shell thing that you would have to configure in the Windows registry then just take the filename from sys.argv in your script.
>>
>>57176943
Where can I read up about this?

I've heard Windows Registry is a nightmare
>>
>>57176743
Shouldn't both functions be methods of the Grid<T> class?
>>
>>57176959
yes it is.
if only Win[XXX] had an equivalent of the Holy Shebang
google it and problem-solve.
>>
>>57176819
>>57176831
actually since main prints the result, you can't really choose from calling main, it'll just default to Integer

you could split it off into another function like this:

readMany = readLn >>= (`replicateM` readLn)
-- ask the user for a number n, then read n inputs
main = readMany >>= (print . sum)


then if you wanted to select a particular type, you could either use type annotations

main = (readMany :: IO [Rational]) >>= (print . sum)


or the extension TypeApplications

main = readMany @ Rational >>= (print . sum)

(something like that)

in fact since there's a built in parser for lists, "readLn" could just as easily read a list

so here's the simplest version
main = (readLn @ [Rational]) >>= (print . sum)
>>
>>57176959
http://stackoverflow.com/a/29769228
>>
>>57176959
>>57176973
Maybe making your script into a zip would be a first step... https://docs.python.org/3/library/zipapp.html
That would make it clear to Windows how it should be executed. Now adding the shortcut and adding the scipt to the set of things that can be shortcut to is another thing.
>>
>>57176977
the last version works like this btw
[(1 % 3), (4 % 3) ]
->
(5 % 3)

[]
->
(0 % 1)

Rationals are parsed like this:
(n % d)
which is
n / d
>>
>>57176995
ty, couldn't figure out what to google since searching for "python open with" was giving me a bunch of people struggling to setup PyCharm
>>
>http://pastebin.com/Nhqsgq4T
>written in Go
As much as I hate Go, I'm pretty impressed by the adoption rate of the language. I'm even thinking on getting more experienced in Go to land myself a proper job.
>>
>>57177034
go = ken thompson kek
>>
>>57176700
Why wouldn't it?
>>
>>57177034
>I'm pretty impressed by the adoption rate of the language.
only because it's backed up by a tech behemoth like google
im pretty sure that otherwise it would have been yet another odd language that only a handful of people use
>>
>>57177034
>As much as I hate Go
Why? Go is pretty nice desu.
>>
File: glenda_space_medium.jpg (13KB, 239x276px) Image search: [Google]
glenda_space_medium.jpg
13KB, 239x276px
>>57177034
what's wrong with go
>>
>>57177119
>Why? Go is pretty nice desu.
>>57177121
>what's wrong with go


Go is a fucking disease.
Go programmers don't actually write any code.
They just question people who question Go.
>>
How can I make this simpler without writing any of my own functions? I know that I can write functions that make my task here easier but I don't think I'm allowed

http://pastebin.com/S2Y4N2D0

Input:
Amarillo 3 2 1 3 5 -7
Rochester 5 6 7 4 6 -2
Albuquerque 3 4 5 2 3 -9
Durham 9 8 7 9 9 8 -4
Boise 3 4 6 2 8 9 -1
Jacksonville 2 5 2 1 5 7 2 1 1 -3
Lexington 8 9 12 3 4 10 11 -6
Tulsa 8 2 9 5 6 11 8 4 2 9 -1
San_Francisco 1 1 2 1 1 0 0 1 -8
Washington -3


I took another anons advice here and stopped using std::endl; so much.
>>
>>57177074
proof by inversion is base not argument
>>
>>57176700
to load test your server
>>
>>57177139
Why are you worried about simplicity when you're "not allowed" to write any additional functions?

Just hand in the assignment to your teacher and move on.

Stop posting this in every single thread.
>>
>>57177139
in Haskell this is just
>>
File: fuk u i am rakesh.png (4KB, 295x106px) Image search: [Google]
fuk u i am rakesh.png
4KB, 295x106px
I'd like to learn Javascript from a backend application standpoint.

Essentially, I just want to be familiar with the language and its basic idiosyncrasies, without having to fuck with a website.

Any recommendations?
>>
>>57177163
Well mainly wondering if I could do better in specific sections with the limitations that I have...
>>
>>57177191
why would you use javascript outside of a setting (like a browser) in which you are forced to?
>>
>>57177206
It's good that you're trying to learn, but you're setting yourself up to learn in the wrong frame of mind.

If the best solution would be to abstract some of that code to a single generic method, then you should do that. If you're not allowed, just save your working code as-is, turn that in, and do the "improved" version on your own time.

Don't ask for improvements on simplicity and reject the primary method of making code more simple.
>>
>>57177130
yeah, that's why a shitload of projects (of all sizes and importance) that use Go have been released in the last years
0/10 try harder
>>
>>57177191
JS is very specifically made for browsers, despite what retards would have you believe. You are going to fuck with a website whether you like it or not with JS.
>>
>>57177139
use macros. macros are different from functions
>>
>>57177142
There's no proof you retard. We can both clearly see that it exists. Why don't you look up the fallacy fallacy while you're at it.
>>
>>57177252
This post makes much more sense when you realise it's sarcastic
>>
>>57177235
>>57177257

I simply want to learn the syntax, logic, and general usage of the language without everything being framed within a webpage, much like a console-only application in any compiled language.

Surely this is possible, no?
>>
>>57177102
I understand the magnitude of Google shills, but I've heard many legitimate stories of companies replacing their microservices with Go instead of Python, Ruby or PHP.
>>57177119
>>57177121
Generics are debatable. The thing I miss the most is a proper way of error handling. I don't mind the error type, but all those nil tests pollute your codebase. I'd like to have something like this:
func newPerson(data []byte) (*Person, error) {
var p Person
try(json.Unmarshal(data, &p)) // return default value (nil) and the error
return &p, nil
}

I do like the fact that I can have a web server running without any 3rd party dependencies.
>>
>>57177298
i'd recommend monads but
>no hkts
>>
>object oriented programming is almost 50 years old
>faggots half that she think it's a "temporary development" and will "go away soon"
>>
>>57177276
http://githut.info/
One quarter as many Go repos as C. One third as many as C#. I'd say it has a pretty strong following.

>>57177298
I agree the error handling is tedious and code-bloat-y. But implicit error handling or exceptions aren't much cleaner. I don't know what a cleaner alternative would be.
>>
>>57177372
oh why do you need to start an OOP shit war again
>>
>>57177409
>I agree the error handling is tedious and code-bloat-y. But implicit error handling or exceptions aren't much cleaner. I don't know what a cleaner alternative would be.
it begins with an M
>>
>>57177291
sure. download node and knock yourself out. i think the mozilla website has a bunch of good stuff to read

>>57177298
>instead of Python, Ruby or PHP
this is nothing but good, right?

>a proper way of error handling
this is what i hear the most. i prefer the current conventions to exceptions but i do like to imagine that there's a nirvana out there. i think they're headed in the right direction
or listen to rob pike smugly deflect your concerns
https://blog.golang.org/errors-are-values
>>
>>57177372
>faggots half that she think it's a
what?
>>
File: monad diagram.png (26KB, 334x358px) Image search: [Google]
monad diagram.png
26KB, 334x358px
>>57177441
>errors-are-values
they're so close

>no parametric polymorphism
yet so far
>>
>>57177291
>Surely this is possible, no?
https://en.wikipedia.org/wiki/Electron_(software_framework)

It's possible, but everything is still framed within a webpage.
>>
Implement a Monad in C.
>>
>>57177499
"no"
>>
>>57177499
>no parametric polymorphism
>>
>>57177499
heres one in cpp
https://gist.github.com/splinterofchaos/3965514
>>
how do i access github
good thing we centralized everything
>>
>>57177441
>this is nothing but good, right?
I kinda like Python despite it being insanely slow. At least it has overloading, generics and filter/map/reduce functionality.
>https://blog.golang.org/errors-are-values
This is only useful in very limited situations.
I like the way Rust handles errors by wrapping the result in an Option or Result. I don't know about Monads. I've never used them.
Go's way of error handing is returning glorified C style error codes. Those are the worst of all IMO.
>>
>>57177574
Aren't Option and Result monads?
>>
>>57177596
You're right. They actually are...
>>
Can you specify the syntax highlighting for a code block?
>>
>muh error handling

hows abouts yous dont make errors ha?
>>
>>57177631
I can.

Can you?
>>
>>57177637
>implying the Either monad is actually about errors
>>
>>57177642
No
>>
r/dailyprogrammer #286 easy

Used pattern matching for a concise and beautiful solution in Racket.
>>
>>57177658
Okay.

Great conversation, I hope you continue to contribute valuable posts to this thread.
>>
Could you technically interchange a tuple and a POD struct?
>>
>>57177664
>for each takes (callback, iterable) instead of (iterable, callback)

jesus fuck
>>
>>57177677
yes

the only difference is a tuple is indexed numerically
a struct has names
>>
>>57177699
"For each double it number in the list."

Makes sense to me.
>>
>>57177724
for each do <x> for each value in <y>
for each value in <y> do <x>

idk sounds kinda backwards
>>
>>57177724
>>57177756

it makes sense often when doing partial application

printAll = for_each print
>>
>>57177666
Jokes aside. How do you do it?
>>
File: such_literacy.jpg (103KB, 720x960px) Image search: [Google]
such_literacy.jpg
103KB, 720x960px
>>57177699
because the number of iterable arguments is arbitrary.

(for-each (lambda (n1 n2 n3)
(printf "~A ~A ~A~%" n1 n2 n3))
'(1 2 3)
'(11 22 33)
'(111 222 333))



output:

1 11 111
2 22 222
3 33 333
>>
>>57177802
... rather than just passing a list

right
>>
>>57177756
programming languages are not natural languages, you fucking idiot.
>>
>>57177802
Couldn't it then just have two signatures then?
First for a single iterable as first parameter.
Second a list of iterables as first parameter.

instead of variadic parameters.
>>
>>57177631
>>57177772
On 4chan? No, despite the fact that the code used (Google's prettyprint js) has an option for specifying the language, moot/hiroshimoot saw fit not to expose this feature to us humble anons, so we're stuck with prettyprint's default 'generic' highlighting.
>>
>>57177819
your point?
>>
>>57177664
Haskell

import Data.List (findIndex)
fact = 1 : zipWith (*) fact [1..]
rfact n = findIndex (>= n) fact


fact is the infinite list of factorials

rfact just finds the index of the first number greater than the input
>>
>>57177815
ever heard of partial application or currying?
>>
>>57177867
>currying
pajet hah-a
>>
>>57177867
Yes, I have, and your language isn't doing it.
>>
>>57177664
In Rust:

fn reverse_factorial(n: u64) -> Option<u64> {
fn is_fact(n: u64, i: u64) -> Option<u64> {
match n/i {
0 => None,
1 if n%i == 0 => Some(i),
n @ _ => is_fact(n, i+1),
}
}

is_fact(n, 1)
}

fn main() {
for n in [3628800, 479001600, 6, 18, 120, 150].into_iter() {
match reverse_factorial(*n) {
None => println!("None"),
Some(f) => println!("{}!", f),
}
}
}


Output:

10!
12!
3!
None
5!
None
>>
>>57177850
can integer overflow with haskell ?
>>
given
(setf x '(a b c))
(setf (cdr (last x)) x)


would you say that x is now
(a b c a b c)
or
(a b c a b c ...)

please give reasoning
I think the former, but clisp says otherwise
>>
>>57177914
the Integer type is unbounded, but it also has ints

btw mine is apparently off, didn't realise it was supposed to return Nothing for non-factorial numbers
>>
>>57177850
>infinite

lol sure thing buddy
>>
>>57177952
ok
its limited to about the 2^64th factorial number


or so you'd think
>>
>>57177900
pic

>>57177903
>>57177850
post your solution here for some karma.

https://www.reddit.com/r/dailyprogrammer/comments/55nior/20161003_challenge_286_easy_reverse_factorial/
>>
>>57177952
theoretically, it is, and given enough memory you could compute however much you what
kys yourself please
>>
>>57177979
Think this through anon.

You've got a function that can take an infinite number of arguments.

And currying.

And the function isn't polymorphic or doing type class magic.
>>
>>57177986
theoretically i fucked your mom last night
>>
>>57177979
here's the fixed solution


import Data.List (elemIndex)
fact = 1 : zipWith (*) fact [1..]
rfact n = elemIndex n (takeWhile (<= n) fact)


i don't post on reddit or have an account
>>
>>57178000
set of factorials is infinite retard
>>
>>57178000
i'd like to see your proof
>>
>>57178028
the variable fact in that code is not though
>>
>>57177986
That's about as useful as saying that your computer is actually only a FSM and not a turing machine because memory is finite.
As such it can't even parse balanced parentheses.
>>
>>57174713
In case anyone cares anymore:

OK, just switched back to linux and compiled and dumbed your program. Turns out that the <int> template DOES generate more code that the <size_t> template.

Apart from that the <size_t> code is slightly faster:

20433
20388


I don't know WHAT you have been measuring, but your compiler seems to be somewhat broken.

But to be sure I also created a C version of that program, and there it was OBVIOUS that the int version was slower:

26901
20237


And that C is marginally faster than C++.

I repeat: you have no idea how CPUs work, and on top of that you are a cum-gurgling faggot.
>>
>>57178043
it is. don't confuse the code itself with the implementation executing that code.
>>
File: 2002.gif (645KB, 770x575px) Image search: [Google]
2002.gif
645KB, 770x575px
what are some languages or platforms that have changed the way you thought about programming or computers?

LISP, Haskell, Forth, Smalltalk (specifically Pharo), Befunge, Prolog, APL
>>
>>57178047
>>57178043
>INFINITY DOESNT EXIST BECAUSE WE CANT COMPREHEND IT IN ANY WYA YOU GUYS

yeah nah, that's bs, if you can write on a piece of paper that something is infinite and people would agree, doesn't mean it's wrong to write it in a program

EVERYONE KNOWS WHAT IS MEANT
>>
>>57178043
it is
>>
>>57178059
Compiler flags?
>>
>>57178071
You might understand infinity, but that doesn't change the fact that your computer is a finite thing.
>>
>>57178069
Haskell
>>
>>57178077
-std=c++11 -O3 for g++
-O3 for gcc
>>
>>57177903
Just realized that i could've written
n @ _ => ...
with
n => ...
>>
>>57177996
https://en.wikipedia.org/wiki/Apply
>>
>>57178069
D made me rethink my whole life
>>
In opengl, if I want a graphics transformation to move a point relative to world (0,0,0) instead of its local (0,0,0), do I have to just take the inverse of the transformation matrix
>>
>>57178095
Did you try it with lower optimization levels?
>>
>>57178091
and yet a variable can represent an infinite thing

streams are an example
>>
>>57178105
This is not partially applied. It has additional rules.
>>
>>57178133
currying and partial application are two different things.
>>
>>57178124
What is the point of benchmarking unoptimized code?! No one cares how fast unoptimized code runs.
>>
>>57178059
Are you fucking retarded? We were talking about unsigned and not about size_t. You know so little about CPUs that you probably don't even know why it's completely natural for size_t to be much faster than unsigned in this case.
>>
>>57178150
look anon

its not partially applied
you've got a number out

what you should get out is an ambiguous "maybe a result maybe a function"
>>
>>57178127
That depends on how nit-picky you are about the word "inifnite".
>>
/g/ whats the point of bt the stack?
>>
which lisps have partial application?
and sensible names that ain't "mapcar" or "car"
>>
File: polyvariadic function.png (32KB, 821x482px) Image search: [Google]
polyvariadic function.png
32KB, 821x482px
>>57178150
>>57178176
for instance

notice how x can be used as a value and as a function
>>
>>57178091
a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.
>>
>>57178160
I'm talking about -O2.
I don't trust -O3 to obey the language sematics properly.
>>
File: CkQD4WEVAAA1ya4.jpg (44KB, 583x778px) Image search: [Google]
CkQD4WEVAAA1ya4.jpg
44KB, 583x778px
>>57177119
>>57177121
Lack of operator overloading and lack of generics give me the butthurt, for reasons that have already been discussed in detail.

Also, Go's built-in package manager works in some very strange ways. You have to vendor everything if you want dependencies that don't randomly change on you.
>>
>>57178175
I can do it with unsigned and int, and I can do it with size_t and ssize_t, it doesn't change the fact. Don't believe me?

bench<size_t>();
bench<ssize_t>();

bench<unsigned>();
bench<int>();


Generates:

20263
20271
20290
20586


int is CLEARLY the slowest, after that comes unsigned, after that ssize_t, and after that size_t.
>>
>>57178185
maybe clojure
>>
>>57178199
Doesn't change much:

20250
20348
20367
20948
>>
>>57178247
OH, ALSO, mandatory garbage collector.

This isn't a problem for most projects but if you're writing any systems stuff (OSes, embedded code, drivers, etc) it's a non-starter, and if you're trying to do gamedev you could still get away with making a game in Go but the Garbage Collector would fuck your performance all to hell.
>>
>>57178254
>Don't believe me?
Yeah, I don't.
>>
>>57178293
Then continue sucking dick and gurgle cum.
>>
>>57178254
>Don't believe me?
No, I do. I'm just overly cautious of -O3.

Can you post the code on gist or something?
I'd like to play with it for a bit.
>>
>>57178308
Oh shit, I know realize what's going on. This faggot is unironically running a 32 bit system where size_t == unsized. Hahahaha, you cannot make this up. It's fucking 2016.
>>
>>57178176
>>57178176
>what you should get out is an ambiguous "maybe a result maybe a function"
no.

https://wiki.haskell.org/Partial_application
https://en.wikipedia.org/wiki/Partial_application
>>
>>57178363
yes.
>>
File: i0j91Of.jpg (308KB, 1920x1080px) Image search: [Google]
i0j91Of.jpg
308KB, 1920x1080px
Anyone else had any experience using Idris yet?

Ive been toying around with it the past few days, and i'm finding much more pleasant to write than Haskell.

Experiencing true dependent types has helped me understand them(and their usefulness) so much better than I had with Haskell's version. It's been such an eye opener!
>>
>>57178352
Wow, you just continue to fail constantly. I was running this on a 64 bit system:

$ uname -m
x86_64


I assume if you fail you go into full retard mode, huh?

>>57178350
The C++ was already posted above.
The C code was just something that I wanted to have on my own, it's worse to test new types with it and is only marginally faster so that it does not even matter.
>>
>>57178426
>The C++ was already posted above.
Sorry, didn't see that.
>>
>>57178426
>I was running this on a 64 bit system
Why are you lying?
>>
File: firefox_2016-10-21_22-11-00.png (56KB, 1301x679px) Image search: [Google]
firefox_2016-10-21_22-11-00.png
56KB, 1301x679px
>>57178059
>Turns out that the <int> template DOES generate more code that the <size_t> template.
compiler version please, for icc i get the same size for int and unsigned but for gcc and clang the unsigned version is longer. What are your compiler options?
gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(colouriseAsm:'0',compileOnChange:'0'),source:'%23include+%3Cinttypes.h%3E%0A%0Auint32_t+mod(uint32_t+a)%0A%7B%0A%09return+a+%25+4%3B++%0A%7D%0A%0Aint32_t+modsigned(int32_t+a)%0A%7B%0A%09return+a+%25+4%3B++%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g62,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-O3'),l:'5',n:'0',o:'%231+with+x86-64+gcc+6.2',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4
>>
>>57178451
Why do you continue being a faggot?
>>
>>57178363
i think what messes people up with currying, is that people aren't generally used to thinking as functions as values themselves.

the way i see it, it's not so much that you get a partially applied function back out, as you get a newly indexed transformation value.

obviously these are the same, but i find this way of thinking about it more useful.
>>
>>57178402
dependent types are lovely, but there's stuff missing i'm not fond of

hopefully at some point haskell will get dependent types
>>
>>57178463
Because you continue to lie.
>>
>>57178426
I ran the code here >>57174713 on my 64bit machine with -O2.
I got
73745
28848

So why are your results different?
>>
>>57178451
>Why are you lying?
what makes you think he is?
>>
>>57178550
Because now I've got >>57178530 who gets consistent results with what is expected.
>>
>needing to worry about hardware implementation details
why is C so shit?
>>
>>57178562
With -m32 I got
35660
26281
Which is way closer, but that's not surprising.
>>
>>57178530
Honest to God, I have not a clue. Different hardware shouldn't cause this, and I haven't changed anything - I just re-copied the C++-code into the file and recompiled it again. Basically same results.

Then again, I am compiling those with an older compiler (4.9.3). Maybe they fucked something up in the meantime ...?
>>
>>57178616
g++ --version?
Mine is
g++ (GCC) 6.2.1 20160830
>>
>>57178616
I should add: if I compile the program with -O0, I get:

184963
187303


Just thought I'd add it.
>>
>>57178550
Some time in the first half of the 20th century a scientist, Epstein, went to some remote island to experimentally verify Einstein's theory of relativity. A reporter asked Einstein what he'd do if the experiment showed that his theory was incorrect. Einstein replied that he'd be very sorry for Epstein because Epstein would have made a serious mistake during his experiment. The theory was correct after all.
>>
>>57178661
The entire GCC suite is version 4.9.3. C compiler, C++ compiler ... everything from 4.9.3.
>>
>>57178683
Maybe gcc learned that particular optimization after 4.9.3 and simply generates the slow code for both versions.
But that would surprise me.
I guess we need to look at your assembly to see.
>>
File: firefox_2016-10-21_22-30-11.png (16KB, 337x358px) Image search: [Google]
firefox_2016-10-21_22-30-11.png
16KB, 337x358px
>>57178616
>GCC 4.9.3
bingo, GCC 4.9.3 compiles it to pic related, the same as the unsigned case. Doesn't x86 guarantee unsigned integer wraparound anyway?
http://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(colouriseAsm:'0',compileOnChange:'0'),source:'%23include+%3Cstdlib.h%3E%0A%23include+%3Cstdio.h%3E%0A%23include+%3Ctime.h%3E%0A%23include+%3Csys/mman.h%3E%0A%0Aconst+ssize_t+SIZE+%3D+128+*+1024+*+1024%3B%0A%0Atemplate%3Ctypename+T%3E%0Astatic+unsigned+char+f(unsigned+char+*p,+T+i)%0A%7B%0A++unsigned+char+res+%3D+0%3B%0A++res+%2B%3D+p%5Bi+%2B+0%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+1%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+2%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+3%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+4%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+5%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+6%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+7%5D%3B%0A++return+res%3B%0A%7D%0A%0Atemplate%3Ctypename+T%3E%0Astatic+void+bench()%0A%7B%0A++unsigned+char+*map+%3D+(unsigned+char+*)mmap(NULL,+SIZE,+PROT_READ,%0A++++++MAP_PRIVATE+%7C+MAP_ANONYMOUS,+-1,+0)%3B%0A%0A++for+(int+i+%3D+0%3B+i+%3C+SIZE%3B+i%2B%2B)+%7B%0A++++*(volatile+unsigned+char+*)(map+%2B+i)%3B%0A++%7D%0A%0A++struct+timespec+a,+b%3B%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26a)%3B%0A%0A++for+(T+i+%3D+0%3B+i+%3C+SIZE+/+8%3B+i%2B%2B)+%7B%0A++++__asm__+volatile(%22%22+:+:+%22r%22(f%3CT%3E(map,+8+*+i)))%3B%0A++%7D%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26b)%3B%0A%0A++printf(%22%25ld%5Cn%22,+(b.tv_sec+-+a.tv_sec)+*+1000+*+1000+%2B+(b.tv_nsec+-+a.tv_nsec)+/+1000)%3B%0A%7D%0A%0Aint+main()%0A%7B%0A++bench%3Cunsigned%3E()%3B%0A++bench%3Cint%3E()%3B%0A%7D'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g493,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-O2'),l:'5',n:'0',o:'%231+with+x86-64+gcc+4.9.3',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4
>>
>>57178738
http://pastebin.com/CLg5FCpp
>>
>>57178766
That site is fucking bookmarked.
>>
an example of some bad stuff in Idris

a bunch of infix operators are not treated like functions
(,) is not an operator
(->) is not a type operator

patterns aren't really first class (less so than haskell w/ extensions), though syntax extensions are nice

lackluster library, especially when it comes to IO
>>
>>57178766
So they actually fucked that up ...
Nah, I am not gonna file a bug report. Too lazy, and since I am using 4.9.3 I am not even affected.
>>
>>57178595

because its made for working with hardware

have fun with makin' "apps"
>>
>>57178781
Yup, it's the same for both.
But it's the fast code for both of them.
It actually mis-compiled the unsigned version.
>>
>>57178766
That just means that inlining broke the benchmark. Add a noinline attribute and unroll it a few more times to make sure that the call overhead doesn't affect the benchmark too much:

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/mman.h>

constexpr ssize_t SIZE = 128 * 1024 * 1024;

template<typename T>
__attribute__((noinline))
static unsigned char f(unsigned char *p, T i)
{
unsigned char res = 0;
res += p[i + 0];
res += p[i + 1];
res += p[i + 2];
res += p[i + 3];
res += p[i + 4];
res += p[i + 5];
res += p[i + 6];
res += p[i + 7];
res += p[i + 8];
res += p[i + 9];
res += p[i + 10];
res += p[i + 11];
res += p[i + 12];
res += p[i + 13];
res += p[i + 14];
res += p[i + 15];
res += p[i + 16];
res += p[i + 17];
res += p[i + 18];
res += p[i + 19];
res += p[i + 20];
res += p[i + 21];
res += p[i + 22];
res += p[i + 23];
res += p[i + 24];
res += p[i + 25];
res += p[i + 26];
res += p[i + 27];
res += p[i + 28];
res += p[i + 29];
res += p[i + 30];
res += p[i + 31];
return res;
}

template<typename T>
static void bench()
{
unsigned char *map = (unsigned char *)mmap(NULL, SIZE, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

for (int i = 0; i < SIZE; i++) {
*(volatile unsigned char *)(map + i);
}

struct timespec a, b;

clock_gettime(CLOCK_MONOTONIC, &a);

for (T i = 0; i < SIZE / 32; i++) {
__asm__ volatile("" : : "r"(f<T>(map, 32 * i)));
}

clock_gettime(CLOCK_MONOTONIC, &b);

printf("%ld\n", (b.tv_sec - a.tv_sec) * 1000 * 1000 + (b.tv_nsec - a.tv_nsec) / 1000);
}

int main()
{
bench<unsigned>();
bench<int>();
}
>>
>>57178893
Both variants were properly inlined into main.
How does that break the benchmark?
>>
>>57178916
Because we're benchmarking the functions and not some version of them that was optimized after inlining.
>>
>>57178893
But it makes no sense to insert those address loading instructions there. Like, at all. Those are completely unnecessary - why would the compiler do that?
>>
>>57178562
the signed integer version is 2.6 times faster
How do you explain that? The only thing i can explain is somewhere between 1x and 2x faster depending on compiler and how the hardware actually executes it(out of order execution etc.). To me that highly suggests that something is wrong with the tests on his machine, I'd be curious if several successive tests produce the same results
>>57178797
it's not a bug m8
>>57178893
the code generated for the unsigned addition is the same as for the signed addition. Doesn't x86 provide proper wraparound anyway?
>>
>>57178983
>But it makes no sense to insert those address loading instructions there.
They are not address loading operations. They are add operations. leal 16(edi) eax is the same as eax = edi + 16.
>>
>>57178983
unsigned integer overflow wraparound supposedly, but i don't understand why the assembly generated for signed integers wouldn't be sufficient for unsigned integers as well
>>
>>57178934
With your changes i get (over several runs)
180099
122175
so it's still significant.

And the assembly is still different for both.
The only thing that changes is the inlining.

http://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(colouriseAsm:'0',compileOnChange:'0'),source:'%23include+%3Cstdlib.h%3E%0A%23include+%3Cstdio.h%3E%0A%23include+%3Ctime.h%3E%0A%23include+%3Csys/mman.h%3E%0A%0Aconst+ssize_t+SIZE+%3D+128+*+1024+*+1024%3B%0A%0Atemplate%3Ctypename+T%3E%0Astatic+unsigned+char+f(unsigned+char+*p,+T+i)%0A%7B%0A++unsigned+char+res+%3D+0%3B%0A++res+%2B%3D+p%5Bi+%2B+0%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+1%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+2%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+3%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+4%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+5%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+6%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+7%5D%3B%0A++return+res%3B%0A%7D%0A%0Atemplate%3Ctypename+T%3E%0Astatic+void+bench()%0A%7B%0A++unsigned+char+*map+%3D+(unsigned+char+*)mmap(NULL,+SIZE,+PROT_READ,%0A++++++MAP_PRIVATE+%7C+MAP_ANONYMOUS,+-1,+0)%3B%0A%0A++for+(int+i+%3D+0%3B+i+%3C+SIZE%3B+i%2B%2B)+%7B%0A++++*(volatile+unsigned+char+*)(map+%2B+i)%3B%0A++%7D%0A%0A++struct+timespec+a,+b%3B%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26a)%3B%0A%0A++for+(T+i+%3D+0%3B+i+%3C+SIZE+/+8%3B+i%2B%2B)+%7B%0A++++__asm__+volatile(%22%22+:+:+%22r%22(f%3CT%3E(map,+8+*+i)))%3B%0A++%7D%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26b)%3B%0A%0A++printf(%22%25ld%5Cn%22,+(b.tv_sec+-+a.tv_sec)+*+1000+*+1000+%2B+(b.tv_nsec+-+a.tv_nsec)+/+1000)%3B%0A%7D%0A%0Aint+main()%0A%7B%0A++bench%3Cunsigned%3E()%3B%0A++bench%3Cint%3E()%3B%0A%7D'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g493,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-O2'),l:'5',n:'0',o:'%231+with+x86-64+gcc+4.9.3',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4
>>
>>57178991
>How do you explain that?
The unsigned version executes twice as many instructions.
>>
You guys should write up a proper report on this benchmark, so that lesser minds like myself, who haven't been following from the beginning, can catch up and hopefully learn something.
>>
>>57179025
Different semantics of overflows.
Int overflows are UB.
unsinged overflows are required to wrap at 32bits.
That's what the extra instructions do.
For the int code, the compiler abuses the overflow IB to promote the ints and roll them into one addb.
So it wraps at 64bits, which is fine since int overflows are UB.
It can't do it for unsinged, as they have to wrap at 32bits.
>>
>>57178991
It actually is.
His compiler (4.9.3) produced http://pastebin.com/CLg5FCpp.
But it's the FAST code for BOTH.
It optimized too much.
>>
i have a simple assembly understanding problem:

lets say i have values x and y in memory both of which store 32 bit values, nothing new,

but lets say we want to add them, both of those values can be adressed with 32 bit adresses, right ? a single instruction is only 32 bits wide, so how can we fulfill this action, what is the trick here ?

there are IIRC registers that can act as temporary variables but surely this can be done otherwise ?
>>
>>57179086
What "assembly"? x86?
>>
>>57179084
>it's not a bug m8
forgot to qoute that
>>
>>57179084
>It optimized too much.
It did not optimize too much. The fact that it does not optimize in the newer version is simply a regression. It's very easy to prove in the inline version that no unsigned overflow occurs so you can use faster operations.
>>
>>57179065
But shouldn't the compiler just generate the wrap where it occurs (which is possibly never, at least not in our example) and then use that value to index the buffer? Or would that additional usage of another register be "too much of a slowdown"?

No matter how I look at this, this is retarded.
>>
>>57179100
>What "assembly"? x86?
sry yeah x86
>>
>>57179104
If it can prove that no overflows happen, then this benchmark is to simple to showcase the point.
In complex code where this happens it wont be able to prove that.
Without proving that no overflows happen, the fast code for unsinged is semantically wrong.

The point is to show that unsigeds defined wrapping behavior can affect the optimizer.

Inlining has nothing to do with it. >>57179029

>>57179136
That's what the leal instructions in the slow versions do.
After the leal, which creates the 32bit wrapping behavior it uses the same register, promotes it to 64bit
and uses it in the addb.
It has to wrap all of the additions because it couldn't prove that no overflows occur.
So it has to do it for all of them.
>>
Instead of benchmarking and analyzing instructions, what would make unsigned operations slowed than signed after all?
>>
>>57179218
-d+r
>>
>>57178766
>http://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(colouriseAsm:'0',compileOnChange:'0'),source:'%23include+%3Cstdlib.h%3E%0A%23include+%3Cstdio.h%3E%0A%23include+%3Ctime.h%3E%0A%23include+%3Csys/mman.h%3E%0A%0Aconst+ssize_t+SIZE+%3D+128+*+1024+*+1024%3B%0A%0Atemplate%3Ctypename+T%3E%0Astatic+unsigned+char+f(unsigned+char+*p,+T+i)%0A%7B%0A++unsigned+char+res+%3D+0%3B%0A++res+%2B%3D+p%5Bi+%2B+0%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+1%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+2%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+3%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+4%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+5%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+6%5D%3B%0A++res+%2B%3D+p%5Bi+%2B+7%5D%3B%0A++return+res%3B%0A%7D%0A%0Atemplate%3Ctypename+T%3E%0Astatic+void+bench()%0A%7B%0A++unsigned+char+*map+%3D+(unsigned+char+*)mmap(NULL,+SIZE,+PROT_READ,%0A++++++MAP_PRIVATE+%7C+MAP_ANONYMOUS,+-1,+0)%3B%0A%0A++for+(int+i+%3D+0%3B+i+%3C+SIZE%3B+i%2B%2B)+%7B%0A++++*(volatile+unsigned+char+*)(map+%2B+i)%3B%0A++%7D%0A%0A++struct+timespec+a,+b%3B%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26a)%3B%0A%0A++for+(T+i+%3D+0%3B+i+%3C+SIZE+/+8%3B+i%2B%2B)+%7B%0A++++__asm__+volatile(%22%22+:+:+%22r%22(f%3CT%3E(map,+8+*+i)))%3B%0A++%7D%0A%0A++clock_gettime(CLOCK_MONOTONIC,+%26b)%3B%0A%0A++printf(%22%25ld%5Cn%22,+(b.tv_sec+-+a.tv_sec)+*+1000+*+1000+%2B+(b.tv_nsec+-+a.tv_nsec)+/+1000)%3B%0A%7D%0A%0Aint+main()%0A%7B%0A++bench%3Cunsigned%3E()%3B%0A++bench%3Cint%3E()%3B%0A%7D'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g493,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-O2'),l:'5',n:'0',o:'%231+with+x86-64+gcc+4.9.3',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4

At some point you have to just cache the result on the server...
>>
>>57179046
so it's roughly x2 as fast
not x2.6
and don't tell me lea is supposed to take longer than add
>>57179050
it originally started out as a discussion between whether or not unsigned or signed integers are faster, examples were posted where unsigned integers are faster and ones where signed integers are faster.
>>57179086
>a single instruction is only 32 bits wide
that's incorrect(for x86 at least).
>>
>>57179050
No. Watch this talk https://www.youtube.com/watch?v=yG1OZ69H_-o
>>
>>57179246
thanks for clarifiying this
>>
New thread:
>>57179300
>>57179300
>>57179300
>>
File: shading.png (23KB, 1399x497px) Image search: [Google]
shading.png
23KB, 1399x497px
So I'm trying to figure out shading in 3d, but the lighting is kinda weird. I thought using a simple normalized vector for the direction from which the lighting should come and then taking the dot product with the normalized vector normal to the triangle surface, then using that for the color input would be enough. But then I get this.

What am I doing wrong?

How do I do proper directional lighting, like from the sun? Please help.
>>
>>57179315
Lookup phong shading and just copy paste the shader code.
>>
>>57179326
I want flat shading, and more importantly I want to actually understand what is going wrong.
>>
yo I have this Arduino kit:
http://www.lazada.com.my/arduino-uno-ultimate-starter-pack-kit-3809669.html

What should I do with it, /dpt/?
>>
>>57179382
>What should I do with it, /dpt/?
Take it to the new thread nigga
>>
whats the common lisp equivalent to haskell's foldr?
>>
>>57179382
Whatever you want to do with it

I'd try to build a submarine, remotely controlled by a buoy with a strong blue LED sending signals to it, so it can go pretty deep.

Or maybe an automated greenhouse, measure humidity, oxygen, CO2 and keep that at a good level.
Thread posts: 383
Thread images: 35


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