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

File: travellingsalesman.jpg (210KB, 643x557px) Image search: [Google]
travellingsalesman.jpg
210KB, 643x557px
Artificial ants edition

Old: >>54906842

What do you think about swarm intelligence and metaheuristics /g/?
>>
Way too fucking early edition

Sage is your friend
>>
>>54914405
have an upboat le sire

4chan is so full of morons who didn't even read 4chanettique lolol

together we will destroy le spammers xD
>>
(copied from earlier thread)

How do websites like strawpoll prevent duplicate votes? Evercookies?
>>
>>54914710
probably ip+cookies
>>
>>54914724
But wouldn't that prevent two people on the same IP (two different computers) from both voting? I think it allows that. (can't be done with just cookies because those can be cleared)
>>
TRY TO USE THIS CODE BY ENTERING THE NUMBER 78568765 AND DEFY MATHS
def prime(n):
for x in range(2,n):
if n%x==0:
return "NOT PRIME"
return "PRIME"
def palindrome(n):
n_str = str(n)
if n_str == n_str[::-1]:
return True
else:
return False
def search_palindrome(n):
count = 0
print "Number entered: " + str(n)
while True:
count += 1
n_str = str(n)
n_rev = n_str[::-1]
r = int(n_rev)
n = n + r
print n_str + " + " + n_rev + " = " + str(n)
if palindrome(n):
break
print " "
return 'Palindrome "' + str(n) + '" found in ' + str(count) + " steps."
def prime_2(n, count):
hip = str(n) + " - 1 = " + str(int(n-1))
if prime(n) == "NOT PRIME":
print str(n) + " " + "NOT PRIME"
return prime_2(n-1, count + 1)
else:
# Recalculate the original value
original = n + count
count += 1
print str(n) + " " + " PRIME"
return "Number " + str(n) + " is prime found in " + str(count) + " steps, starting from the number " + str(original)
x = int(raw_input("Enter a number: "))
print prime(x)
print " "
print search_palindrome(x)
print " "
print "Number entered: " + str(x)
print " "
print prime_2(x, 0)
>>
>>54914852
how am I defying math? what is your search palindrome method supposed to be doing, it looks like retarded code to me.
>>
Bumping because metaheuristics!
>> TFW just had to forcefully reboot computer because the GA you ran wouldn't shutdown
>>
>>54915078
It checks if your entered number is palindrome or not, if not it will add the number entered with the palindrome of the number entered, if the result of that shows a palindrome then it will stop and if not it will keep going on calculations until it finds a new palindrome.
If you think this is retarded then you must be a real genious.
>>
>>54915132
do it on the python thing for windows, you can kill it without rebooting
>>
>>54914852
Programming in Python - Rule 1:
Never implement algorithms in Python ever and if you do at least use something like CPython or Numba or pypy or whatever is trending atm.
>>
i want to make a game but the thought of learning c# makes me feel dirty
>>
>>54915287
What kind of game? 3d, 2d? Genre?
>>
>>54915269
depends
>>
>>54915287
Do C/C++ instead. There's tons of engines/frameworks.
>>
>>54915287
Do it in html5
>>
>>54915269
the code works with other numbers so i dont see the problem
>>
>>54915360
SFML is comfy but why it uses camelCase? Literally retarded.
>>
>>54915287
Unity isn't the only option mate.
>>
>>54915327
2d i have a few things in mind
>>54915360
i was to learn c++ i'd go for unreal, but it's too overwhelming for someone learning it i think even though i know java and c.
>>54915473
i was thinking monogame desu
>>
>>54914810
Maybe it grabs your MAC Address?
>>
it's fucking retarded
>>
>>54915611
>2d i have a few things in mind
With 2d it's actually pretty realistic to build an engine on your own. You could use C++ or even just C and SDL2 and build something. There are some very simple tutorials on this. I once build a very primitive 3d shooter à la doom with it in C, it's fun as hell.

The other thing about 2d is that performance probably won't be a limiting factor, so you might as well build it with HTML5 and javascript or whatever people do these days.
>>
>>54915611
I'd recommend Anura (very good) or Magnum (graphics library).
Really for 2D you don't need much. You can write it from scratch really.
I've used Angel2D and felt it was rather comfortable when I was new. It's abandoned by devs pretty much.
>monogame
Looks good. Haven't tried it.
>>
File: energylandscape.gif (12KB, 473x285px) Image search: [Google]
energylandscape.gif
12KB, 473x285px
>>54914382
>What do you think about swarm intelligence and metaheuristics /g/?

I think this is interesting field of research. Global optimization is cool.
>>
File: Straw Poll.png (446KB, 662x444px) Image search: [Google]
Straw Poll.png
446KB, 662x444px
>>54914810
Well it says right here.
>>54915887
You could do that. Been a long time since I took my network course but I think that'd be very similar to an IP ban because of NAT? Or maybe NAT encapsulation doesn't contain a mac address. Doesn't make much sense out on the web anyway.
>>
>>54915611
Why don't you go with lua/love2d, anon? It is pretty fast and way more convenient to program in.

