[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: 322
Thread images: 22

File: 1490234366514.jpg (23KB, 640x480px) Image search: [Google]
1490234366514.jpg
23KB, 640x480px
What are you working on, /g/?

Old thread: >>59642274
>>
Anyone have that image that was like a program idea roulette with a shit ton of ideas listed?
>>
>>59645975
better-dpt-roll.github.com
>>
File: gccwtf2.png (4KB, 358x166px) Image search: [Google]
gccwtf2.png
4KB, 358x166px
thank you gcc. beautiful code as always.
>>
Reimplementing Python in JS
>>
>>59645949
an AI that shitpost in daily basis and is capable of baitposting and sauceposting.
>>
The more I develop, the more I realize that CS is an endless pit of knowledge
>>
https://medium.com/@bryanedds/functional-game-programming-can-work-95ed0df14f77
>>
How many of you guys have Caps Lock rebound to Ctrl? Why do keyboards still have Caps Lock?
>>
>>59646018
Should make a ML baneposter
>>
>>59646031
If you work with SQl or VB.NET and BASIC you would know
>>
>>59646029
>Add to that the fact that many engineers foresee GC becoming part of the computer’s hardware—at least, once we settle on a universal set of GC primitives.
Really?
>>
>>59646044
>SQl or VB.NET and BASIC
what is this
>>
https://strawpoll.com/9xw1bd8
>>
>>59646063
calloc when you need it, malloc otherwise.
>>
>>59646029
>Currently, the Nu Game Engine can process up to 25,000 on-screen entities at 60 FPS before saturating the CPU

Does he mean 25k quads or what?
>>
File: 0 fucks given.jpg (263KB, 1200x756px) Image search: [Google]
0 fucks given.jpg
263KB, 1200x756px
What are some GOOD programming podcasts/audiobooks???

SE radio is fine, but 90% of the new episodes are about nontechnical shit like hiring, agile memes and culture.

What are some good audio resources about technical topics?
>>
>>59646055
They've been trying to do that for ages.
https://en.wikipedia.org/wiki/Intel_iAPX_432
that was designed back in 1975.
>>
So I upgraded from my Debian system's gcc 4.9 to gcc 6.3. Then since I figured I ddin't need the system's gcc anymore I removed it with apt. But now I pretty much can't build any C++ program anymore. For example when i do
#include <iostream>

int main()
{
std::cout << "hello world\n";
return 0;
}

I get
main.cpp:1:20: fatal error: iostream: No such file or directory
#include <iostream>
^
compilation terminated.

Same with clang. According to apt, libstdc++6 is still installed. What do?
>>
>>59646018
How do you get past the captcha?
>>
GTK and Python 2 vs 3 is an absolute nightmare
>>
>>59646152
GTK made me hate C with fiery passion
>>
>>59645949
Unfortunately writing php, not out of choice but because I need to eat.
>>
>>59646134
Debian has the headers and shit split off in their own packages, for some reason.
Is libstdc++-dev installed?

>>59646148
Not him, but a 4chan pass can be used for botposting and posting from non-js browsers like w3m.
>>
a file monitoring program in C that monitors files and directories recursively, detecting additions, changes, and deletions.

I want to tear my hair out.
>>
>>59646134
try <stdio.h>
always works.
>>
>>59646171
So, git?
>>
>>59646171
so git?
>>
I want to write a simple notification server on Linux. I honestly don't care what language it is, it just needs to receive notifications and maybe forward them to another program if I have to, I just want to know what would be the least painful way to make this happen?
>>
>>59646134
wipe it all then do a clean apt-get
Its amazing that package managers still cant resolve dependency complications.
>>
>>59646171
why not inotify?
>>
>>59645994
what editor is this
>>
>>59646171
So, git?
>>
>>59646189
go.
>>
>>59646171
So, git?
>>
>>59646189
libnotify
>>
>>59646180
>>59646181
>>59646201
>>59646207
>>59646219
it's supposed to use stat() and getdents(), and it is not a file uploader dammit
>>
I'm learning dr. racket in college, but I want to make games in a functional language, what should I learn now that is similar to dr. racket?
>>
>>59646238
Common Lisp
>>
>>59646205
notepad++
>>
>>59646134
>>59646166
Managed to solve it thanks to the first reply. I tried to find whether the packages were installed somewhere or not and dpkg -i them. However it turns out clang builds against g++'s libraries on Linux. So when I saw the following line in clang++ -v
Selected GCC installation: /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/6.3.0

I just had to look into the folder and notice that it was basically empty.
It turns out when you build gcc, it only builds and installs the bare minimum. So the solution was to copy and build the content of libstdc++-v3 in gcc's folder.

>>59646199
I thought about doing that, but a shitton of packages depend on the libstdc++6 so I kind of kept it as a last resort.
>>
>>59646130
Actually sounds like a nifty idea.
>>
>>59646097
>Nu Game Engine
Had to check that it wasn't a /v/ meme
>>
Rate my ray tracer
#include <stdlib.h>   // card > aek.ppm
#include <stdio.h>
#include <math.h>
typedef int i;typedef float f;struct v{f x,y,z;v operator+(v r){return v(x+r.x,y+r.y,z+r.z);}v operator*(f r){return v(x*r,y*r,z*r);}f operator%(v r){return x*r.x+y*r.y+z*r.z;}v(){}v operator^(v r){return v(y*r.z-z*r.y,z*r.x-x*r.z,x*r.y-y*r.x);}v(f a,f b,f c){x=a;y=b;z=c;}v operator!(){return*this*(1/sqrt(*this%*this));}};i G[]={247570,280596,280600,249748,18578,18577,231184,16,16};f R(){return(f)rand()/RAND_MAX;}i T(v o,v d,f&t,v&n){t=1e9;i m=0;f p=-o.z/d.z;if(.01<p)t=p,n=v(0,0,1),m=1;for(i k=19;k--;)for(i j=9;j--;)if(G[j]&1<<k){v p=o+v(-k,0,-j-4);f b=p%d,c=p%p-1,q=b*b-c;if(q>0){f s=-b-sqrt(q);if(s<t&&s>.01)t=s,n=!(p+d*t),m=2;}}return m;}v S(v o,v d){f t;v n;i m=T(o,d,t,n);if(!m)return v(.7,.6,1)*pow(1-d.z,4);v h=o+d*t,l=!(v(9+R(),9+R(),16)+h*-1),r=d+n*(n%d*-2);f b=l%n;if(b<0||T(h,l,t,n))b=0;f p=pow(l%r*(b>0),99);if(m&1){h=h*.2;return((i)(ceil(h.x)+ceil(h.y))&1?v(3,1,1):v(3,3,3))*(b*.2+.1);}return v(p,p,p)+S(h,r)*.5;}i main(){printf("P6 512 512 255 ");v g=!v(-6,-16,0),a=!(v(0,0,1)^g)*.002,b=!(g^a)*.002,c=(a+b)*-256+g;for(i y=512;y--;)for(i x=512;x--;){v p(13,13,13);for(i r=64;r--;){v t=a*(R()-.5)*99+b*(R()-.5)*99;p=S(v(17,16,8)+t,!(t*-1+(a*(R()+x)+b*(y+R())+c)*16))*3.5+p;}printf("%c%c%c",(i)p.x,(i)p.y,(i)p.z);}}
>>
>>59646322
awful
>>
>>59646322
>operator+
And you fucked it.
>>
>>59646230
Not a language

>>59646218
Does Go have reasonable DBus bindings?
>>
>>59646343
>59646343
>>59646343
>59646343
>>
>>59646171
Let me guess. git?
>>
>>59646370
>Not a language
even fucking batch is a language at this point
>>
>>59646371
What the fuck are you trying to do?
>>
>>59646403
Find how many times matrix n appears in matrix hs.
>>
>>59646385
Windows batch scripting has always been a language. libnotify isn't a language, and I don't think it even helps you set up a notification server
>>
>>59646383
I have never used git
>>
fuck I'm all over the place. I can't decide whether I want to invest most of my time and energy into mastering C (I'm already decently proficient), Rust, or another newer language such as D or Go.
I'm sick of C# and Java.
>>
>>59646029
>>59646031
This feels written by someone who only has a vague idea of how computers actual work. In todays modern CMPs with multi-level cache systems, it's hard enough to just keep them coherent. Just implementing a GC system on top of that would be an incredibly complex undertaking (requiring probably decades of research, and even more time to put into production), and would probably not even net you an advantage. Accessing cache (i.e. miss) or god forbid memory is already on the critical path for virtually any program.

That doesn't even take into account the maturity of compilers, programming languages ect, that would need to be re-assessed, and the fact that all consumer level HW manufacs would need to sign on to some standard, and the fact their would be no backwards compatibility (i.e. forced into original situation, if run-able at all) if it did happen, ect ect
>>
File: out.jpg (60KB, 512x512px) Image search: [Google]
out.jpg
60KB, 512x512px
>>59646322
How long did it take you?
>>
>>59646482
pick the best option.
pick c++17
>>
>>59646482
pick up a functional one.
imperative programming really was a mistake.
>>
>>59646482
Do this honestly >>59646499
>>
File: program_challenge.png (549KB, 1920x1080px) Image search: [Google]
program_challenge.png
549KB, 1920x1080px
>>59645975

> delivery
>>
>>59646499
C++17 is not some panacea, the only people who feel good about C++17 are the people that don't use C++
>>
>>59646371
For your input of [[1,1], [1,1]] to the larger matrix of 1's and a single 2, it should be 3. What's the problem?
>>
>>59646029
But for what purpose?
>>
>>59646482
At least you're not like me: still doing fizzbuzz-tier programming in Python after 7 months
>>
>>59646526
I'm doing the Danmaku engine right now. Does anybody have an idea how many bullets should be supported simultaneously? I'm already designed a structure-of-array style architecture to make it fast but I'm not sure what the benchmark should be.
>>
>>59646473
are you saying that Windows scripting is superior linuxshit
>>
>>59646526
Some of these are impossible to write from scratch.
>>
>>59646577
It's not meant to be taken seriously
>>
>>59646473

google golang
>>
>>59646544
It shows "4" instead of "3". Like, one more submatrix, which is wrong.
>>
>>59646577
The bootloader one deserves its "fuck you" tier.
t. someone who tried doing hobby osdev
>>
>>59646560
soa is literally a meme. What matters is access pattern vs cache contiguity.
>>
>>59646566
I never said that it was any good, just that it is a language
>>
>>59646577
Nothing says you have to do them all from scratch
>>
>>59646539
What is good and bad about C++17?
>>
>>59646495
>>59646322
How the fuck can that tiny cluster fuck of code output something that nice? I can't even do that in opengl ffs.
>>
>>59646621
Nothing substantial really happened, they just added some extra features from Boost and called it a day.
>>
>>59646621
>What is good
stealing good things from better langs
>and bad
as always those features are bolted, not natural
>>
>>59645949
Usually nothing but this week been tripping all over C trying to make a program to serial communicate keystrokes to an arduino mega. Part 1 of ridiculous LED keyboard project which I could probably do so much easier in a number of different ways.
>>
is there an accelerated track for learning C++ for those that area already seasoned programmers in other major languages? I don't need an entire fucking chapter dedicated to variables and looping constructs.
>>
>>59646616
Do you have a better idea how to move many objects (I'm thinking 10k? Maybe it's a bit too high) and display them with a more traditional approach? The thing is I also have to account for collision checks, thus I figured not having to change the player's coordinate for each test was better.
>>
>>59646624
Ray tracing is at its core extremely simple. The trouble is in making it efficient.
>>
File: dpt.jpg (164KB, 800x1000px) Image search: [Google]
dpt.jpg
164KB, 800x1000px
>>
>>59646678
yea ya do
>>
>>59646691
the render equation is an integral
>>
>>59646685
Ever heard of that magical thing called a quadtree, nerd?
>>
>>59646691
Can't it be done in parallel tho?
>>
>>59646685
All he's saying is that you need to optimize for what your actual access patterns are and not just make things structure of arrays willy nilly. You're probably correct to do so in this case, that being said.

Optimizing collisions is mostly about doing a gauntlet of increasingly precise tests. How you structure the data is likely not significant.
>>
>>59646708
So?

>>59646725
That would make the code a lot more lengthy, but yes, of course.
>>
k-d tree
>>
>>59646745
You can use numerical methods for solving integrals: Monte Carlo, trapezoids and so on.
>>
>>59646596
You are incrementing count whenever the two overlapping matrix positions are equal, correct? So, if this was working correctly, it would do 16 comparisons, and only 15 should come out to be correct. But you only ever do 4 comparisons (obviously), and they all come out to be 'true'. With that, you should be able to tell what the problem is.
>>
File: 1489100693875.jpg (103KB, 500x500px) Image search: [Google]
1489100693875.jpg
103KB, 500x500px
Rate my matmat function!
#define max(a, b) (((a) > (b)) ? (a) : (b))

typedef struct {
int **mat;
size_t size;
} mat2;

int matmat(mat2 *hs, mat2 *n)
{
if (n->size > hs->size)
return 0;
size_t i, j, k, l;
for (k = 0; k < hs->size; k++)
{
for (l = 0; l < hs->size; l++)
{
size_t matches = 0;
for (i = 0; i < n->size; i++)
for (j = 0; j < n->size; j++)
if (max(k+i, l+j) < hs->size) /* bounds */
if (hs->mat[k+i][l+j] == n->mat[i][j])
matches++;
if (matches == (n->size * 2))
return 1;
}
}
return 0;
}
>>
>>59646788
So?
>>
Last night I spent an hour trying to get a bluetooth ODBII dongle to connect to this scantool program that I found. I got the dongle to pair, but I couldn't get it to connect to scantool, because scantool is some old DOS tool that was modified to see USB tty devices, /dev/ttySX iirc, as COM1-8. The hackiness of the solution appealed to me.

I was apparently able to bind the dongle to a new device, /dev/rfcomm01 using some tool whose name I am forgetting right now, but I couldn't find the place in some scantool source where the COM ports were mapped to these USB devices.

mapping the dongle to the USB devices didn't produce an error when I ran the command, but also didn't work when I ran scantool.

I also wasn't able to get it to connect with bluetoothctl, but apparently Bluez5 needs some work... I'lll play with it further when I have more time.

Do any anons have any resources?
>>
>>59646807
It's the core of the efficient algorithms for calculating ray tracing.
>>
>>59646678
just start writing and google the things you don't know. that's how I did it.
to help you get started, make sure you know the difference between stack/heap allocation, know what RAII is all about, and have some basic understanding of value categories.
>>
>>59646710
>>59646746
not that guy, but how would you deal with the bullet movement? i guess maybe implement a priority queue to update the tree
>>
>>59646852
So?
>>
>>59646860
>>59646691
>>
>>59646879
Okay? That still adds to the complexity of the code. My point was that you can program a very simple ray tracer in a very small amount of code and still get a nice image, it's just not going to be fast.
>>
>>59646940
In case of opengl I guess it is already implemented and open sourced as vertex shaders.
>>
std::unique_ptr<Employee> anEmployee(new Employee);

could they make it more verbose?
>>
>>59646992
auto anEmployee = std::make_unique<Employee>();
>>
File: untitled.png (4MB, 8000x8000px) Image search: [Google]
untitled.png
4MB, 8000x8000px
So is ray tracing what movies use for cg?
>>
>>59646992
you're supposed to do
auto an_employee = std::make_shared<employee>();
>>
>>59647008
And global illumination. Pixar Renderman and Solid Angel Arnold are the most popular renderers in Hollywood movies.
>>
>>59647005
>>59647014
i am going through a book
god help me
>>
File: 1488262389459.png (116KB, 771x820px) Image search: [Google]
1488262389459.png
116KB, 771x820px
Is there any reason to use UDP nowadays? Connections are so fast that TCP just fucking werks.
>>
>>59647046
Ray tracing implies global illumination.
>>
>>59647050
which one?
>>
>>59647050
Its better to present the most explicit syntax, when teaching, anyway.
>>
File: 1118858050.jpg (57KB, 300x376px) Image search: [Google]
1118858050.jpg
57KB, 300x376px
>>59647080
>>
>>59647064
The recent renderers are raytracers nowadays. They used different algorithms earlier for GI and raytracing.
>>
>>59647052
>Connections are so fast that TCP just fucking werks.

Making that assumption is why you suck at programming things on the Internet.
>>
>>59647052
>Connections are so fast that TCP just fucking werks.
That's just not true.
>>
>>59647109
somebody said that this is shit
>>
>>59647131
or at least a symptom of your general way of thinking that is why you suck at programming things on the internet.
>>
>>59647052
Because even though shit is super fast, packet loss is still a thing. packets sent with TCP are tracked so no data is lost or corrupted in transit. If it is interrupted it must re-establish the connection.
If you arent downloading something. or ensuring that data is sent in tact use UDP. Basically Video, VOIP, Streaming media kinda shit is best to use UDP.
>>
>>59647008

It's what they used to make finding nemo
>>
>>59645949
Parsing 4chan and analyzing the results to see which board is the most reddit
>>
>>59647218
What are the "reddit parameters"?
Id guess /v/ or /cgl/.
>>
>>59647232
Eh I started parsing 4chan on Tuesday. Collecting at least 1 week of data. It scrapes the site every hour for each board.

Currently working on my reddit parameters. Currently what I have is just a couple of more commonly used words. Thinking about changing that to phrases.
>>
>>59647138
its nice so far, compared to Starsoup books and bad OCR of C++ primer i have.
>>
>>59646055

Some of the more advanced lisp machines had hardware gc and type checking.

It's been done.
>>
>>59647250
>Thinking about changing that to phrases.
Well its much more accurate, as well as taking into account, punctuation & sentence structure.

Itd also be interesting to see if theres a post length/ reply time correlation.
>>
>>59647259
>OCR of C++ primer
huh, i found a pretty good one. here
http://www.charleshouserjr.com/Cplus2.pdf
>>
File: SumatraPDF_2017-03-30_04-05-38.png (44KB, 1793x156px) Image search: [Google]
SumatraPDF_2017-03-30_04-05-38.png
44KB, 1793x156px
>the messiness of pointer
syntax
>messiness
what did he mean by this
>>
I have n random points uniformly distributed over -1 and 1. I also have the unit circle. What would be the most efficient way to loop through these numbers (stored in an array x and an array y) to determine if they fall within the circle?

I'm using MatLab so there could be some sort of function I'm unaware of. Either way, my geometry is quite rusty and I can't think of a way to do this.

pseudocode
for i = 1 : n
if x(i) && y(i) fall within circle
counter++
end
end
>>
>>59647287
Yeah. I am scraping the data in Python. Currently looking for languages with good libraries to do such analyze. I was thinking R.
>>
>>59647362
Oh, would calculating the distance between the points and 0,0 and determining if it's > 1 work?
>>
>>59647357
******************ptr
>>
>>59647362
MUH KDTREE
>>
>>59647384
Yes. By pythagorian distance you have
d = sqrt(dx^2 + dy^2) < 1

But you can remove the square root by squaring both sides of the equation, so on the other side it's still 1. This is some highschool shit
>>
I've decided to use Racket for my DBus notification server since it looks like somebody has implemented this for me, and also I don't have to fuck with python GLib bullshit, and I don't have to write in C
>>
>>59647404
Yeah fucking oath it is, I've just gone back to study and not had a refresher on a lot of this stuff. Cheers buddy.
>>
>>59647383
Some guys did a talk on parsing reddit to build a ml bot to tell Rust (the game) streamers to fuck off the rustlang one.
https://www.youtube.com/watch?v=lY10kTcM8ek

Wight be helpful to also get data from there and compare,depending on how serious you are.
>>
File: SumatraPDF_2017-03-30_04-12-09.png (217KB, 1121x1344px) Image search: [Google]
SumatraPDF_2017-03-30_04-12-09.png
217KB, 1121x1344px
>>59647295
>>click to view code image
>>click it, jumps to some triple-compressed .jpg at the end of the book
>>now where was I..
yeah i have the same one, it's unreadable to me. maybe i'm spoiled.
this >>59647109 one is comfy though, with nice formatting and shit. and since i'm probably gonna google stackoverflow later anyway..
>>
>>59647427
You must be 18 or older to browse this site, child.
>>
>>59647436
>divide by zero = infinity
yeah I wouldn't trust anything in that book
>>
>>59647387
the example you posted is not messy though
more like this, but you seldom encounter stuff like this in real life
int *(*(*(*abc)())[6])();
>>
>>59647430
This literally doesn't even classify as a toy. There are many actual legitimate uses of reddit corpora (not so much 4chan but the principles are the same depending on what is being trained). Ignore that completely. Literally lrn2google.
>>
>>59647430
My project is more towards analysis of a data set rather than coming up with ML bot in real time.
>>
>>59647492
Not interested in ML at the moment, I just backgound talks sometimes when im burnt out on music. just thought id post it
>>59647503
>more towards analysis of a data set rather than coming up with ML bo
ah, alright
>>
C++

It's really nice to be able to compare to null to verify validity. There is no way to do a null comparison for non-pointer types.

Why are pointers to awesome? Should I use them all of the time when creating custom data structures?
>>
>>59647523
I recently saw that picture about which board is the most tumblr posted and thought why not I do one for reddit and then post a proper report so people can cite it when they say X board is reddit. I already have a few hunches on which board is the most reddit but it is always fun to do some stuff like this.
>>
>>59647467
>school is the only study you can do

I wish I could live a life of a NEET.
>>
>>59647551
references is pointers without all the reference derefence bloat
>>
>>59647383
pandas in Python is great
>>
>>59647584
You must be 18 or older to browse this site. I'm sure you'll just love reddit.
>>
>>59647479
>cdecl> explain int *(*(*(*abc)())[6])();
>declare abc as pointer to function returning pointer to array 6 of pointer to function returning pointer to int

literally what purpose does this serve
>>
>>59647595
Pretty shitty actually, but that's all python really has. Also completely irrelevant.
>>
>>59647052

If you don't need guaranteed in-order delivery, there is literally no reason to use TCP.
>>
>>59645949
public void addProductToStock(Product product){
if(product instanceof Book){

}
else if(product instanceof Magazine){

}
}


Trying to figure out a better way to do this. apparently instanceof is bad practice.

Book and Magazine inherit from Product in this case. I want to add them to a HashMap in a way that I can count the amount of something and not have duplicates.

How should I do this instead?
>>
>>59647746
Doesn't your language have virtual methods?
>>
>>59645994
L.L.V.M.N.I.G.G.E.R.
>>
>>59647746
I weep for all the bad Java courses in the world.
>>
>>59646029
checks out. for non-AAA you'd still need some part of the code be mutable, and for AAA... it can but only based on conjecture that needs to be tried (he says The Sims could but I find it doubtful). so the situation is not as optimistic as the article title implies.
>>
>>59647746
POO
IN
LOO
PAJEET
>>
>>59647551
>There is no way to do a null comparison for non-pointer types.
If you knew any C++ you'd know how stupid this sentence sounds.
>>
File: ballmer.jpg (146KB, 1024x683px) Image search: [Google]
ballmer.jpg
146KB, 1024x683px
>>59647472
i just read some google on this zero stuff, it all sounds like bullshit.

0 is a number? a number. is infinity a number? is undefined a number? then how come when you operate on numbers, you supposed to get some bullshit non-number? when horse fucks horse, it doesn't produce a cat. WHAT THE FUCK???
we should change math to work this way:
1+0 = 1
1-0 = 1
1*0 = 1
1/0 = 1
see? clear and elegant.
you are also free to publish this short paper of mine. those math geniuses got out of hand, someone needs to show them the way.
>>
>>59647805
Completely wrong. Congrats.
>>
What's the diference between Dr. Racket and Racket?
>>
File: 1363134412939.jpg (82KB, 1022x768px) Image search: [Google]
1363134412939.jpg
82KB, 1022x768px
>>59647746

>>59647746


Oh, so you're going to have to add a new if condition every time you get a new product?
>>
>>59647595
Not sure how Panda is going to help me. Sure it can help me sort out large databases but I am doing analysis of large amount of string data.
>>
>>59647825
one is a doctor and the other is not.
>>
>>59647819
>one zero is one
>>
File: doubtful_asian_girl.jpg (34KB, 240x240px) Image search: [Google]
doubtful_asian_girl.jpg
34KB, 240x240px
>>59647819

>change math
>>
>>59647686
>literally what purpose does this serve
its a cool side effect, like cocaine
>>
>>59647832
>>59647807
>>59647800
It's homework you niggers. I'm asking how to make it not shit. This will work but I never said I like it.
>>
File: 1489280954604.jpg (28KB, 318x394px) Image search: [Google]
1489280954604.jpg
28KB, 318x394px
Rate my circle console drawer, /dpt/!
program draw_circle;

function isInside (i, j, r : real) : boolean;
begin
isInside := (sqr(i-r)+sqr(j-r) < sqr(r));
end;

function isEdge (i, j, r : integer) : char;
var
temp : integer;
i_f, j_f, r_r : real;
begin
i_f := 0.0; j_f := 0.0; r_r := r + 0.5; temp := 0;
repeat
j_f := 0.0;
repeat
if (isInside(i+i_f, j+j_f, r_r)) then temp := temp + 1;
j_f := j_f + 0.5;
until (j_f > 1.0);
i_f := i_f + 0.5;
until (i_f > 1.0);
if ((temp > 4) and (temp <> 9)) then
isEdge := '#'
else isEdge := ' ';
end;

var
r, size, i, j : Integer;
BEGIN
r := StrToInt(ParamStr(1));
size := (r * 2);
for i := 0 to size do
begin
for j := 0 to size do
begin
write(isEdge(i, j, r));
end;
writeln;
end;
END.
>>
>>59647834
Well I guess I would ask what you mean by analysis then. You mean like machine learning, i.e. semantics/classification? Or grouping data in particular ways to look for correlations (like word counts vs post time, ect)?
>>
A lot of components in video games can be easily represented as functional reactive components (basically just time/input dependent state machines). Real mutability of course is required for the meatier parts of game play (e.g. physics), so you would need a non-functional core.
>>
>>59647868

Magazine and Book should share a parent class, and whatever object you use for storing the stock has a collection of the parent class, so you can add a book or magazine to the same collection.
>>
>write low-level hardware interface
>finally done
>realize I don't have the hardware set up to test any of it
>>
>>59647868
Book/magazine should override some add function and thus when you call product.add it will use the correct version via polymorphism.
>>
>>59647880
Ada/10 (it means it's shit)
>>
>>59647821
I might have simplified something... but which part? is that not what the article said?
>>
>>59647880
what language is this?
You don't even need that many variables.
just draw a circle starting from the origin at the center of a bitmap.
>>
I'm writing a desktop application for my dad to help keep track of jobs (customer name, address, billing status, payment status, etc) in C#.

What's the best way to go about storing all of this shit? I've been thinking about make a Job class that has a List<string> of all the info for that particular job, but I'm not sure what the best method for organizing all of the individual Job s. Should I make another class with a List<Job> to hold them all?

This is all in C# BTW. Also is MVVM worth it or is it just a giant fucking piece of shit like I'm beginning to suspect?
>>
>>59647891
>Real mutability of course is required for the meatier parts of game play (e.g. physics), so you would need a non-functional core.
False.
>>
>>59647848
but what about my `horse fucks horse` argument?
if 1 horse fucks 0 horse, it doesn't evaporate. it just fucked 0 horse, that's it. it remains same as it was before
>>
>>59647898

That's the idea and not at all what I'm asking.

>>59647903
>>
>>59647908
that's pascal you idiot
>>
>>59647889
>machine learning, i.e. semantics/classification?
>machine learning
>i.e.
>semantics
>/classification?
My sides
>>
>>59647889
It will be simple analysis no need for something complex like ML. Just looking through a post and seeing how many phrases come up which I consider "reddit" words. That is my basic. I could do something complex but for now my plan is just to compare phrases or more commonly used words.
>>
@59647924
>zero ones = 1
> one zero = 1
g2bed
>>
>>59647918
MVVM is worth it because:

- You can trade out the UI later on without any under the hood changes

- You can unit test your code

- You are forced to seperate business logic and the UI.

Databases are a good place for storing things.
>>
>>59647929
Actually it's delphi you mong
>>
>>59647746
enum of different types, then a getType() for each inheriting class.
>>
>>59647955
that's still pascal you dummy.
>>
is there any CS class where you can learn to read code made by other people?
>>
>>59647972
No, they don't teach you real world software engineering skills in college, because college is NOT and HAS NEVER BEEN job training.
>>
>>59647972
some classes let students comment each others code
>>
>>59647952
Thanks. Any good resources for learning MVVM? I've been getting frustrated with all the shitty articles and videos I've been watching.
>>
>>59647940
???
>>59647942
How are you saving the data? Like some CSV format, <board>, <time>, <post content>, ect?
>>
>>59647997
Not the case in my university in Australia. We had courses where the assignments were to checkout opensource code and make improvements for example.
>>
>>59648019
Get a brain, inbred.
>>
does anyone have any experience with ranges-v3?
is it good? should I use it?
>>
>>59647972
Pair programming
>>
What's a brainded language to learn?
i actually have a degree of retardation.
>>
>>59648017
Sorry man. I've got a C# guru at work who helped me understand it. Honestly best thing you can do is read some code as an example, that is what will teach you best. Not really sure where you can get your hands on some though. Basically.

View: Your UI, you will have OnClick and what not strewn through here which should simply call registered callbacks.

Model: Your data, so perhaps the database with jobs, addresses etc

ViewModel: Your core business logic code is implemented here, it's the code that reaches into the database to do things and also offers functions as callbacks for the view to call.
>>
>>59648027
Nice one friend
>>
>>59648057
python or ruby
>>
>>59648057
>>59648078
or lua
>>
>>59648066
Ooh, I forgot to mention. Write it with interfaces, that way you will be able to plug and play in the future and you can also go with some TDD using the interfaces.
>>
>>59648066
Thanks a ton, that's probably the best option. It looks like there is some stuff on codeproject that I can dig through. I really appreciate it!
>>
>>59647917
This program draws a circle in a console.
I was lazy enough to not look for methods how to print at a certain position, so I just went with old teletype output methods.
>>
>>59648019
I am using panda to save the data into CSV format. The script executes every 6 hours and goes through every board scraping all the post. So that is 4 times a day. 28 times in total for a week. It saves time, post content, Filemd5hex and subject if it has one and is the OP.

Next step will be eliminating duplicate post which will be needed for the slower boards. Shouldn't be too difficult.

Then the analysis. I am still building and deciding the analysis tools and method that I should use.
>>
>>59647880
>not bresenham
anon
>>
>>59648057
>>59648078
>>59648090
Visual Basic.NET
>>
>>59648132
alice
>>
>>59645994
Try and optimize it
(You can't)
>>
>>59647950
>changing the order of the factors does not change the product
what if this is bullshit?
zero multiplied by one is a process, not finite state result like `zero ones`.
here is my updated version:
1*0 = 1
0*1 = 0
1/0 = 1
0/1 = 0
>>
>>59648137
how about
mov eax, ds:1234
mov edx, ds:1238
mov ebx, eax
mov ecx, edx
add ebx, 1
adc ecx, 0
lock cmpxchg8b ds:1234
>>
are neural networks a meme?
cs buds tend to shit on them
>>
@59648183
Honestly, how intoxicated are you right now?
>>
>>59648183
>you have 1 apple
>divide them over 0 people
>everyone gets 1 apple
>>
>>59648127
Way to improve.
>>
>>59648117
I would probably go with some kind of clustering then. You could cluster word counts around your reddit word/phrases and extract things like highest board/average post time, ect. What lib do you use to parse? BSoup?
>>
>>59648194
You literally have no idea what you're talking about. Get the fuck out
>>
>>59647997
Nigger college is precisely job training. It's literally what you get taught 90% of the time.

University isn't job training.
>>
>>59648220
except 0 people get an apple since there were 0 people to get it. and apple remains 1 since it was divided by 0 people.
>>
>>59647810
>>59647810
Example? Int i = null is not legal syntax
>>
>>59648245
This is an american general Yuroshit
>>
>>59648242
You literally don't have a single clue what you're saying.
>>
>>59648261
you can't give 1 apple to 0 people
you can give undefined apples to 0 people.
>>
>>59648269
This is what RAII is all about. Non-pointer types are always valid. You don't need to compare them to nullptr.
>>
>>59648242
basc-py4chan. I was doing it in BSoup till someone mentioned it a while back and I looked it up.

What I was planning was to just do a simple count for each board first and then divide it accordingly to the volume of post. That way it gives me two things, the highest concentration of reddit (highest hits/post) and then the highest volume of reddit (simply highest amount of hits irregardless of volume).
>>
>>59648261
Well we don't care about how much apple is left, we care about how much we have distributed to everyone.
Technically, "we have distributed 2 apples to everyone" is true, since "everyone" is nobody
>>
>>59647357
As opposed to references, which are dereferenced automatically.
>>
>>59648220
>try to divide one apple among zero peoples
>a paradox happens and the world explodes
???
>>
>>59648299
i have 1 apple, it is clearly defined
undefined is not a number, so i can't have undefined apple, since i already have 1 apple, which is a number(1).
if i give it to 0 people, although the operation states intention to give, actually i retain an apple, since there aren't people to give it to. so i remain with 1 apple
>>
>>59647746
public void addBook(Book book) {}
public void addMagazine(Magazine magazine) {}
>>
>>59648346
then redefine your math as
1/0 = 0R1
>>
File: target.jpg (75KB, 705x806px) Image search: [Google]
target.jpg
75KB, 705x806px
some stupid c++ project that my teacher was too dumb to make the correct instructions for. I shit you not, she had to correct the instructions the day before it was due, so now im busting my ass trying to get it done the right way.
>>
Bare metal programming on a BeagleBone. Processor documentation is so much better than a Raspberry Pi.

Fuck Broadcom.
>>
>>59648339
yes.
this is one of the basic fundaments of modern physics.
>>
>>59648322
I was doing something like this in R for awhile. I started wanting to be able to have each post be displayed to me so I could hit a key corresponding to Shitpost, Quality, or Skip... or some categories like that, whatever, and then it would tag it and show me the next post. But I hate webdev and failed at finding a solution to that.

Anyhow I'd wish you luck but
>python
disgusting
>>
>>59648376
>a womeme programming teacher
why are you still in that class
>>
>>59648346
So it 1/2 zero then? As you have zero apples left after you've divided them among 2 people.
>>
>>59645942
So you don't have a clue pretty much. OK.
>>
File: 1490810826149.jpg (17KB, 385x387px) Image search: [Google]
1490810826149.jpg
17KB, 385x387px
>Want to make a language for low iq people like me
>too low iq to create it
>>
>>59648362
>redefine your math as
>1/0 = 0R1
i believe it should be 1/0 = 1, since the result of apple division is apple and it wasn't _actually_ divided (0 people to divide among) so it would remain as it was (1) and the info about 0 people can be omitted since it didn't have result on apple
>>
>>59648410
is that emoji language open source?
>>
>>59648346
You can't possibly be this retarded.
>>
>>59648292
Rude
>>59648322
Sounds cool, make sure to post the your data when you done
>>
>>59648406
Don't you have a fish's dick to blow, blow?
>>
>>59648410
It has already been created...

BASIC my man.
>>
You expect me to believe you people actually don't like C? Fucking C Programming Language? It's the king of languages that everything comes from and is still applicable today

Either explain what has your panties all twisted up, or get a life
>>
>>59648415
>the result of apple division is apple
no, the result is how many apples each person gets.
there are no persons so you remain with one apple.
therefore
1/0 = 0
1%0 = 1
>>
>>59648470
>there are no persons so you remain with one apple.
Who is "you" then?
>>
>>59648405
1/2 is 0.5 - half of apple to each

>>59648431
prove otherwise
>>
>>59648292
explain
>>
>>59647052
Depends on what you're doing.
I find that for most use cases you can favor UDP because the complexity in using tcp is usually not worth.

Unless you absolutely need reliable transfer that is.
>>
>>59648467
>that everything comes from
Are you 15 years old?
>>
>>59648467
Nobody likes turds except for flies like you.
>>
>>59648494
1/2 is a ratio type, whereas 0.5 is a floating point type.
>>
>>59648395
What is wrong with using something like Python to scrape 4chan. It is simple to use. The library is available to use already. I am scraping over a long period of time so performance doesn't matter. It was the fastest way for me to set off gathering data.

Analysis can be done in another language and I was planning to do it in Ruby. Still looking around.

Also
>I started wanting to be able to have each post be displayed to me so I could hit a key corresponding to Shitpost, Quality, or Skip... or some categories like that
You would be sorting 1 week worth of ALL 4chan post. You won't be able to humanly do it in proper time.
>>
>>59648505
no, that's a decimal
>>
>>59648492
Gettin' real fuckin' deep ITT
>>
>>59648514
>What is wrong with using something like Python to scrape 4chan.
Well, you're scraping 4chan for one.
>>
>>59648514
>Python
No

>You would be sorting 1 week worth of ALL 4chan post.
This was meant to be a system for use in smaller communities in 4chan, not across 4chan entirely. Focusing on a board, or a general.
>>
>>59648470
but if 0 people, the original apple isn't divided either, so
1/0 = 1
1%0 = 1
>>
>>59648492
that is an interesting observation. there can be no 0 persons, since there's always at least 1 you.
I propose
0 = undefined
>>
>>59648539
Give me a better language for such a purpose then.

>>59648532
It is a fun project. It is not like your project is superior to mine.
>>
>>59648492
(you) is a state of apple
>>
>>59648575
It is. I am creating strong AI.
>>
>>59648575
Mine is infinitely superior to yours in every way.
>>
>>59648575
Idris
>>
>>59648567
I propose that you are a fuckwit.
>>
>>59648505
but they both are numbers, so type info is irrelevant
>>
>/dpt/ really humoring a 2nd grade conundrum
>>
>>59648594
Does it have a library available to instantly start scraping 4chan?

>>59648590
>>59648589
Okay familias. Good luck with your projects.
>>
>>59648605
the number type is just a superclass for both.
>>
>>59648605
1/2 is not a number, it's a fraction.
>>
>>59645949
I've been trying to work out how to use a parameter that I've passed to a base class in another member function of the derived class.
Any tips?
>>
>>59648619
No.Elm might though since its web-oriented. And can also be compiled to JS (god help you).
>>
File: !.jpg (87KB, 1280x720px) Image search: [Google]
!.jpg
87KB, 1280x720px
>>59648630
>fractions aren't numbers
>>
>>59648575
R

inb4 does it have a library
No but 4chan has a fucking API what do you need a library for
>>
>>59648539
>Focusing on a board, or a general.
That is simple as fuck

import basc_py4chan

board = basc_py4chan.Board('g')
thread = board.get_thread(59645949)

for post in thread.all_posts:
print(post.text_comment + '\n')

There you have all the given post in a thread. I am sure you can creating a sorting mechanism in your language.
>>
/g/ has reached new lows
>>
>>59648658
It's so easy when someone did all the hard work already.
>>
>>59648652
>No but 4chan has a fucking API what do you need a library for

I am already doing my analysis in R. I used python cause it was simple to use.
>>
>>59648630
its a floating point number?
>>59648567
although `you` is not a person, but a state of apple and it is 1, which is clearly defined, so it can't be undefined
>>
>>59648647
Sorry, I just wanted to add a log to the shitpost fire. I'm not very good at this kind of thing.
>>
>>59648674
No fucking shit. That was why I used it in the first place. What the fuck is with you retards. What happened to doing projects for fun and interest? Now you have to handicap yourself and make it hard? You ain't my professor fuck off.
>>
>>59648683
Stop making excuses and just say "I'm using python because I'm a wibble baby and my poopoo diaper stinky stinky"

With how easy it is to scrape a site that offers an API, I'm not sure why you think that snippet is impressive. And since you're already using R elsewhere I'm just baffled even more.
>>
>>59648698
So mad. What did you learn in this project? I doubt it was much.
>>
>>59648694
your shitposts will never be good if you apologize afterwards.
>>
Good books for beginner-intermediate (CSCI senior) programming? Specifically, I'm wanting something that can help me write cleaner code.
>>
>>59648736
Practical Common Lisp
>>
>>59648717
Sorry.
>>
>>59648714
>What did you learn in this project?

Analysis methodology of the data. Getting the data isn't supposed to be the hard part you fucking morons. It is supposed to be simple part.

>>59648706
Because scraping the site isn't supposed to be the fun or challenging part of this project. The part I am interested in is analysis of the data. Why the fuck should I make it anymore difficult for me when I am simply gathering data. Boo hoo. Every single part of the project has to be hard as balls. Fuck off moron.
>>
>>59648765
I'd hardly even call it "scraping", it's literally just using the provided API. In the time you've spent defending your multi-language project you could have written a simple call to grab this thread
>>
>>59646128
Coding blocks is godlike. Listen to their clean code series.
>>
>>59648804
And what is your point dipshit? Seems like you have lost your argument there. Like I said, I don't give a fuck how the data is collected, the easier the better. It isn't the challenging part nor is it the interesting part. It is the most time consuming part because it to run for a week to gather data so the sooner I get it running the better so I can do the interesting part.

While I am arguing with morons like you here that have autism and don't seem to understand the purpose of do simple stuff fast, I am also researching how best to analyze the data, how to compare the image file md5, how to build a database for comparison and how I should conduct my analysis using tried and tested methods. That is the fun part. Not fucking rewriting my own wrapper in another language for 4chan API. That is for autistic people like you. I know I can do that if I wanted to but unlike you I know when not to do that.

Again fuck off moron with your muh python.
>>
>>59648888
>I don't give a fuck how the data is collected
typical python user
>>
>>59648905
What is the difference if I use another language to collect the data?

Does it come with an extra whiff of autism and elitism?

Does it make a week past faster?

Does it make me stupid like you who is unable to identify that languages are just tools and you should use the tools most suited for the task?
>>
>>59648940
There's only one place for your kind.
>>>/r/eddit
>>
how do i set an array attribute on a certain Class (in java)?
>>
>>59648955
Yeah one of the keywords in my database is the usage of >>>/r/eddit

Thanks for contributing to my research.
>>
>>59648940
>missing the point this hard
The language doesn't matter. What matters is the entire process, from how data is being collected, to how its stored, then finally processed and presented.

You see the goal as just getting the processed data. When you should be worrying about the whole picture.
>>
>>59648940
Funny that you saved so much time bringing in python to handle that tricky API call, but are sitting here arguing for so long.

Maybe you are letting out some frustrations at having no ability to do this fun analysis you have in mind. It would fit the "bring in python to handle the API calls" narrative.
>>
>>59648986
I already said I am not doing the analysis in Python you moron but stick to your stupid narrative. I am doing research as we speak. It is not like I can make the time go faster.

>>59648982
Yes my goal of using python is getting the processed data as fast as possible. What is it about the whole picture that I am worrying about? I already said I am not doing the analysis in Python.
>>
>>59649006
>my goal of using python is getting the processed data as fast as possible.
>python
>fast
>>
>>59649006
Stop replying to retards.
>>
>>59649029
I am collecting data over a period of a week. Fast here means starting collection as soon as possible. It doesn't mean performance.
>>
>>59649044
Here's your (You)
>>
>>59649029
He needs the extra time to convince us that it was necessary
>>
>>59649044
It is fine. I consider this on the ground research. With enough first hand experience I might be even able to analysis which board contains the most autism and how to go about identifying the most autistic board. Clearly with /g/, it is how using python triggers autistic people. Now to quantify it and make an objective parameter.
>>
>>59649013

Data structures are memes.
>>
>>59649070
literally /r9k/
>>
>>59649100
Eh it is fun to do stuff like that but apparently people think the fun is making your scraper in Rust or something.
>>
>>59649070
>uses an autistic language to analyze an autistic vietnamese book binding image forum
>claims everyone but him is autistic
>>
>>59649160
>Still insist I am using Python to analyze the data
>Despite me saying multiple times already I am not
What does anon mean by this?
>>
>>59649079
Well, then I need to git gud at memes.
>>
>>59649160
you forgot
>can't stop arguing on the bbs even though he's saved so much time and the juicy analysis awaits
>>
New thread when? Make sure it gets an anime pic
>>
NEW THREAD!!

>>59649213
>>59649213
Thread posts: 322
Thread images: 22


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