I know C++ and I wouldn't use it to write a 2d game. I'd go with lua because I have better uses for my time than debugging C++ segfaults/memory leaks.
>>
>>54915611
>>>/vg/144444849
Has all list of engines. But all the thread just recommends is unity and gamemaker because they're scrubs.
>>54916214
Love2D is nice. A bit bare bones imo.
>>
>>54916322
>Source isn't a real engine!
>>
Explain yourself Haskell
{-# LANGUAGE TemplateHaskell, OverloadedStrings, OverloadedLists, GADTs #-}
{-# LANGUAGE MonadComprehensions, ParallelListComp, TransformListComp, RecursiveDo #-}
{-# LANGUAGE UnicodeSyntax, LambdaCase, MultiWayIf #-}
{-# LANGUAGE BangPatterns, ViewPatterns, PatternSynonyms, TupleSections #-}
{-# LANGUAGE RankNTypes, TypeFamilies, MultiParamTypeClasses, ExistentialQuantification #-}
{-# LANGUAGE DeriveFunctor, DeriveGeneric, DeriveFoldable, DeriveTraversable, DeriveTraversable #-}
>>
>>54916396
Haskell pioneered puzzle-oriented programming paradigm. It is a language that attracts attention of autistic-but-not-bright users that happen to like to solve puzzles while programming.

A wide variety of incompatible language extensions is like a set of additional puzzle levels. An infinite timesink.
>>
>>54916536
I just want a

{-# LANGUAGE EVERYTHING, NOKITCHENSINK #-}
>>
>>54915611
SFML is alright.

>>54916322
from what I've seen in past agdg threads most of the people don't even make games/know how to program they just post there or someshit.
>>
>>54916602
The place has gone down the shitter. But there's people who know what they're doing there. They're probably the worst gamedev forum I know of aside form places like stencyls forums (Scratch-type language game engine, literal pre-teens there).

But they're ready to offer opinions and if you ask for help you generally get answers from people who have some experience.
>>
What the fuck Python.
I have a website from which I need to get some JSON data.
Making a simple requests.get() locally gets me the data immedietely.
cURLing locally gets me the data immedietely.
cURLing on a remote machine gets me the data immedietely.
Making a simple request.get() on the same remote machine takes 3 minutes.

Riddle me this.
>>
QJsonDocument jsonData = QJsonDocument::fromJson(strData.toUtf8());
QJsonObject jsonObject = jsonData.object();
qDebug()<<jsonObject["filename"].toString();


I'm back again. This time, I can't get any data from the jsonObject. When I print out jsonObject, I see the entire json so I know I'm getting it. But when I try to get the value for anything, it shows up either as an emptry string or a 0. Any idea?
>>
>>54914852

Your algorithms are pretty cool, it's a funny definition for palindrome.

protip: You can just return the conditional at the end of palindrome, i.e.

return n_str == n_str[::-1]


I really like the code though, looks like it was fun to write.
>>
>>54916692
data = json.loads(subprocess.Popen(['curl', url], stdout=-1, stderr=-1).communicate()[0])
>>
>>54914852

Another thing, to improve runtime, you can reduce calls to prime(n) by short-cutting any even numbers, and any numbers divisible by 5.
>>
>>54917012
Add me on steam as Necro Magno and explain me there (i didnt understand that part and im a noob on python so i need tips and i dont know what other instant message place to say for you to leave me a message) please
>>
PYTHON IS FUCKING RIDICULOUSLY SHIT FUCKING KILL YOURSELVES
>>
>>54917189
calm down
>>
>>54916396
not haskell the problem's with fucking GHC
>>
post cringe
https://byorgey.wordpress.com/2010/07/19/typed-type-level-programming-in-haskell-part-iii-i-can-haz-typs-plz/
>>
>>54914382
Can you make a living off freelance programming?
>>
i swear drinking coffee is not worth it in the long run

maybe if you need to be alert at a specific point in time like during working hours and then you can pay off the "debt" in your spare time

but not for drinking all the time to try to boost your total productivity. in fact i vaguely recall that there was a study that suggested coffee drinkers were less productive overall.
>>
>>54917572
or had a decreased ability to focus or something
>>
>>54917572

If I don't drink at least 2 cups of coffee a day, I'm ready for bed by 7pm. A few cups and I'm ready to stay up until 2-3 am.

Caffeine is the best.
>>
>>54917572
There's a study out there to prove anything causes anything if you look hard enough.
>>
>>54917619
you hit a wall, you end up with the same problem that ADHD people get where coffee just makes you sleepy and it makes you sleep ridiculous amounts
>>
>>54917667
desu coffee doesnt affect me in the least. maybe that's cause i do have adhd, never heard of that before though
>>
Is vulkan to the point where its better than opengl and dx11 yet
Considering making some 2d games and figured I might as well learn vulkan while Im at it.
Otherwise Ill just use dx11 though Id like to stay modern.
>>
>>54917726
vulkan is a meme use dx11 or modern opengl
>>
>>54917750
but opengl is slower than vulkan and way slower than dx11. Unless its been updated since I last looked at it.
I know khronos wants vulkan to not replace opengl so its possible they finally made it faster.
>>
>>54917779
well it looks like they definitely made it competitive to dx11
>>
>>54917779
are you thinking of ancient fixed function opengl or something

http://www.extremetech.com/gaming/133824-valve-opengl-is-faster-than-directx-even-on-windows
>>
is it possible to use VS without having to log in constantly?
>>
>>54917825
ok opengl seems a bit slower than dx11

http://www.g-truc.net/post-0547.html
>>
File: 1464998874180.jpg (72KB, 720x690px) Image search: [Google]
1464998874180.jpg
72KB, 720x690px
>>54917861
How do i even begin to make a tank simulator? Not super super simulator tier (ie: simulating all the way to the engine) but like getting the transmission, tracks, suspension, etc to all work as they should
>>
What's the easiest way to get a integer from a string in c++, where every string has a specific format?
For example
const char *hn = "HouseNr 10";
const char *fl = "Floors 3";
>>
>>54917891
use a physics engine like box2d
>>
>>54917906
can that actually simulate rotation everything of tracks, etc?
>>
>>54917861
So vulkan then
>>
>>54917906
>>54917938
>>>/vg/egg
>>
>>54917938
yes
>>
>>54917938
Yes. CHeck it. Also check OpenDynamicsEngine.
>>
>>54916888
ok. Another follow up. The 4chan json is nested so I tried this.
 QString strData = (QString)reply->readAll();
QJsonDocument jsonData = QJsonDocument::fromJson(strData.toUtf8());
QJsonObject jsonObject = jsonData.object();
QJsonValue value = jsonObject.value("posts");

qDebug()<<"filename:"<<value.toObject().value("filename").toString();


Still an empty string. Here is a link to the pretty printed json http://hastebin.com/uwumowomed.tex
>>
>>54917893

Those are C """strings""" not C++ strings.
>>
>>54918034
*Those are C strings not C++ """strings""".
>>
>>54917940
mate your 2d games should run at ridiculous framerates no matter which one you use
>>
>>54918046

Incorrect placement of quotation marks, buddy.
>>
>>54918078
My mistake.

Those are C strings not C"""++""" strings.
>>
>ld -lmapm --verbose
...
attempt to open //usr/local/lib/libmapm.so failed
...
>ls -l //usr/local/lib/libmapm.so.0
-rw-r--r-- 1 anon anon 90872 Jun 5 00:01 //usr/local/lib/libmapm.so.0
>>
File: scr5.png (16KB, 525x350px) Image search: [Google]
scr5.png
16KB, 525x350px
Redesigned the UI for my r/a/dio program. Having a rounded progressbar is too much of a problem with WPF.
>>
>>54918124
>ldconfig -v | grep mapm
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

libmapm.so.0 -> libmapm.so.0
>>
>>54918233
looks like shit anyway
>>
>>54917893

Search backward through the character array for your delimeter, get the pointer to the start of the number, run stoi() with the pointer argument.
>>
File: Got_some_nerve.jpg (44KB, 400x267px) Image search: [Google]
Got_some_nerve.jpg
44KB, 400x267px
>>54918291
ty bb
>>
>>54918065
No Im only using the 2d games to learn and practice some algorithms I made up. So learning vulkan while Im at it would help me later down the line when I get to 3d methods.
>>
>>54918124
>>54918287
Nobody ever experience this?
>>
>>54918566

Is it readable by your user?

And why are you using pam from /usr/local instead of the system libpam? That's kind of shady, right there.
>>
>>54916888
>>54918027
oh I remember this shitshow

I fixed it, hol up let me find it
>>
>>54918731
libpam? Look again.
>>
>>54918809

Ack, sometimes I think I'm getting dyslexic in my old age.
>>
>>54918809
Turns out I hadn't built the shared library correctly? I used a different recipe in the makefile and had to add -fPIC to get it to work on loonix.
>>
>>54918735
it was with twitch api, but I guess it should be the same, sendrequest part
QJsonArray MainWindow::sendRequest(QString reqe) {
QJsonArray array;
// create custom temporary event loop on stack
QEventLoop eventLoop;

// "quit()" the event-loop, when the network request "finished()"
QNetworkAccessManager mgr;
QObject::connect(&mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));

// the HTTP request
QNetworkRequest req;
req.setUrl(QUrl(reqe));
QNetworkReply *reply = mgr.get(req);
//connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateDownloadProgress(qint64, qint64)));
eventLoop.exec(); // blocks stack until "finished()" has been called

if (reply->error() == QNetworkReply::NoError) {
QString strReply = (QString)reply->readAll();

//parse json
//qDebug() << "Response:" << strReply;
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonValue value = jsonObj.value("streams");
array = value.toArray();
delete reply;
}
else {
//failure
qDebug() << "Failure" << reply->errorString();
delete reply;
}
return array;
}

    QJsonArray arrr = sendRequest(url2);
foreach (const QJsonValue & v, arrr) {
QString name = v.toObject()["channel"].toObject()["display_name"].toString();
QString previewImg = v.toObject()["preview"].toObject()["medium"].toString();
QString status = v.toObject()["channel"].toObject()["status"].toString();
int viewers = v.toObject()["viewers"].toInt();
...

just mess about with the final structure
http://hastebin.com/eloqiwuyeq.js <- twitch json structure
>>
card Hand[] = new hand[13];

Can I set do this?
Hand[1] = null;
>>
i made a 4chan scraper.

rip it apart and tell me what i could do better

import re               # Regex filtering for url parsing
import json # Extracting info from 4chan api
import requests # HTTP requests
import urllib.request # Downloading images
import os # Creating directories
import sys # Input stuff
import time # To ensure 1 request per second


def getBoard(url):
board = re.findall(r'org/(.*?)/', url)
return board[0]


def getThreadID(url):
id = re.findall(r'/thread/(.*?)/', url)
return id[0]


if len(sys.argv) < 2 or not sys.argv[1]:
print('ERR: No URL given!')
print('Usage: python scraper.py <thread url>')
sys.exit()

thread_url = sys.argv[1]

print('Parsing JSON data...')

board = getBoard(thread_url)
id = getThreadID(thread_url)

json_thread_url = 'http://a.4cdn.org/' + board + '/thread/' + id + '.json'

r = requests.get(json_thread_url)

print('Gathering image names...')

imagenames = []
for key in r.json()['posts']:
if ('tim' in key):
imagenames.append(str(key['tim']) + key['ext'])

print('Creating directory at ' + os.getcwd() + '/' + board + '/'
+ id + '...')
if not os.path.exists(board + '/' + id):
os.makedirs(+ board + '/' + id)

print('Downloading images...')
for i in range(len(imagenames)):
filename = board + '/' + id + '/' + imagenames[i]

print('Downloading http://i.4cdn.org/' + board + '/' + imagenames[i])
urllib.request.urlretrieve('http://i.4cdn.org/' + board + '/'
+ imagenames[i], filename)
time.sleep(1)

>>
>>5491896
hehe I did a project just like this for my foothill college class! Are you a student here or maybe de anza?
>>
>>54914382
proof C is weakly typed
>>
>>54919038
>python
>3 no less
get out
>>
>>54919153
>anything but python
>anything but 3

lol k stay in the past grandpa
>>
>>54919143
I don't think anyone has said otherwise
>>
File: Screenshot_142.jpg (36KB, 653x138px) Image search: [Google]
Screenshot_142.jpg
36KB, 653x138px
Why the last line?
Why set what was just deleted to null?
>>
>>54919143
>>54919182
Also
str = 5[\code]
should throw an error
>>
File: 1464368077356.gif (450KB, 472x472px) Image search: [Google]
1464368077356.gif
450KB, 472x472px
testing
>>
>>54919038
use urlparse instead of regex to parse urls.
use string.format instead of concat
is request in standard library yet? if not, stick to urllib2 to minimize dependencies on small scripts.
>>
>>54919203

So you don't have a dangling pointer?

Dereferencing nullptr will always give a fatal error.
>>
>>54919203
>>54919296
Arguably you should wrap that in a debug ifdef or whatever.
>>
>>54919143
str = 5;

That's not valid, idiot.
>>
>>54919203
I don't get the argument concerning stuff like this. Unless there's dynamic type inference compilers can generate warnings. Nobody is writing software in some spec-ether where the compiler is perfectly aligns with the language spec flaws (depending on your viewpoint).
>>
>>54919296
I thought just deleting it would be enough. Didn't know one should then also set it to nullptr.
>>
>>54919219
>>54919358
it compiles
it runs
it works just fine, error or no
>>
is there an easier way to make it so Visual Studios 2015 doesn't give me fail to compiled error 4996 when I use scanf instead of scanf_s other than to go into the project settings for each individual project and add the _CRT_SECURE_NO_WARNINGS to the precompile settings or add either the #define or #pragma warning etc etc to the top of each project?

like a setting I only have to change once so scanf successfully compiles for all projects
>>
>>54919203
I mean you should be using smart pointers in C++ anyway
>>
>>54919746
You can export project templates anyway which have that flag
>>
>>54919746
I think you can select multiple projects and set the precompile settings. Not sure how that works if you have different ones in the projects though.

Maybe you can do _CRT_SECURE_NO_WARNINGS;<different settings> or whatever it says.
>>
I want to replace my AsyncTasks with RxAndroid but I'm too retarded to understand it ;_;
>>
>>54919143
You realize what you are doing?

Str is typeless pointer.
That means it stores a number (try the code without the str = 5; assignment).

Wikipedia defines strongly typed as:
"a strongly typed language is more likely to generate an error or refuse to compile if the argument passed to a function does not closely match the expected type"
and weakly typed as:
"weakly typed language may produce unpredictable results or may perform implicit type conversion.[1] A different but related concept is latent typing."

But you gave no such example for either case. In both your printf() calls the expected type matched very closely the expected argument.

That is because %d can interpret a pointer as a number and %s can interpret a pointer as the beginning of a string.

There is no implicit type conversion str=5; is valid (although rarely useful) because pointers are essentially numbers and can be interpreted like numbers.
>>
File: KLBjfbW.png (5KB, 475x45px) Image search: [Google]
KLBjfbW.png
5KB, 475x45px
>>54919143
proof OCaml is weakly typed
>>
>>54920340
You forgot to forget your trip
>>
>>54919143
To a C programmer strong typing means pressing the keys harder.
>>
>>54919358

It is absolutely valid, and for good reason. C was originally developed to make Unix. If you're making an operating system, one of the things you're likely going to have to work with is memory mapped I/O. Say I'm working with VGA. I know that for some given architecture, certain physical addresses will map to video memory, rather than actual RAM. So on x86, I might want to try something like:

void *vga = 0xB8000;


If you don't have that capability, you're going to have a hard time doing MMIO.
>>
>>54920671
>
void *vga = 0xB8000;

Well you could have that generate an error and supress it by
void *vga = (void*)0xB8000;

right? If you decided to make C more strongly typed that could be valid. I don't see where it does harm really.
>>
In my cpp, I have the following method:
Node* LinkedList<ItemType>::getNodeAt(int position) const
{
Node* retPtr = headPtr;
int index = 0;
while(index != position)
{
retPtr = retPtr->next;
index++;
}
return retPtr;
}


It gives me an error at the line of the method signature, says Node is not a type.
I have Node defined as a struct as a private data member in my header.
Where did I go wrong?
>>
>>54920671
import GHC.Prim

vga = int2Addr# 0XB8000
>>
>>54920760
Didn't include the header file?
I'd normally assume you have obviously but that's all I can see.
>>
>>54920760
post cod
>>
>>54920694

Well I don't see any reason why one should need to do unnecessary casting. A memory address IS an integer, so setting one equal to an integer value should be built in to the language.
>>
>>54920788
A memory address is integral but not necessarily an integer
>>
What is an elliptic curve and what do they have to do with crypto?
>>
>>54920788 >>54920844
For instance, rather than 0xB8000 being VGA, you could instead have VGA as its own value, like:

enum class Address { VGA, e0, e1, e2 ... }
>>
>>54920788
Well the reason we do strong typing is to catch errors. With C's dereference syntax there can be many errors. If you have a single letter variable you can accidentally put the * on the wrong side of the variable and do
void* p=0x00BEEF;
p*=5;

for instance. The cast doesn't need to be a runtime cast.
>A memory address IS an integer, so setting one equal to an integer value should be built in to the language.
They're semantically different though. We use hexadecimal as memory addresses usually because it's simpler to read that way.

I don't particularly care much. Most compilers allow you to catch this if you want. I'm just saying that it's a very low overhead that could catch errors.

But considering they had harddisk constraints back then it makes quite a bit of sense to just not cast. Guess it's just a sign of the times that we care.
>>
>>54920844

>integral
>of or denoted by an integer
So what you're saying is that it's an integer.

>>54920846

Don't make me pull out my notes. I can't pull this shit off the top of my head.
>>
>>54920846
It has something to do with factoring integers and public key cryptography. I don't remember. Something about Santa and packets..

I suggest you read about it.
>>
>>54920864
Is 'z' an integer?
Is 'z' integral?
>>
>>54920864
On my machine 'long's are used for pointers.
>>
>>54920852

Let's see what happens if we use this in a C program:

#include <stdio.h>

int main(void)
{
void* p=0x00BEEF;
p*=5;
printf("%p\n", p);
return 0;
}


The result:

$ gcc -std=c11 foo.c
foo.c: In function 'main':
foo.c:5:10: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
void* p=0x00BEEF;
^
foo.c:6:3: error: invalid operands to binary * (have 'void *' and 'int')
p*=5;


Well, it seems the compiler will at least warn you about assigning literals without a cast, but the operation you were worrying about? Why, that's invalid. You can't multiply a pointer; pointer

>>54920917

Yes and yes. 'z' is just syntactic sugar for the integer 122.

>>54920919

long is a stupid type. I've seen way too much code that assumes that it's always the length of a pointer, because the idiot who wrote it either has never worked with Windows or likes to pretend Windows doesn't exist.
>>
>>54920864
Get the notes
>>
>>54920773
>>54920780
I forgot to mention it's a private method.

Header:
#ifndef LINKEDLIST_H
#define LINKEDLIST_H

template <class ItemType>

class LinkedList
{
public:
LinkedList();

bool isEmpty() const;
int getLength() const;
bool insert(int index, const ItemType& item);
bool remove(int index);
void clear();
ItemType getIndex(int index);
int find(const ItemType& item);
void printList() const;

private:
struct Node // Struct so I can have my linked list.
{
ItemType item; // Data item.
Node* next; // Pointer to the next node.
};

int itemCount; // Current amount of items in list.
Node* headPtr; // Head/beginning of the list.
Node* getNodeAt(int position) const;


};
#include "LinkedList.cpp"
#endif // LINKEDLIST_H


cpp
#include "LinkedList.h"
#include <iostream>
using namespace std;

template<class ItemType>
LinkedList<ItemType>::LinkedList()
{
headPtr = NULL;
itemCount = 0;
}

poop load of methods...
then at the very end

Node* LinkedList<ItemType>::getNodeAt(int position) const
{
Node* retPtr = headPtr;
int index = 0;
while(index != position)
{
retPtr = retPtr->next;
index++;
}
return retPtr;
}

>>
>>54920951
Are you telling me the C standard has what warnings you're supposed to implement in the C standard? I had no idea.
>can't multiply a pointer
Fair enough. But you see how there can be unintentional cases at the very least.
>>
>>54916182
That looks to be a system displaying pattern formation, you don't happen to do much in the way of nonlinear dynamics do you?
>>
>>54920996
Maybe you can do LinkedList::Node?
Why do you want it private?
>private method.
Nested struct.

I've never done this.
>>
>>54920951
>pretend Windows doesn't exist
That's a completely understandable thing for a programmer to do. However, I still think people should be using (u)intptr_t or not try treat pointers like integers.

>>54921015
>Are you telling me the C standard has what warnings you're supposed to implement in the C standard? I had no idea.
There are a few cases where the standard says that the compiler must emit a warning of some sort.
I'm not sure if assigning an integer to a pointer without a cast is one of them though.
>>
>>54921015

Of course there are going to be unintentional use cases. Consider that this is completely valid:

#include <stdio.h>

int main(void)
{
printf(2);
return 0;
}


But like before, the compiler's going to give you warnings. And if you're smart, you're going to use -Werror to keep yourself from doing completely retarded shit.
>>
>>54921066
Well having looked into what >>54921050
said.
Apparently:
>An implementation may generate warnings in many situations, none of which are specified as part of this International Standard. The following are a few of the more common situations.
>http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
>An implicit narrowing conversion is encountered, such as the assignment of a long int or a double to an int, or a pointer to void to a pointer to any type other than a character type (6.3)
So it's just recommended you do. Which if we're gonna rely on the warnings (which I'd consider appropriate) should be a required warning if you're supposed to be satisfied with the C language spec.

But yeah. As I mentioned I really don't care much because warnings do exist regardless of the C standard.
>>
>>54921050

(u)intptr_t would be the ideal way of doing things.
(s)size_t and ptrdiff_t would also be, to a lesser extent, still better options than longs. In TinyScheme, I find it incredibly annoying that the creator would decide that the type long would be used to represent integers in Scheme. This is particularly because integers in scheme are also used to represent the size of strings, and as such, the choice leaves the programmer in a strange predicament where in 64-bit Linux, a TinyScheme program can handle more than 2 GiB of data in a string, while on 64-bit Windows, this is not the case. Yet the entire problem could have been avoided by just using ssize_t, since the integer a.) has to represent something's length, and b.) has to be signed.
>>
>>54921096
>So it's just recommended you do
http://port70.net/~nsz/c/c11/n1570.html#5.1.1.3
> A conforming implementation shall produce at least one diagnostic message (identified in an implementation-defined manner) if a preprocessing translation unit or translation unit contains a violation of any syntax rule or constraint, even if the behavior is also explicitly specified as undefined or implementation-defined. Diagnostic messages need not be produced in other circumstances
Invalid syntax is a situation where a diagnostic message is required.
However, considering that it's implementation defined, it could be as unhelpful as "error" or "Something Happened".

>>54921120
Yes, people should use the standard C "typedeffed types" (is there an actual term for these?).
However, I think people have gotten a lot better at it, and you only see the prevalence of long and stuff in older code.
>>
>>54921066
>completely valid
At best, that shit is implementation defined.
>>
God I hate you language pedants. You're arguing about something that doesn't matter in practice. It's personal choice and you're not even arguing about what's the correct way of doing things (because you all agree).
>>
Is C worth learning?
>>
>>54921256
Yes. It's one of the best things to learn.
>>
File: rust-logo-512x512.png (94KB, 512x512px) Image search: [Google]
rust-logo-512x512.png
94KB, 512x512px
What does /dpt/ think of Rust?

- good lang
- community fucked up the ass by SJWs
>>
>>54921256
Yes certainly.
I'd say it's mainly worth learning not because of the language but rather because of the requirements it puts on you by not being that abstract.

Writing software in C is what teaches you the most. You need to know C for that.
>>
File: C o C.png (6KB, 505x74px) Image search: [Google]
C o C.png
6KB, 505x74px
>>54921284
Only one of those is true
>>
>>54917517
Depends on where you live.
>>
>>54921284
I like it. I don't give a fuck about SJWs. Why would you even bring an "issue" like that into the discussion ever?
>>
>>54921358
because they would deny you from participating in the community

if you ever talk about anything they disagree with, you will be banned from Rust convention and have your contributions/repos blacklisted
>>
>>54921284
it's shit
>>
>>54921408
What's Rust's license?
>>
>>54921436
Dual Apache/MIT IIRC.
>>
>>54921425
why's that?
>>
>>54921408
Wow , you get prosecuted when you spout 'le jews did it', 'muh holohoax', 'le happy merchant', '(((Shekelberg)))' etc. in a programming discussion.
Really makes you think, doesn't it?
>>
>>54921477
>prosecuted
>>
File: 1392359762334.png (735KB, 750x850px) Image search: [Google]
1392359762334.png
735KB, 750x850px
>>54921492
kek, English verbs are retarded. Or maybe I am :3
Here, have a cute /g/-related animu strip.
>>
>>54916182
>Global optimization is cool
Useless for practical problems.
>>
>>54921568
Are you retarded?
>>
>>54919508

Deleting the pointer returns that area of memory back to the heap so it can be reused. But the pointer itself still exists until it goes out of scope (i.e. you return or otherwise exit the block the pointer is declared in).

Deleting the pointer is all you need to do to prevent memory leaks. However, if you have a bug somewhere that tries to access that memory after you delete it, you'll be accessing unmanaged memory.

If the pointer is set to nullptr, it's guaranteed to cause a fatal error if you dereference it. This is preferable to accessing some random region of memory that you might be storing important data in.

TL;DR you don't have to set the pointer to nullptr, but it's a very good practice to get into.
>>
>>54921816
>using languages that allow you to set pointers to null
>>
>>54921846
>using languages that use pointers
>>
>>54921904
>writing code
>>
File: hebre.webm (3MB, 1280x720px) Image search: [Google]
hebre.webm
3MB, 1280x720px
/dpt/-chan, daisuki~

>>54921309
>Writing software in C is what teaches you the most.
No

>>54921256
Not anymore.

>>54921284
It's a good programming language where the hobbyist "low level" stuffs is now happening. I find it a little too verbose for me.

>>54919143
Not weak typing. Weak typing is this

int a = 1;
float *f = (float*)&a;
float fb = *f;


>>54917517
http://upwork.com/

>>54917750
But opengl drivers overhead is not a meme.
>>
>>54921846

>pointers are s-s-s-scary!

Let me know when you grow the fuck up, kid.
>>
>>54921846
>I'm retarded
>please handhold me
>>
File: she.png (7KB, 257x118px) Image search: [Google]
she.png
7KB, 257x118px
Reminder that the only people who like weak typing are feminists
>>
>>54921976

Reminder that 4chan is an 18+ site.
>>
>>54921976
What about people with two Y chromosomes?
>>
>>54922002
Men
>>
Presenting the code of the average Haskell "programmer":

http://stackoverflow.com/questions/37526740/why-is-the-f-version-of-this-program-6x-faster-than-the-haskell-one

main = do
t <- fmap (read . T.unpack) TIO.getLine -- With Data.Text, the example finishes 15% faster.
T.unlines . map (T.pack . show . solve . V.fromList . map (read . T.unpack) . T.words)
<$> replicateM t (TIO.getLine >> TIO.getLine) >>= TIO.putStr


The problem is not decomposed properly. The code is noisy, written in point-free style, and cannot be read - only analyzed. There is one useless comment that shows us what the author thinks is important: that he managed to make this function 15% faster (literally just 15% faster) through an obvious optimization.
>>
>>54921944
God damn, you're seriously the biggest retard in this thread.
>>
>>54922040
What about "people" with 5 X chromosomes?
>>
>>54914852
Your method to check prime numbers is extremely inefficient, firstly, you wouldn't need to check up to n, but only up to sqrt(n) for any integer factors.

Secondly, you're in python and have the tools to deal with very large numbers, there are better ways to test whether a number (possibly) is prime
https://en.m.wikipedia.org/wiki/Primality_test

My favourite test is the Fermat primality test due to how simple it is, just be sure to use build in modular-power functions and do not power and then modular a number
>>
>>54922096
Women
>>
>>54922002
data SexChromosome = X | Y deriving Eq
type Chromosomes = [SexChromosome]

chromosomesOf :: Sex -> Chromosomes
chromosomesOf Man = [X, Y]
chromosomesOf Women = [X, X]

isMale :: Chromosomes -> Bool
isMale = elem Y

genderOf :: Chromosomes -> Sex
genderOf cs
| isMale cs = Male
| otherwise = Female

>>
>>54922155
correction
chromosomesOf Male = [X, Y]
chromosomesOf Female = [X, X]


polite sage for double post
>>
>>54922155
this is silly

SexChromosome is isomorphic to Bit, and chromosomes should be a list of a polymorphic variant [<SexChromsome]
>>
>>54916214
>>54916322
i looked at love2d too but i'd also need to learn lua, plus most of they're docs are deprecated or very superficial. i'll think about it.
>>
File: arpanet_at_its_glory.webm (2MB, 1600x900px) Image search: [Google]
arpanet_at_its_glory.webm
2MB, 1600x900px
Has anyone got ideas for small projects?

i'm bored as fuck.
Video related.
>>
File: 1464942414757.png (1MB, 3840x2160px) Image search: [Google]
1464942414757.png
1MB, 3840x2160px
>>54922295
>>> random.org
>>
>>54914852
Change line 2 range(2,n) to range(2,sqrt(n)) but round it up before
>>
>>54922330
066 will get your IP banned
>>
>>54922360
Only if you implement it in a retarded way?
>>
>>54920846
Let Russian Math Man explain
https://www.youtube.com/watch?v=ulg_AHBOIQU
>>
>>54920671
It's called
uint8_t *vga = 0xb8000;
tard.
>>
To convert an 8 bit array to 16 bits it's just
byte2 * 256 + byte 1

right?

What do I do with the final byte if the array is odd? Leave it as is? Truncate?
>>
>>54922530
>not using uint16 for it
>>
File: cat in bath.webm (386KB, 261x194px) Image search: [Google]
cat in bath.webm
386KB, 261x194px
can anyone give me a quick rundown on how to embed a compiled binary in a Mac Cocoa application in Xcode?

I just want to embed a command line utility (which is a Unix Executable) and make a GUI for it
>>
>>54922547
union
{
u8 b[2];
u16 s;
}
>>
>>54922701
kys
>>
>>54922701
>2016
>not using cross platform toolkits
>>
>>54922980
undefined behaviour
>>
>>54923082
show me where in the standard such an undefined behavior is stated. (protip: you can't, whiteboi)
>>
>>54923082
No it's not. C11 allows you to read members of unions that wasn't the last one written to.
I am however making the assumption that this is C, with some silly typedefs.
>>
>>54922980
I'm not using C.
Can you explain this in terms of arithmetic instead.
>>
>>54923188
What programming language are you using ?

https://en.wikipedia.org/wiki/Union_type
>>
>>54923188
>Can you explain this in terms of arithmetic instead.
Type-punning has nothing to do with arithmatic. It's taking the "raw" values of one type, and reading it as if it was a different type, without conversion.
It's sort of achieves the same thing you were doing, but introduces problems with endianess.

What you were doing before was right, but it may be slightly more obvious what you were doing if you wrote it like
byte2 << 8 | byte1

In terms of your last question, that's entirely up to you.
>>
>>54914710
>>54914810
With strawpoll in particular, I think you can choose whether to limit with IP. If you do that, it would indeed prevent two people with the same IP from voting.

In the more general sense, this isn't a problem you can perfectly solve. Some suggestions follow. You would want to use one or more of these, weighted by feasibility and other factors.
* Simple cookies
* "Evercookies"
* Server-side fingerprinting
* IP limiting
* Require email verification to vote (but it is easy to set up catchall emails that would trivialise this)
* Require Facebook/other social login to vote
* Require payment to vote
* Require manual verification of government issued photo ID scan to vote
* Require the completion of an extensive third-party background check including interviews of friends, relations, and coworkers to vote
>>
>>54922701
nevermind i figured it out.


let bundle = NSAbundle.mainBundle()
let task = NSATask()

task.launchPath = bundle.pathForResource("wewlad", ofType: "")
// the ofType is a blank string because unix applications dont' have an extension. otherwise you could put txt or jpg
>>
Is it still legal to include encryption in your software?
>>
>>54923396
What the hell kind of country do you live in if that is a question you're seriously asking?
>>
>>54923396
It has always been legal and will always be legal. Unless you're living in burgerville obviously.
>>
File: RUST.png (111KB, 512x512px) Image search: [Google]
RUST.png
111KB, 512x512px
>>54921948
imagine if you couldn't compile your program if you had a dangling pointer, any sort of memory leaks, or data races.
>>
>>54923459
It does that? If so, that's pretty nito.
>>
Why C++ does not have a BDD library ready ?
>>
>>54923418
NSA/America, or as I've recently started calling it, NSA plus America
>>
>>54923476
I mean, a Database*
>>
>>54923473
It does- if you don't use `unsafe` blocks, it isn't possible to write memory-unsafe code in Rust.

Of course, you do pay for this with code complexity. But I'd suggest looking into it if you need performant but safe native code.
>>
>>54923476
What the heck is a database library? What fucking database do you want to interact with? Postgres? SQLite? Berkeley DB?
>>
>>54923473
>>54923491
it does, and the fun part is that no additional overhead is required, it's all zero cost abstractions
>>
>>54923486
WTF are you talking about? There are a gazillion database libraries for C++.
>>
>>54923509
0 native
>>
>>54923531
Because nobody in their right mind writes C++ APIs.
>>
>>54923531
http://www.sqlapi.com/
http://en.cppreference.com/w/cpp/links/libs#Databases
https://github.com/SOCI/soci
https://github.com/rbock/sqlpp11
So many more
>>
use std::collections::HashMap;
use std::hash::Hash;
extern crate sfml;
use sfml::graphics::{Texture, Font};

pub trait Resource: Sized {
fn new_from_file(filename: &str) -> Option<Self>;
}

impl Resource for Texture {
fn new_from_file(filename: &str) -> Option<Self> {
Texture::new_from_file(filename)
}
}

impl Resource for Font {
fn new_from_file(filename: &str) -> Option<Self> {
Font::new_from_file(filename)
}
}

pub struct ResourceManager<I, R> {
resource_map: HashMap<I, Box<R>>
}

i
mpl<I: Eq + Hash, R: Resource> ResourceManager<I, R> {
pub fn new() -> Self {
ResourceManager {
resource_map: HashMap::<I, Box<R>>::new()
}
}

pub fn load(&mut self, identifier: I, filename: & str) {
let resource = R::new_from_file(filename).unwrap();
self.resource_map.insert(identifier, Box::new(resource));
}

pub fn get(&self, identifier: I) -> &Box<R> {
match self.resource_map.get(&identifier) {
Some(resource) => resource,
None => panic!("Tried to access nonexistant index in resource map")
}
}
}

#[derive(PartialEq, Eq, Hash)]
pub enum TextureIdentifiers {
Nebula,
Rocket
}
#[derive(PartialEq, Eq, Hash)]
pub enum FontIdentifiers {
Arial
}

pub type TextureManager = ResourceManager<TextureIdentifiers, Texture>;
pub type FontManager = ResourceManager<FontIdentifiers, Font>;


r8 h8
>>
>>54923562
Will take a look, thank you
>>
I'm sidestepping recaptch@ with phantomjs.
Fuck g00gle kikes.
>>
>>54922046
Why don't you post the pretty and faster version, you retarded mongrel?
import Data.List (unfoldr)
import Control.Applicative ((<$>))
import Control.Monad (replicateM_)
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C

parse :: ByteString -> [Int]
parse = unfoldr $ C.readInt . C.dropWhile (== ' ')

solve :: [Int] -> Int
solve xs = foldl go (const 0) xs minBound
where go f x s = if s < x then f x else s - x + f s

main = do
[n] <- parse <$> B.getLine
replicateM_ n $ B.getLine >> B.getLine >>= print . solve . parse
>>
>>54924024
(You)
>>
>>54924082
>the pretty and faster version
>written by a non-retard instead of a typical Haskell user
>>
>>54924187
t-thanks :3
>>
File: z10615819Q,Yerba-mate-w-tykwie.jpg (41KB, 560x447px) Image search: [Google]
z10615819Q,Yerba-mate-w-tykwie.jpg
41KB, 560x447px
>>54917572
>>54917614
>>54917619
>>54917712
Any clues about yerba? I find it very trending in my office where 1/3 of around 200 workers walk with that damn yerba mug.
They even convinced our Boss to put it into office kitchen just as tea/coffee so people dont have to bring their own to work.

I'm curious about it. Any long term side effects? is it healthier than coffee? Or is it just hipster fashion.
>>
File: smuggo01.jpg (105KB, 551x600px) Image search: [Google]
smuggo01.jpg
105KB, 551x600px
MFW my node.js scripts process gigabytes of data

MFW I wrote a multithreaded search engine parser that can run 300 parallel requests
>>
I gave up on making my web file manager modular. I ended up with a MVC like framework and spaghetti code. So no modular magic for now.
>>
File: Screenshot_2016-06-05_16-22-18.png (914KB, 602x625px) Image search: [Google]
Screenshot_2016-06-05_16-22-18.png
914KB, 602x625px
>>54914382
I'm working on a simple 2D warfare game (or more likely simulation as I want dot to fight on their own) currently being inspired by napolenic wars. (muskets, bagnet fighting etc.)

Fun to watch your own anmations to move ad kill each other.
>>
>>54922547
Pad zero bytes onto the end, then convert.
>>
>>54924751
Cool. I like simulations, it's an infinite hobby.
>>
How do you find exercises for a language?
I'm learning java SE since two weeks and i'm trying to find exercises that are in my reach but i somehow found dickall.
>>
>>54925066
All languages are broad.

The best resource is not one resource, but at least 2.

Find a beginners tutorial, as well as a tutorial that is specific to your current programming desire.

Attempt to program parts of that desire using the specific tutorial, falling back to the general beginner tutorial/reference when you get stuck with a particular programming construct.
>>
>>54919296
>Dereferencing nullptr will always give a fatal error.
false
>>
File: oop masterrace.jpg (45KB, 500x225px) Image search: [Google]
oop masterrace.jpg
45KB, 500x225px
reading sicp is making me want to go back to OOP again... like right now i'm reading about functions (define (right-branch tree) (caddr tree)) to get the right branch of a BT and i looked up caddr and it's defined as (car (cdr (cdr x))). in java i could just make an object with a left branch right branch and value fields.. i need to be reminded why OOP is bad remind me
>>
>>54923582
>*Manager
>it's a pointless wrapper for a data structure
Every time.
>>
>>54924582
>MFW my node.js scripts process gigabytes of data
>things that happened
>>
>>54924473
100% trendy fashion bullshit, it's just another caffeine delivery mechanism
>>
>>54925269
I have done even 10 GB, anon.
>>
>>54925066
i can give you some exercises right now
1) count from 1 to 100, if the number is divisible evenly by 3 print fizz, by 5 print buzz, by both 3 and 5 fizzbuzz, and by none of the abother then the number (hint: modulo)
2) make a function that prints the circumference, diameter, and area of a circle given a radius
3) make a function that returns the value of the number in the fibonacci sequence at a given index (1 returns 1, 2 =1, 3 =2, 4 = 3, 5 = 5, 6 = 8, etc)
4) make a function that returns the coordinates of the midpoint of a line
5) make a function that finds the square root of a number

i do these types of exercises in every language that i'm learning and keep them on hand for reference. i'm slowly building up a code bank of sorts. if i'm working on a project and need a square root function i can just search square root + language and copy and paste the function into my project
>>
>>54925344
Anything can parse data given infinite amount of time.
>>
>>54920788
>A memory address IS an integer
wrong
>>54920844
>A memory address is integral
wrong
>>54920951
>long is a stupid type
not more or less than the rest of them
>code that assumes
that's a problem with the code tho
>>54921066
>Consider that this is completely valid:
no, it's undefined behavior
>>54921120
>(u)intptr_t would be the ideal way of doing things
it can't be ideal because it's optional
>while on 64-bit Windows
>the entire problem could have been avoided by just using ssize_t
ssize_t is a posix type and wouldn't help you anyway on windows
>>54921816
>If the pointer is set to nullptr, it's guaranteed to cause a fatal error if you dereference it.
false, there's no such guarantee
>but it's a very good practice to get into
it's cargo cult
>>54921944
>Weak typing is this
no, that's undefined behavior, you're just a retard as usual
>>
>>54925373
The point is, node.js is very past. V8 is magic technology.
>>
>>54925441
fast
(^:
>>
>>54925441
>magic
yes, jscucks are known for not being capable of understanding how things work
>>
>>54925459
>using the smiley face with the carat nose
go back to redchan
>>
>>54925441
Fast is relative. It's still insanely slow compared to C, C++ and Rust.
>>
>>54925491
if you want speed, use assembly. if you want power, use a lisp dialect. if you use any language other than assembly or lisp you're a peasant and you should get off of my dpt

prove me wrong
>>
>>54925511
>if you want speed, use assembly
Compilers can produce more efficient assembly than most people
>>
>>54925486
I understand how dynamic language compilers work, but I also understand how enormous of engineering feat V8 is. The fact that all this complexity works precisely as intended is magical.

>>54925491
In my benchmark JS is only 4 times slower than C++/gcc -O3.
>>
>>54925511
Does that mean you're a peasant?
>>
>>54925421
nullptr do serve a purpose as it always cast to a pointer so you don't accidentally call the int specialization of a template or shit like that.
>>
>>54925491
Not him, but modern benchmarks pit JS as being just as fast as C++ when executing tasks millions of times due to AoT compilation.

I dont check its comparisons to C, etc as often, but with V8, its like C++ but development time is quicker
>>
>>54925534
>magical
>only
called it
>>
>>54925667
Most workloads are io bound nowadays
>>
>>54925589
>non-sequitur
>>54925607
>due to AoT compilation
apparently you don't know what AoT means
>with V8, its like C++
not at all
>>
>>54925692
>backpedaling
of course
>>
File: prewrfs.png (11KB, 721x391px) Image search: [Google]
prewrfs.png
11KB, 721x391px
>>54925421
>>A memory address IS an integer
>wrong
>>
>>54925765
They didn't say it's an unsigned integer :%)))))))))))))))))))))))))))))))
>>
>>54925779

wow my dude
>>
>>54914710
Straw pole is ip I know because proxy spam works on them.
>>
>>54925421
>>Consider that this is completely valid:
>no, it's undefined behavior
No, it's implementation defined.
>>
>>54925887
no, idiot, the standard says it's undefined
>>
How can I calculate the writing speed of a process output buffer? So I know more data isn't coming as a response to a command written to the input. I currently sleep(0.1) and stop waiting if it happens for 3 times. Is there a better way? It's a python script.
>>
>>54926003
"An integer may be converted to any pointer type. Except as previously specified, the result is implementation-defined, might not be correctly aligned, might not point to an entity of the referenced type, and might be a trap representation. 67)"

"67) The mapping functions for converting a pointer to an integer or an integer to a pointer are intended to be consistent with the addressing structure of the execution environment."
>>
Can calling functions from other classes be slow? In my game I have a CollisionHandler class, and it calls an AABB function from a namespace in another file. Would moving that AABB function to the CollisionHandler give any significant speed improvement?
>>
Shittiest noob programmer here.

I want to do a python CLI that accept's two inputs: USERNAMES.TXT and IPs.TXT and test into port 25 with a VRFY user every username inside username.txt into every ip from IPs.txt

I have the skeleton here:

#!/usr/bin/python
import socket
import sys

if len(sys.argv) !=2:
print "Usage: checkVRFY.py <username> <ipfile.txt>"
sys.exit(0)

# Create a Socket
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# Connect to the server
connect=s.connect((sys.argv[2],25))
# Receive banner
banner=s-.recv(1024)
print banner
# VRFY user
s.send('VRFY ' + sys.argv[1] + '\r\n')
result=s.recv(1024)
print result
# Close the socket
s.close()

I think I have to put a FOR and open ipfile.txt and inside that put another for to use it with the s.send variable but I'm fucking lost.

Anyone can help this newb out? Thanks.
>>
>>54925610
>>54925610
>>54925610

I asked a stupid question here.
>>
>>54926209
The Jews always know anon
>>
>>54926049
J.2 The behavior is undefined in the following circumstances:
An argument to a library function has an invalid value or a type not expected by a function with variable number of arguments.

7.21.6.3 The printf function is equivalent to fprintf with the argument stdout interposed before the arguments to printf.

7.21.6.1 The fprintf function writes output to the stream pointed to by stream, under control of the string pointed to by format that specifies how subsequent arguments are converted for output.

7.1.1 A string is a contiguous sequence of characters terminated by and including the first null character

fuck off
>>
>>54926209
you're assuming they analyze from the bottom up when they probably analyze from the top. look at the most popular app or whatever and then investigate whether it was licensed. if not, you take the person to the bank. repeat down the ladder
>>
>>54920760
>>54920996

Same fag, I guess I had to forward declare the struct Node. So, I did this:
template <class ItemType>
struct Node; // Forward declare.
class LinkedList
{
blahblah
}


But I'm still getting an error with my getNodeAt method. It now says:
LinkedList.cpp|171|error: prototype for 'Node* LinkedList<ItemType>::getNodeAt(int) const' does not match any in class 'LinkedList<ItemType>'|
LinkedList.h|46|error: candidate is: LinkedList<ItemType>::Node* LinkedList<ItemType>::getNodeAt(int) const|


Which I don't understand. How it was declared in the header:
Node* getNodeAt(int position) const;



How I wrote it in the cpp
template<class ItemType>
Node* LinkedList<ItemType>::getNodeAt(int position) const
{
Node* retPtr = headPtr;
int index = 0;
while(index != position)
{
retPtr = retPtr->next;
index++;
}
return retPtr;
}
>>
>>54921197
Implementation defined/undefined behavior doesn't make code not legal. Your compiler will throw every warning it can at you, but in the end, grammatically and semantically, implicit conversion from integer constant to pointer is legal.

>>54925421
1. Fundamentally at the level of the CPU, memory addresses are integers. You store them in integer registers, and perform integer arithmetic on them to produce other integers, with which to use with load and store instructions. NULL, for example, literally is the integer 0.

2. See above with regards to it being undefined behavior. It could do anything at runtime, but that doesn't mean it's not a legal program.

3. ssize_t is supported on Windows, and since we know it is considered the same size as size_t, will certainly provide the desired effect. Also, it would not be the first POSIX extension thrown in there, if I remember correctly.
>>
>>54926311
>Also, it would not be the first POSIX extension thrown in there, if I remember correctly.

There are indeed a bunch of them.
>>
>>54926256
Good point.
>>
>>54926311
>Fundamentally at the level of the CPU, memory addresses are integers. You store them in integer registers, and perform integer arithmetic on them to produce other integers, with which to use with load and store instructions. NULL, for example, literally is the integer 0.
You're talking about certain kinds of CPU. This isn't even true on x86 because of segments and on some architectures you can't even read the bits of a pointer.
>>
>>54917851
>>54917851
>>54917851
bump
>>
In javascript, is the built in function "reduce" functional?
It keeps track of the previous and current elements, but does this by passing them as parameters until finally returning one value.
So is "reduce" functional?
>>
>>54926358

>This isn't even true on x86 because of segments
Eh, at least the bottom 16 bits are considered an integer that is manipulated. The rest can be trivially shoved into another register.

>on some architectures you can't even read the bits of a pointer.
Name one, I'm curious now.
>>
>>54926057
Generally you can only fit so much code into your cache. Functions are different sections in memory, and every time you jump to one, you may be loading that memory into your cache. If it doesn't all fit you could be unloading and loading memory every single time you enter and return from a function. I'd reckon if the called function calls ANOTHER function you'll definitely unload the first called function from the cache.

There's this concept called loop unrolling where you "unroll" loops into, for example, ten statements rather than do a for (x=10;..

In general I wouldn't worry about thsee things as they'll only slow you down in creating a working program. Once everything works, THEN you can start optimizing

Also anyone feel free to correct me if I'm wrong about something in this post
>>
>>54926415
Yes, it's a fold. https://en.wikipedia.org/wiki/Fold_(higher-order_function)
>>
>>54926452
>Name one, I'm curious now.
Burroughs 5000 and some capability architectures.
>>
>>54926511
Sweet! I realized I can make my programs more functional by replacing for loops with reduce.
>>
What's the difference between doing:
#ifndef HEADER_H_INCLUDED

and

#ifndef HEADER_H
?
>>
>>54926627
nothing, as long as it's followed by
#define HEADER_H
or
#define HEADER_H_INCLUDED
>>
File: sad.jpg (411KB, 3264x1952px) Image search: [Google]
sad.jpg
411KB, 3264x1952px
>>54925421
>no, that's undefined behavior

Irrelevant. Despite static typing being done in the static environment, C's type system still doesn't warn you. Being able to break the type system is the very definition of weak typing.

>>54925421
>you're just a retard as usual
Please, don't bully.
>>
>>54926627
You do know the purpose of doing this in your header files? If yes then you already know the answer.
>>
>>54921178
>Yes, people should use the standard C "typedeffed types" (is there an actual term for these?).
fixed-width types is the term.
>>
>>54926653
>>54926686
I think I know the purpose:

if not defined,
define header
end if.

It's to avoid compiler issues because when the header file is included in other parts of the program, it can compile twice, and we don't want that, hence the ifndef. I just started using codeblocks and made a header for C (I'm more familiar with C++), and it did the _INCLUDED part automatically. I've never seen that before. Thought maybe it had some kind of special meaning in C.
>>
>>54921284
It's alright. Trying to do parallel matrix multiplication (which is a simple concept) was a bit of a head ache though because of all the safety.
>>
>>54926311
>undefined behavior doesn't make code not legal
you're an idiot that doesn't know what undefined behavior means
>Fundamentally at the level of the CPU
fundamentally, at the level of C, there's no requirement about what happens at CPU level
>store them in integer registers
you assume
>NULL, for example, literally is the integer 0
you're too stupid to understand conversions and the difference between value and representation
>It could do anything at runtime
or compile time, if you had any idea what undefined behavior means
>ssize_t is supported on Windows
not with posix semantics
>we know it is considered the same size as size_t
apparently you don't know shit about how ssize_t is defined by posix
>will certainly provide the desired effect
certainly? at least in vc2010 it was unsigned; the msdn doesn't even acknowledge it, it only documents SSIZE_T
>>
>>54926673
>Irrelevant
>Consider that this is completely valid
you don't know what undefined behavior is, dumbass
>Please, don't bully.
please, stop trying to "give advice" if you're retarded
>>
I'm supposed to make a function in C that turns all lower case chars in a string to upper case.

The conversion itself is easy, but I have problems turning it into a function. Any function that manipulates a variable in general.

It is not possible to return a string, only numbers, correct?
And it's not possible to manipulate the input variable inside of the function either, only a new variable that has the same content as the original one, right?
Then how do I make the input variable change to what is created inside of the function?

example:

void capitalize(char newstring[100])
{
//turn all lower case letters of newstring to upper case letters
return 0; //I want to write the result into the variable though
}


int main (){
capitalize(stringvariable);
}
>>
>>54926741
>fixed-width types is the term
it's one of the terms
>>
>>54926846
>he hasn't learned about NULL-TERMINATED BYTE ARRAYS yet
You poor fool
>>
>>54926767
Just sounds like another reason why nobody doing serious work would use codeblocks.

Adding "_INCLUDED" to the end of every header define would be like prefixing every integer variable with "int_". It's redundant.
>>
>>54926268
No m8
the Node struct that you forward declared OUTSIDE LinkedList
and
the Node struct that you defined INSIDE LinkedList
are two distinct types
lrn2scoping
and the error is pretty much telling you this
LinkedList.cpp|171|error: prototype for 'Node* LinkedList<ItemType>::getNodeAt(int) const' does not match any in class 'LinkedList<ItemType>'|
LinkedList.h|46|error: candidate is: LinkedList<ItemType>::Node* LinkedList<ItemType>::getNodeAt(int) const|

Reread it toroughly

So get rid of the forward declaration
it's shit
and you don't need a forward declaration anyway
>forward declaration (in header)
>definition (in header)
>usage (in getNodeAt implementation)
that's not a forward declaration situation

And fix this fucking line:
LinkedList.cpp:171
and none other
>>
>>54926866
so you suggest to treat the string as a regular number array, then return the resulting array? Can I return arrays?
>>
>>54926844
"""
undefined behavior: behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements
"""
>>
I have a 2 dimensional vector of ints. How do I completely clear the whole thing? Right now I'm just calling vector.clear(), but I'm not sure if that deletes everything.
>>
>>54926846
return a char* to the string transformed.
>>
>>54926846
When a function takes an array as an argument in C, it does not receive a copy of it. So if you modify the input array, the caller's array will also be modified.

This can lead to some surprising results. An alternative would be to have the function allocate a new array using malloc and returning that, but then the caller needs to keep track of it and free it. Or the user can supply two arrays, one with the actual input and one with enough space to store the output.
>>
>>54926895
>I can quote the standard but I don't understand what it means
if you weren't completely brain dead, you'd have read the NOTE that explains to monkeys like you that anything can happen, even at translation phase (aka. "compile time" for baboons such as yourself)
now, fuck off
>>
>>54926917
>When a function takes an array as an argument in C, it does not receive a copy of it. So if you modify the input array, the caller's array will also be modified.

Lets make it clear for anybody reading that. the name of an array is a pointer to its first element.
So whenever we "pass an array" to a function, we are just passing a pointer of the type of that array. int* for int[100], char* for char[100] etc.
>>
>>54926846
het a ptr to a buffer + size of said buffer in as an argument, or malloc strlen(input)+1 bytes and write there
>>
>>54925199
This has nothing to do with OOP. What you're describing isn't even a principal feature of OOP, even the shit version that C++/Java adhere to.
>>
>>54926985
I avoided writing it that way because usually some retard comes in and starts copy pasting the standard about how it's totally not really a pointer when you do that.
>>
File: 1459678807748.png (126KB, 422x446px) Image search: [Google]
1459678807748.png
126KB, 422x446px
int row[10];
for (int j = 0; j < 10; j++)
{
row[j] = atoi(fgetc(map_file));
}
while (fgetc(map_file) != '\n');
map[i] = row;


"Error: Assignment to expression with array type"

how do i fix dis

(This is C)
>>
>>54926878
When I get rid of my "forward declaration", I go back to my original error, which an error at Line 171 stating Node does not name a type.
>>
File: hatdog.jpg (260KB, 900x948px) Image search: [Google]
hatdog.jpg
260KB, 900x948px
>>54926963
Exactly. Having no requirement at all, the standard allows weak typing.
>>
>>54927024
memcpy or map[i] = &row;
>>
>>54926903
Not sure on how to work with pointers, can you show a quick abstract example?

>>54926917
>>54926985
I just tried this, but can't reproduce it.
I modify the string in the function, but the original string is unchanged, and now I have two strings, the one in the function, and the one outside of the function.
>>
>>54927051
i mean memcpy since stack buffers will obviously disappear
>>
>>54927028
Yes rite
Now why does Node not name a type?
>>
>>54927036
>Consider that this is completely valid
you're provably brain dead
>>
>>54927017
fuck the standard definition. This 100% acts like that pointer and is treated like that.

Even Bjarne (writing about c++ thou) states in his book to remember that array name is a pointer to its first element.
>>
struct array {
size_t sz;
int type;
union {
char *cdata;
int *idata;
long *ldata;
float *fdata;
double *ddata;
}
};


is this valid?
>>
>>54923215
>he thinks C has union types
Trash it!

>>54926866
>he thinks C has arrays
Into the trash it goes!
>>
>>54927090
>array name is a pointer to its first element
that's false
>>
>>54927083
Is it because it's struct?
>>
>>54927036
>standard allows weak typing.
but it's always been considered weakly typed. Pretty sure the into to K&R states it as well.
>>
>>54927102
no
>>
>>54927066
Here is my current code, in German. I expected the resulting output to be testtest, no matter what the scanf input is, because it once turns buffer to "test", and then prints the variable used in the function a second time, which should then also be test. The actual output is test and then the unmodified scanf result though.

#include <stdio.h>
#include <stdlib.h>

int i = 0;
char zeichen[100]={};

void caps(char buffer[100])
{
buffer = "test";
printf("%s", buffer);
return 0;
}

int main(int argc, char *argv[]) {
printf("Zeichenkette eingeben: ");
scanf("%s", &zeichen);
caps(zeichen);
printf("%s", zeichen);
return 0;
}
>>
>>54927108
>he thinks C has arrays
Before you give me shit about pointer decay, loops don't actually exist, they're just goto statements
>>
>>54927123
No, in C++ there's no need to typedef or whateva
Besides you've used many class and structs without any problem up till now
Try again
>>
>>54927143
>goto statements
>not conditional jumps
>>
Seeing a lot of
if(...){
...
return;
}
else{
...
}


on enterprise code, but the else is not needed yet they always add it.
Any reason for it? Obviously I'll stick to their standard but I'm just wondering.
>>
>>54927102
yes
>>
File: 1433698243654.png (29KB, 613x556px) Image search: [Google]
1433698243654.png
29KB, 613x556px
>start programming personal project
>slowly lose drive to continue
>never finish project

how do i stop this
>>
>>54927137
you merely modify the function local pointer argument
>>
>>54927137
>because it once turns buffer to "test"
do you expect this
#include <stdio.h>
void f(int x)
{
x = 10;
}
int main(void)
{
printf("1+2=%d", 1+2);
f(1+2);
printf("1+2=%d", 1+2);
}

to change the value of the expression 1+2?
>>
>>54927216
>I don't even know C syntax
>>
>>54927223
i am also interested in this
i have at least 10 things that are half made right now
>>
>>54927223
>>54927241

put your shit on github, then think about how your unfinished shit is public and people will laugh at how shit your life is
>>
>>54927226
>anon being a clever pedagogos
cheers mate
>>
>>54927247
>0 followers
>>
>>54927257
I'll look at it
>>
>>54927247
but i already do that :^)
>>
>>54927264
Post your github here so I can laugh at you
>>
File: 1463269955431.jpg (64KB, 500x500px) Image search: [Google]
1463269955431.jpg
64KB, 500x500px
>>54926673
>Being able to break the type system

MFW breaking a type system
>>
>>54927146
I changed it to this:
template<class ItemType>
* LinkedList<ItemType>::getNodeAt(int position) const


Which compiled, and sort of makes me uneasy. Do I really not have to specify what kind of pointer it is? Is having "*" as the return type good enough because all pointers are stored as ints?
Also, thanks for being patient with me.
>>
>>54927273
they are not my friends
>>
File: kid.jpg (38KB, 362x346px) Image search: [Google]
kid.jpg
38KB, 362x346px
Can you use git without uploading it to a remote repository?
>>
>>54927305
yes
>>
>>54927086
According to the standard, a conforming program is one that is acceptable to a conforming implementation.
>>
File: Screenshot_2016-06-05_19-45-31.png (24KB, 579x408px) Image search: [Google]
Screenshot_2016-06-05_19-45-31.png
24KB, 579x408px
>>54927066
#include <stdio.h>

void manipulate(char* c)
{
while(*c != '\0')
*c++ -= 32;
}
int main(void)
{
char my_string[4] = "test";
printf("%s \n",my_string);
manipulate(my_string);
printf("%s \n",my_string);

return 0;
}


Produces pic related. I'm not sure why it's printing array termination symbol thou...
>>
>>54927226
no, 1+2 is an expression.
I realise that I can get the adress of the input variable while in the function.
I assume the next step is to modify the content at this adress. I'm not sure how to do that though.
>>
>>54927360
Should be
my_string[5]
, else you won't have room for the null character
>>
>>54927223
Quit coming up with shit project ideas.
>>
>>54927397
This be the new one
>>
>>54927386
probably the most common beginner mistake with strings in C
>>
>>54927305
That's what git is. the hub part to github is the uploading to a remote repo feature.
>>
>>54927360
>>54927386
You can also leave the number out when declaring a string literal
>>
>>54927334
>I still don't understand what undefined behavior means even after being spoonfed all the way
brain dead confirmed
>>
>>54927305
Sure, just don't push.
>>
File: ss (2016-06-05 at 07.49.01).png (23KB, 1055x280px) Image search: [Google]
ss (2016-06-05 at 07.49.01).png
23KB, 1055x280px
>>54927360
Thanks, I managed to change one char now, I'm sure I can do the rest now. I know you provided the full solution, but I wanna get to the rest on my own.
Only char* and *variable are still kinda confusing.
If I got it right,
char* c means that c contains the first adress of the string.
*c = something means that the value at the adress in c will be asigned a new value.

I tried to do similar with the & operator, but didn't manage it.
>>
>>54927386
>>54927414
Yup you are right guys.
In my defence I haven't used C since 1st year of studies.
>>
>>54927461
Welcher Kurs?
>>
>>54927491
INGIC, 1. Semester, Fachhochschule, Mechatronik
>>
>>54927273
shen my project will be finished itll chamge the wodl forever . you will see that im axtually rather intelligant and take that statement back
>>
File: dao.gif (7KB, 300x300px) Image search: [Google]
dao.gif
7KB, 300x300px
>>54927285
How does this even compile?
You don't have to compromise with the language to the point of changing the return type.

Yo WANT the return type to be a Node and you CAN make it so: the type signature declaration in the header was accepted, it's at LinkedList.h:46 and it's fine.

Let's do something:
try putting the body of the function directly in the class
Node* getNodeAt(int position) const {
Node* retPtr = headPtr;
int index = 0;
while(index != position)
{
retPtr = retPtr->next;
index++;
}
return retPtr;
}

Normally it should compile, so you see, the function body by itself isn't flawed, and the function signature can be understood within the context of the class.

Shit gets dank when you are putting the definition outside of the class. (which is perfectly allowed btw, I'm not saying you should not) Again, line 171 is the culprit.

There is one more adaptation than usual you need to do when moving the signature from within the class body, because you're refering to a type that is defined inside that body. usual = when working on most member functions that don't refer to a member type in their return type and/or parameters.

Clue #2:
LinkedList.cpp|171|error: prototype for 'Node* LinkedList<ItemType>::getNodeAt(int) const' does not match any in class 'LinkedList<ItemType>'|
LinkedList.h|46|error: candidate is: LinkedList<ItemType>::Node* LinkedList<ItemType>::getNodeAt(int) const|

pretty much telling you what to put, if you read it correctly.


>Also, thanks for being patient with me.
No problem, I'm lurking anyway. You'll see this flash of light you'll get when it's over...
>>
>>54927498
Ah
                                                                                                                Wirklich bin ich Amerikaner, und ich kenne nicht was ist das
>>
>>54927360
Can also be done with bitwise operators
c = c &~(1<<5)
>>
>>54927543
Oh, first semester of college, studying mechatronics, doing the C programming course.
>>
>>54927461
>char* c means that c contains the first adress of the string
not exactly.

If you have a char array of lets say 3 elements. they are stored in the consecutive memory bytes.

char *c is just a pointer to char, any place in the memory of 8 bit long variable.

You pass an array "test" to the function, but in fact what is passed is the place of the memory where 't' is stored.
by doing c++, you move one byte further, where 'e' is stored and so on.
if u check whats under c pointer its the memory adress, lets say 1230008.
If you want to see what's stored under that adress u derefence a pointer by *c what gives you, in described case, a char 't' or 'e' or 's' depending where u traversed with ur pointer.

pass your string to a function and printf in loop the pointer adress, and the pointer derefence.
Increase pointer by 1 after each iteration and you will have a clue.
>>
File: 3kL3N1x.png (603KB, 630x630px) Image search: [Google]
3kL3N1x.png
603KB, 630x630px
>>54927445
You are the one who don't understand.

int a = 1;
float *f = (float*)&a;
float fb = *f;


This program has undefined behavior for which the standard imposes no requirements to a conforming implementation. Standard also says that a conforming program is one that is acceptable to a conforming implementation: This program is a conforming program.

>me on right
>>
>>54927575
>This program has undefined behavior
>This program is a conforming program
completely brain dead
>>
File: ss (2016-06-05 at 08.04.46).png (38KB, 1310x421px) Image search: [Google]
ss (2016-06-05 at 08.04.46).png
38KB, 1310x421px
>>54927573
I think that's what I meant: After the function is called, then c is a pointer that contains the memory adress of the first element of the array. The next char is one adress higher, and so on. And *c = assigns the value at the adress the pointer points to a new value.

I managed to solve the task now, pic related. It's pretty much the same as the code you provided, but I understood it now and can do the other tasks now, which also require me to manipulate strings within a function.
>>
>>54927659
do you feel in charge?
>>
>>54927659
yup exactly Hans.
>>
>>54927671
What do you mean?
English isn't my native language, so I'm sorry if that came across wrong. What I meant is that I understand it now, thanks.
>>
>>54927688
I believe he meant manipulating raw memory is somewhat powerfull. Enjoy it. If he did'nt mean that, don't mind.
>>
>>54926899
Anyone?
>>
>>54927688
you merely adopted the charge
but i was born in it
molded by it
>>
im gonna start counting how often we discussed semantics regarding undefined behaviour
this is incredible, i think we've had this argument atleast 50 times over the course of a couple of weeks
>>
>>54927732
so you mean like vector<vector<int>> ?
>>
>>54927727
Oh yes, that's true.
Manipulating the memory of someone else's program with Cheat Engine is pretty fun as well. I wish I could find base pointers with it, then I could write programs that read or modify the memory of other programs without using cheat engine. I can't find base pointers though.
>>
>>54927763
Yeah, that's what I have.
>>
>>54927800
oops, mentioned base pointer twice, just kill me now
>>
>>54927805
So from a reference of vector.clear():

>"Removes all elements from the vector (which are destroyed), leaving the container with a size of 0."
I believe if you invoke a destructor of vector, elements inside are also destroyed.
But you are not playing with pointers so why do you even bother about that in this case?
>>
>>54927850
Just wanna make sure everything gets deleted.
The vector has a massive scope.
>>
>>54927894
vector<vector<int> > vec;
vector<int> v1;
vector<int> v2;
v1.push_back(4);
v2.push_back(2);
vec.push_back(v1);
vec.push_back(v2);

cout<<vec[1][0]<<endl;
int* p = &vec[1][0];
cout<<*p<<endl;
vec.clear();
cout<<*p<<endl;


Second p dereference (after vec is being cleared) return rubbish.
You're safe.
>>
>>54926800

>apparently you don't know shit about how ssize_t is defined by posix
It is literally signed size_t.

>certainly? at least in vc2010 it was unsigned; the msdn doesn't even acknowledge it, it only documents SSIZE_T
It's signed in mingw, and that's the only compiler that matters on Windows. MSVC doesn't even support C11.
>>
>>54928055
>It is literally signed size_t.
you're literally retarded
>It's signed in mingw
>backpedaling like a worthless shit
:^)
>>
>>54927223
motivation is your own responsibility
>>
>>54928172
>you're literally retarded

It is similar to size_t, but must be a signed type.
>>
>>54927223
I have the same. usually its because the projects are too bloated.
You will not just write a game.
Try to compose it from smaller sub projects.
Working main menu? animated sprites? yay everything can be done in hours and you can mark them off as succesfull, and completed small projects.
>>
>>54928238
it's as similar to size_t as it is to short: it's an integer and that's where the similarities end
its requirements have no relation with size_t so shut the fuck up if you don't know what you're talking about; its representation can have a different bit width than size_t
>>
>>54928172
>>54928470
why do you think it's called ssize_t
Thread posts: 385
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.