[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: 321
Thread images: 41

File: 1485633700505.png (661KB, 600x600px) Image search: [Google]
1485633700505.png
661KB, 600x600px
What are you working on, /g/?

Old thread: >>58704707
>>
fuck you for posting an anime image
>>
Can anyone help me with fstar-lang.org . I cannot understand how their effectful monads are implemented.
>>
>>58709177
>>
decentralized imageboard thingydoo using nntp for sync
added lua support for custom markup parsing
>>
>>58709200
>spacemacs
nice desu
>>
File: 1923468198.webm (2MB, 1280x720px) Image search: [Google]
1923468198.webm
2MB, 1280x720px
>>58709139
ANIME
>>
I want to have a very simple webpage to stream the music I have on my server when I'm not home.
I'm not satisfied with the bloated bullshit that is available for self-hosting, and I don't mind programming something myself.
However, I'm not a web programmer so I'm not sure what I will need to do. I guess I'll have to generate some HTML dynamically based on my directories, and then serve that + whatever CSS + some JS for a basic player? Is there anything missing?
>>
File: reimu.gif (514KB, 221x231px) Image search: [Google]
reimu.gif
514KB, 221x231px
>mfw watching Jonathan fuck up his hacky game engine
https://www.youtube.com/watch?v=g2F0Yg17ZfU
>>
>>58709215
I got an instance for people to play with the markup at https://2hu-ch.org/b/overchan.test/

>>58709332
what's wrong with mpd and nginx/icecast?
>>
>>58709332
>Is there anything missing?
php
>>
>>58709344
>Jonathan
who
>>
nth for actual arguments
>>
reposting in new thread
I need help with some compilation error in C

here is my functio,:
int **createArray ( int rows, int cols )
{
int **array = malloc(rows * sizeof *array + (rows * (cols * sizeof **array)));

int *const data = array + rows;
int i;
for(i = 0; i < rows; i++) {
array[i] = data + i * cols;
}

return array;
}


I get this warning in the command line when I compile.
Warning initialization from incompatible pointer type
int * const data = array + rows;
^
Program works just fine with the function. I just want to get rid of the warning and still have it work. How do I do this? Is it because its **array and *data?
>>>58709261
literally the one thing I cant change to make it work with the rest of the code.
>>
>>58709393
>I just want to get rid of the warning
-Woff
>>
I added some bulk parsers for the output tables in the BasicTV console (data type associated with an ID), and more TV and memory management commands. I also disabled printing out completely empty columns
>>58709200
dude nice, is it usable?
>>
>>58709393
you allocate an "array" of int pointers but never allocate the pointers in that "array"
>>
>>58709410
-Awoo
>>
>>58709344
>:=
jai is trash
>>
>>58709423
yes, since like 2013 ish, not my idea and it's a second gen implementation
B-^)
>>
>>58709393
>
int *const data

what the fuck
>>
>>58709362
Dunno, I haven't looked into icecast, let me see.
>>58709364
Alright, and what is php doing in this scenario?
>>
>>58709185
Actually, that comment ('what the fuck happened to the thread?') was about the shitposting, not the anime. There's always anime.
>>
>>58709393
>int *const data = array + rows;
This tries to cast a int** into a int*, which is obviously not the same data type.
>>
http://js1k.com/2017-magic/

Are you taking part, /dpt/?
>>
>>58709566
sounds interesting
>Javascript
really?
>>
>>58709566
What does this have to do with programming?
>>
File: javascript.png (36KB, 473x328px) Image search: [Google]
javascript.png
36KB, 473x328px
>>58709566
>Create some JavaScript program with a max size of 1k and make it do something cool
Done.
>>
>>58709136
Erlang. It's so easy it's boring.
>>
>>58709597
*rolls eyes*
>>
File: 1485398946790.jpg (13KB, 600x159px) Image search: [Google]
1485398946790.jpg
13KB, 600x159px
>>58709607
I would like to post this image in addition to yours.
>>
File: javascript.png (5KB, 148x107px) Image search: [Google]
javascript.png
5KB, 148x107px
>>58709650
>>
File: 1479600745037.png (222KB, 564x334px) Image search: [Google]
1479600745037.png
222KB, 564x334px
>>58709480
It was, but blaming shitposting on anime and thus losing ability of forming coherent speech is some top-tier autism I've never seen yet.
When will the wall from non-weebs be built? They annoy me lately.
>>
>>58709650
>inb4 the JS apologist comes in again and says that you just don't know the language
>>
>>58709687
Jesus Christ
>>
>>58709722
>building a wall
literally why? Just execute them right away.
>>
>>58709650
What the fuck happens on the picture
>>
>>58709687
>>58709650
>>58709607
I have never touched javascript but this looks really fucked
any explanation?
>>
>>58709797
['10', ..., '10'].map(n => parseInt(n))
works, by the way.
Yes, it's really fucked up any whoever designed this trainwreck should go find a job that's more fitting for his skills.
>>
>>58709828
explanation: javascript is a shit language
inb4 js apologists
>>
>>58709797
parseInt has optional parameters, and for some reason when you use a function with optional parameters to map over a array, instead of using the default argument values, they're taken from the array. I think.
>>
File: wtf.jpg (16KB, 238x397px) Image search: [Google]
wtf.jpg
16KB, 238x397px
>>58709828
>>
>>58709797
>>58709828
was gonna reply but here
>>58709845
>>
>>58709849
what the actual fuck
>>
File: höhöhö.jpg (146KB, 468x440px) Image search: [Google]
höhöhö.jpg
146KB, 468x440px
>>58709849
>>
File: 1464823306282.png (5KB, 270x175px) Image search: [Google]
1464823306282.png
5KB, 270x175px
>>58709883
>>
>>58709849
what happens if you type five-- again after five.wtf is undefined
will it be potato again?
>>
File: ohno2.png (502KB, 1280x956px) Image search: [Google]
ohno2.png
502KB, 1280x956px
>want to learn WPF for easy to make simple 2D menu based games (Think Texas Holdem or a JRPG without any animations)
>Look for WPF tutorials/documentation
>WPF applications are like some hidden lore that no one knows about
>Ask people in IRC and Ventrilo that are professional .Net Devs and Software Consultants
>None of them have ever touched WPF applications

Am I trying to play with black wizard magic or something?
>>
File: what.jpg (9KB, 667x69px) Image search: [Google]
what.jpg
9KB, 667x69px
>>58709888
>>58709892
try this one
>>
File: javascript advocate.png (6KB, 482x74px) Image search: [Google]
javascript advocate.png
6KB, 482x74px
>>
>>58709899
Come on, now that one's obvious.
>>
>>58709890
>
NaN !== NaN

holy fuck. how can anyone claim to actually like using javascript and think it's a decent language?
>>
>>58709927
it's like when people learn Python as a first language
they become damaged
>>
>>58709927
Equality being an equivalence relation is overrated.
>>
>>58709927
This is potentially the only one that actually makes sense (just how +inf can never be equal to +inf).
>>
File: 1442196753224.jpg (613KB, 3000x3000px) Image search: [Google]
1442196753224.jpg
613KB, 3000x3000px
>>58709899
>>58709890
>>58709849
>>58709650
>>58709687
>>58709607
how is that language still allowed
>>
>>58709955
>>>/g/wdg
>>
how to properly do variable sized arrays on the stack in c++
>>
>>58709687
absolutely disgusting
>>
>>58709936
>>58709938
>>58709952
how are you supposed to check for NaN? isn't NaN an abstractly constant value anyway
>>
>>58709955
google and the w3c
>>
>>58709955
web devs are the sweden of programmers
>>
>>58709975
Would a vector fit your needs?
>>
File: 1474226556028.png (202KB, 720x540px) Image search: [Google]
1474226556028.png
202KB, 720x540px
>>58709936
And those people said me BASIC is shit as the first language.
>>
>>58709982
there's a isNaN() function
>>
>>58709952
>>58709982
If you actually wanted to make sense, NaN and signed infinities wouldn't even be representable.
>>
i assume it is a wrapper for a heap allocated array
>>
File: why.png (819KB, 1920x1080px) Image search: [Google]
why.png
819KB, 1920x1080px
>>58709344
>>58709373
>>58709451
>Using SVN
>Committing built files
wut?
>>
>>58710018
>>58709990
>>
>>58710020
As far as I know he wants to release the game and the code together with his compiler. Kind of like a demo to hack around in.
Why he's checking in the binaries at this point? No clue.
>>
>>58710020
he hates git & doesnt think it competent for games or large assets
>>
File: face15.jpg (63KB, 625x531px) Image search: [Google]
face15.jpg
63KB, 625x531px
>>58710020
>implements compile-time type checking for his parser, but only integer detection
>makes SVN commit message "Integral success"
>>
>>58709767
I was kind of hoping he would :(
He's good fun.
>>
>>58709895
>>Ask people in IRC and Ventrilo that are professional .Net Devs and Software Consultants
>>None of them have ever touched WPF applications

Either they all are exclusive back end developers or they are just plain shit...

Everyone working with .NET for a while should have at least done some basic things with WPF.

>Am I trying to play with black wizard magic or something?
Nope. Microsoft pretty much dumped Windows Forms and is now using WPF/XAML everywhere.
It's not too hard to learn, just try out some stuff, maybe look at some wpf frameworks like MetroWindow, Oxyplot, whatever to check how they did something and see how you (would) do it.
Data bindings are amazing by the way.
>>
>>58709722
No-one blamed shitposting on anime. In fact, anime had nothing to do with the conversation until 'animuuuuuu etc' was posted.
>>
>>58710119
>MetroWindow
Meant to say MahApps.Metro.
>>
File: are you even trying.png (2KB, 186x94px) Image search: [Google]
are you even trying.png
2KB, 186x94px
>>58709890
works on my machine
>>
>>58709955
>>58709899
>>58709890
>>58709849
>>58709650
>>58709687
>>58709607

Does anyone have any more of these? I'm composing a JavaScript wall of shame.
>>
>>58710020
Does anybody on /dpt/ stream their programming? When I finish up with video on BasicTV, I want to set up a stream just to have some fresh content.

Also, here's a great idea I just had. With RSS feed integration, you can broadcast MP3 and MP4 streams via RSS to a client on your phone so you can watch it live from anywhere in the world as well as automatically pulling, converting, and adding programming to the RSS/Atom feed automatically.

Going off that, does anybody here listen to podcasts?
>>
>>58710119
>>58710142

Yeah they are backend devs. I think most of their front end stuff is done through websites (though I think I remember reading WPF could be used for webdev too or something.)

I'll check out those frameworks though, right now I'm reading http://www.wpf-tutorial.com which seems like a decent resource. I already read the stuff on MSDN about WPF but their examples honestly weren't very helpful for me. I think they wrote their stuff as an example for people already using winforms. This is my first time trying to use any sort of GUI development. I've just been doing trivial console apps. But from what I've seen of people using winforms once you get good you seem to be able to make actually useful applications very quickly. I spent a lot of time making retarded console app interfaces and console app output buffers and stuff to try and mimic GUI interfaces in a text console app.
>>
>>58710176
i use nginx with rtmp to stream via authenticated vpn tunnel that mirrors to tor hidden service and forwards to twitch, since twitch blocks tor
i'd stream more often if more people actually tuned in
>>
>>58710020
Went through that video. I'm surprised he didn't start off with VBOs, even just really stupid ones. His initial solution is way more work to my mind.
Surprised he didn't go check what GL_STREAM_DRAW was when he had to debug. Since he said he should probably check that since he didn't know. Maybe chat answered silently.
>>58710176
>podcasts
I used to but there's no good ones anymore.
>>
Why does the gay ass JVM skip
for (int i = 0; i < Integer.MAX_VALUE; i++) {
for (int a = 0; a < Integer.MAX_VALUE; a++) {
}
}

_instantly_
but takes a quadrillion years for
for (int i = 0; i < Integer.MAX_VALUE; i++) {
for (int a = 0; a < Integer.MAX_VALUE; a++) {
for (int b = 0; b < Integer.MAX_VALUE; b++) {
}
}
}


explain this
>>
>>58710275
>since twitch blocks tor
i'd stream more often if more people actually tuned in
can you post a link?


>>58710287
There are some good ones still.
>>
>>58710272
>(though I think I remember reading WPF could be used for webdev too or something.)
Check out Silverlight (actually don't, but that's probably what you read about)

>http://www.wpf-tutorial.com
The first few pages look somewhat decent.

>once you get good you seem to be able to make actually useful applications very quickly
That's pretty much the case with everything, isn't it?
>>
>>58710329
>why does O(n^3) take exponential more time than O(n^2)
>>
>>58709464
The lvalue *data is a constant.
>>
>>58710329
I don't see why you care.
You're using Java so you didn't really care in the first place right?

Either way I'd assume this is their static compilation step catching the dead code vs the JIT being just as amazing as people promise you.
>>
>>58710331
it's up when it's up
http://psii2pdloxelodts.onion/stream/
>>
>>58710372
Moron. There's no cure for this level of stupidity other than death. Kys
>>
>>58710378
Not him, but I have never seen it written like that
const int *data;

is far more common, but if it works, then it's fine

>>58710391
opening up Tor now
>>
>>58710372
I'm not dumb, idiot
it still makes no sense
it literally skips the first one
>>
>>58710406
Those are two different things.

Pointee is immutable
const int * data; // or int const * data;
data += 2; // this is legal
*data = 2; // this is illegal


Pointer is immutable
int * const data;
data += 2; // this is illegal
*data += 2; // this is legal
>>
>>58710435
>I'm not dumb
Yeah, you are.

JIT
>>
>>58710406
never really thought if the onion would scale beyond 4 viewers because of the setup that goes on, would probably need to figure out
>>
>>58710380
>>58710465
He's wondering how the first example is removed but the second is.
>>
>>58710485
Because of how JIT is implemented in the JVM, obviously. This shouldn't be hard to understand.
>>
Hey, any of you might happen to be coding with Java EE ?
I'm currently using Spring MVC (Spring Boot) because that's what we used in class but I heard here in /g/ that it was a bad idea. Don't know if I was being trolled or not.
So any good alternatives ?
Also any book recommendations ?
>>
>>58710500
But WHY?
>>
>>58710470
I don't see a stream on the onion link itself, but I have the Twitch link up (offline)
>>
>>58710509
Because people want JIT to be fast. So they have to draw the line somewhere. Apparently three nested loops is where it decides "yeah, I'm not gonna optimize this shit".
>>
>>58710511
FINE i'll start coding jeez
>>
>>58710509
Because of how it is implemented, Jesus fucking christ. Look up On Stack Replacement in the JVM.
>>
>>58710533
>http://psii2pdloxelodts.onion/stream/
I'll start if you start...
>>
>>58709849
This is nothing special.
>>
File: i have no idea of fun filename.jpg (285KB, 1600x1045px) Image search: [Google]
i have no idea of fun filename.jpg
285KB, 1600x1045px
How does one make this picture to be more /dpt/ than it is?
>>
>>58710649
more anime
>>
>>58710649
i nicely shopped lain sitting in the back
>>
>>58710680
>>58710687
agree
>>
>>58710649
Needs more NEET neckbeards, more angry teenagers, more Haskell, more shitposting, and more anime. And a Pajeet.
>>
File: languages2.png (16KB, 522x384px) Image search: [Google]
languages2.png
16KB, 522x384px
Reminder
>>
>>58710705
>more Haskell,
Literally shop "Train Haskell everyday" on the second frame.
>>
What are some neatly designed C, or C++ libraries?
>>
>>58710810
musl
>>
>>58710737
>Pick one

I wasn't on /g/ or in the dpt for a while and you guys are still having that 'fight' over what programming language is best / worst...? Or has this become something like a running gag?

Reminder that, if you truly think any programming language is best / worst you are a shitty developer/programmer/whatever.

Learn at least a half dozen programming languages. Include one language that emphasizes class abstractions (like Java or C++), one that emphasizes functional abstraction (like Lisp or ML or Haskell), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), and one that emphasizes parallelism (like Clojure or Go).


https://blog.bradfieldcs.com/in-2017-learn-every-language-59b11f68eee
http://norvig.com/21-days.html
>>
>>58710824
allahu akbar
>>
>>58709890
This is true in C, C++, or any language that properly implements IEEE floating point arithmetic. There is a lot of bullshit in js but nan handling is not one or them
>>
>>58710827
It's been worse than usual of late.
>>
>>58710523

In a decent JIT, I'd think it shouldn't matter. Rather than trying to look at the whole loop, look at one loop at a time. In optimizing the innermost loop, you see that it is dead code, so you optimize it to a NOP. For the second loop, you see that it is iterating over a NOP, and you optimize that out to a NOP. This is then repeated for the third loop.

But I don't know too much about which optimizations are used by the JVM.
>>
>>58709982
There is more than one NaN learn how floats work holy fuck. There are signalling and non signalling nans. I don't even use Javascript, I do numerical computing and this is an important way to denote failure or missing data
>>
>>58710560
>>58710533
yeah, it works
>>
>>58710827
There is the difference between best/worst language ever and best/worst language in some case.
>>
>be me
>applying for jobs
>choke up in interview and sound like complete autist

pls help
>>
>he uses boost
>>
Still on this /g/

How would I prove two images are the same despite some things in one of them being recoloured?
>>
>>58711050
>be me
>sit around all day eating biscuits
>don't bother applying for jobs
>>
>>58711080
diff img1 img2
>>
>>58711080
margin of error
>>
File: ????.jpg (45KB, 577x622px) Image search: [Google]
????.jpg
45KB, 577x622px
>>58709139
What's wrong with my http client?
#include <iostream>
#include <boost/array.hpp>
#include <boost/asio.hpp>

using boost::asio::ip::tcp;

int main(int argc, char **argv)
{
try
{
if (argc != 2)
{
std::cerr << "Usage: ./client <host>" << std::endl;
return EXIT_FAILURE;
}

boost::asio::io_service io_service;
tcp::resolver resolver(io_service);
tcp::resolver::query query(argv[1], "http");
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
tcp::socket socket(io_service);
boost::asio::connect(socket, endpoint_iterator);
boost::system::error_code error;

std::string message = "GET / HTTP/1.1\r\n";
boost::asio::write(socket, boost::asio::buffer(message), error);

for(;;)
{
boost::array<char, 128> buf;
size_t len = socket.read_some(boost::asio::buffer(buf), error);

if (error == boost::asio::error::eof)
break;
else if (error)
throw boost::system::system_error(error);

std::cout.write(buf.data(), len);
}
}

catch (std::exception &e)
{
std::cerr << e.what() << std::endl;
}

return EXIT_SUCCESS;
}

It connects and just sits there doing nothing.
I want it to spit out some html.
>>
>>58711080
Did you try the Y component method? How did that work?
>>
>>58711080
Monochrome both of them then compare.
Disclaimer: I don't know anything about image processing.
>>
>>58711119
>
#include <boost

found your problem
>>
>>58711160
NO MEMES
>>
>>58711119
>C++
there's ur problem
>>
>>58711202
switch to D and use Vibe
>>
>>58710827
>https://blog.bradfieldcs.com/in-2017-learn-every-language-59b11f68eee
That's the most sensible article I've read in a very long time.
>>
>>58711112

that would just flag any differences as errors

>>58711124

I used the equation on wikipedia and got

int Y = (int) (R * .299000 + G * .587000 + B * 0.114000);


which makes both images various shades of blue. Disclaimer: I have no prior experience with YUV. I tried converting some images to YUV online but I can't find a program that will open them.

>>58711126

Monochrome requires a threshold which has to be known in advance.
>>
is it bad practice to use "break;" in for loops?
>>
>>58711261
No, continue is okay too if used wisely.
>>
>>58711261
yes
>>
>>58711261
maybe
>>
>>58711274
>>58711286
>>58711307
>no
>yes
>maybe
Good job, guys.
>>
>>58711119
>C++
>Boost
Jesus christ
>>
>>58711248
If you are only getting one value, how are you redrawing it back to the screen? Does the shade of blue actually match the brightness on parts of the screen? Can you post the output image?

>>58710560
>>58710533
A deal is a deal
twitch.tv dako300
>>
>>58711351
You have to move past Hello World some time.
>>
>>58711080
can you provide an example of such images?
>>
>>58711384
>le u need mabbivw amounts of bloat to rite REEL software maymay
Good one, idiot.
>>
File: udy1nj7i27ae6xzzsa1a.jpg (28KB, 620x470px) Image search: [Google]
udy1nj7i27ae6xzzsa1a.jpg
28KB, 620x470px
>>58711384
It'll be a long time before you make it to FizzBuzz, though.
>>
>>58711396
Oh, it's the templates cause bloat episode again.
>>
>>58711384
>he needs boost to do anything besides Hello World

lomaing @at you're live
>>
>>58711220
>>58711351
I already did C and unix sockets you niggers I DID MY TIME. Now I wanna use boost.
>>
>>58711433
>now i wanna use boost
why tho
>>
>>58711119
{ should not start on a new line
>>
>>58711396
not an argument.
>>
>>58711444
Masochism.

>>58711457
Not an argument.
>>
int independence; // declaration of independence
>>
>>58709139
C++ is shit.
>>
>>58711467
Saying that "Not an argument." is not an argument, is not an argument.
>>
>>58711468
independence :: America Freedom
>>
File: squares.png (12KB, 1232x754px) Image search: [Google]
squares.png
12KB, 1232x754px
>>58711375
>>58711390

I drew some random squares to test against.

I managed to convert an image to YUV using imagemagick and the different regions of color end up with different Y values so I don't really see the difference between Y comparison and greyscale comparison.
>>
>>58711485
Saying that saying that "Not an argument." is not an argument, is not an argument, is not an argument.
>>
File: squares2.png (5KB, 1232x754px) Image search: [Google]
squares2.png
5KB, 1232x754px
>>58711509

with changed colours

I considered a basic colour histogram, but multiple regions of the image could be set to the same colour which would break that approach.
>>
>>58711483
Shitty bait.
Nobody would dispute that.
>>
File: 1479575376277.jpg (597KB, 800x815px) Image search: [Google]
1479575376277.jpg
597KB, 800x815px
>>58711485
>>58711528
Not an argument.
>>
>>58711080
>>58711534
>>58711534
Since any of the colors can change, I would try and generates lines of high contrast and compare those two against each other. The Y component is designed to be greyscale (originally used for TV broadcasts for backwards compatibility, so it makes sense). I'd like to see how you would approach that.
>>
>>58711543
noa
>>
>>58711556
See >>58711556
>>
>>58711571see>>58711571
>>
>>58711578
See >>58711571
>>
This is an argument.
>>
>>58711589
Not an argument.
>>
>>58711588->>>58711571
>>
>tfw started the not an argument gimmick
>>
>>58711534
Run them through a high pass filter and compare thee results.
>>
>>58711589
This is a post expressing doubts about your sexuality.
>>
Cancer thread
>>
>>58711160
>>58711220
>>58711351
>>58711445
is that all your tiny brains can come up with?
>>
>>58711618
not an argument
>>
>>58711618
its all i need, boost is the pajeet, c++ is the poo
>>
>>58711618
you shouldn't use braces for single statements
>>
>>58711602
See >>58711627
>>
>>58711545

wait a minute here, if any regions of the image could be changed to the same colour then they all could.

So I could colour the whole thing in black and it would still satisfy the conditions - any single colour image would be considered the same because changing two separate regions into one singular homogeneous region is loosing information.

I think I've just proven that what I want to do is impossible.
>>
>>58711719
It really isn't. What you want to do is ignore colour and just compare saturation or opacity.
Disclaimer: I still don't know anything about image processing, but this is definitely not impossible.
>>
>>58710827
>I wasn't on /g/ or in the dpt for a while and you guys are still having that 'fight' over what programming language is best / worst...? Or has this become something like a running gag?
m8, this is what dpt is all about
these autists will literally argue the same shit, over and over and over, for years
welcome to /dpt/
>>
How do I get fluent in machine code? I want to compile with my bare hands.
>>
>>58711743

Converting both images to black and white requires some kind of threshold value so you need to know what the images are before you compare them.

So for instance if one of the images was very dark it would risk turning it completely dark.

I suppose you could try a range of threshold values and then find the one which produces an image with the most colours.
>>
>>58711813
wont work if a black was changed to a white/image was inverted
>>
>>58711804
Read machine specification.
>>
Is it possible at all to get a job with D?
>>
>>58711851
Less employable than Haskell.
>>
>>58711111
Checked
>>
File: 7phuJaq6.jpg (42KB, 512x512px) Image search: [Google]
7phuJaq6.jpg
42KB, 512x512px
>>58711851
Maybe if you talk to this guy.
>>
>>58711834

which leaves me with only one real approach,

cycle through the image and separate each of it's constituent regions of colour into arrays/frames/buckets.

cycle through the new image and do the same,

for each of the arrays/buckets/frames, check that there is a corresponding one from the other image.

the downside of this is that its worst case makes me want to die.
>>
>>58711900
Andy loves the D.
>>
Can I use memes at interviews? I want to somehow sneak in "implying". What are the possible repercussions?
>>
>>58711978
Hello R eddit
>>
>>58711900
>>58711966
>tfw you will never work at botnetbook writing D with Andrei-senpai
>>
>>58711987
:(
>>
File: 1391210483617.png (213KB, 783x623px) Image search: [Google]
1391210483617.png
213KB, 783x623px
How do I read a string, and then assign an int to it?
For example I would read "Jan", and then assign the number "1" to it.
>>
>>58711998
1 - *((int*) "Jan")
>>
>>58711998
auto t = tuple(1, "Jan");
>>
>>58711998
A hashmap (or similar structure) would probably be the most elegant solution.
>>
>>58711998
Language?
>>
>>58711998
>>58712013
though seriously do this

const char* months[12] = { "Jan", "Feb", ..., "Dec" };

const unsigned uint8_t i;
for (i = 0; i < 12; ++i)
if (strcomp(months[i], myString) == i dont know C but whatever the result for "yes" is)
break;

if (i == 12)
error
>>
>>58711962
>>58711611
Contours should be independent of coloring, so it should be easier to compare the filtered images. Does this not work for you?
>>
>>58712044
java
>>
>>58712047
It's very intuitive, it's 0 if the strings match.
>>
>>58712041
A vector would be much better for 12 constant elements.
A binary tree would do 3 or 4 levels of indirection for that


>>58712055
I would expect 1 if they match and 0 otherwise.
>>
>>58712054
>Java
XD

>>58712047
>strcomp
XD
>>
>>58712061
>I would expect 1 if they match and 0 otherwise.
Yeah, that was sarcasm.
>>
>>58712067
I didn't choose to use java.
>>
>>58712071
sarcasm == 0?
>>
>>58712061
>>58712055
It's a 'comparison', not an 'equality test'.
A string can be greater than, or less than the other.
So it returns something >0 and <0 for those respectively, and ==0 if they exactly match.
It's not the only language that does this.
>>
>>58712074
Java chose you.
>>
>>58711859
Excellent. Is it at least a good language? Why isn't it popular?
>>
>>58712013
>>58712035
>>58712041
>>58712044
>>58712047
POO
>>
>>58712083
Garbage collected.
>>
>>58712083
>Is it a good language?
It's better than C++, except for all the GC in the standard library.

>Why isn't it popular?
It isn't good enough to convert people
>>
>>58712083
Because no-one wants C++ with GC.
>>
>>58711998
Hashes.
$mon = <>;
if ($mon eq "Jan") {$hash{1} = "$mon";}
>>
>>58712047
enum months = ["Jan" : 1,"Feb" : 2,"Mar" : 3,"Apr" : 4,"May" : 5,"Jun" : 6,
"Jul" : 7,"Aug" : 8,"Sep" : 9,"Oct" : 10,"Nov" : 11,"Dec" : 12,];
>>
>>58712122
data Month = Jan | Feb | ... | Dec deriving (Eq, Read, Show, Ord, Bounded, Enum)


succ . fromEnum . read
>>
>>58712050

but doesn't detecting contours still require a threshold?

I'll look into contouring when I get more time.
>>
To the anon that asked about playback for BasicTV:

i set up an console audio test with BasicTV. Pull the code from the Git, start it, connect via telnet to 127.0.0.1 at port 59000 and run 'tv_test_audio 0 [WAV FILE LOCATION]"

Fast forwarding and rewinding isn't as simple, but it works (for now)

You can also see me playing some dank music on the Twitch at >>58711375
>>
>>58712165
forgot the git link
github.com/Dako300/BasicTV
>>
File: 1463120642088.jpg (220KB, 1496x1264px) Image search: [Google]
1463120642088.jpg
220KB, 1496x1264px
Just got postgreSQL C library libpq-dev and got the compile+build working with it, the fuck do I create now?

Getting space or tab-separated values to tables shouldn't be that hard, right? I have a few lists i could turn into a database of some sort, just for training.
>>
Are implicit params better than typeclasses in nearly every way?
>>
>>58712200
Zygohistomorphic prepromorphisms blow them both out of the water.
>>
>>58712282
I think you're confused
>>
>>58712289
I think you need to lurk more.
>>
File: stop taking memes.jpg (35KB, 586x296px) Image search: [Google]
stop taking memes.jpg
35KB, 586x296px
>>58712294
I think you need to lurk less

All those memes are rotting your brain
>>
>>58712289
not an argument
>>
>>58712323
not a morphism
>>
>>58712321
>All those memes are rotting your brain
I'm not the one who can't wrap his brain around zygohistomorphic prepromorphism.
>>
>>58711509
babby's first program?
>>
>>58712343
they are not remotely comparable to typeclasses or implicit parameters
>>
File: Capture.png (47KB, 871x795px) Image search: [Google]
Capture.png
47KB, 871x795px
>>58711080
>>58711509
>>58711534
here's an attempt
>>
File: 1467019345752.jpg (10KB, 180x157px) Image search: [Google]
1467019345752.jpg
10KB, 180x157px
>>58712380
>python
>>
>>58712379
See >>58712294
>>
>>58712162
Not necessarily I guess. Algorithms like canny need thresholds, maybe you could find some threshold set that generally solves your problem. There are also more general methods of filtering like the sobel operator, that can give decent results without much tinkering.

Also, there are ways to transform an image to binary automacally like Otsu's method, maybe that works for you.
>>
>>58712413
See >>58712294
And >>58712343
And >>58712396
>>
>>58712448
No, thanks :)
>>
>>58710344
Thank you very much for the helpful advice. I'll start working right away now that I'm home from work.

Also nice dubs.
>>
>>58711998
CL-USER> (list (read-line) 1)
Jan
("Jan" 1)
>>
If I start meditating do I lose the ability to spontaneously come up with programming problem solutions when I'm not thinking about the problem?
>>
>>58712657
I don't know
>>
>>58712657
It's supposed to help things like that.

Either it works, and it helps, or it doesn't work, and it has no effect.
>>
I used a Makefile to make an executable (called shopping) for a simple C program but everytime I try to run the executable with ./shopping i get 'command not found'

wtf am i doing wrong
>>
>>58713125
What are the permissions on the file? Does it have the execution bit set?
>>
>>58713125

Did you actually name the executable "shopping"?
Is the executable in a different directory than the Makefile?
Did you try any troubleshooting at all before coming to this thread with a trivial problem?
>>
>>58709139
This is my favorite SCIP image
>>
>>58713213
yeah, I've looked around. Most solutions are to people who didn't use './' and werent in the directory.
>>
>>58713125
if you cant do simple troubleshooting at least post the makefile
>>
I need to make a program that can move the windows mouse cursor to specific coordinates and click the mouse.

I know Java and C#.

Give me advice please. Where should I start? What language do I need?
>>
>>58713260
OBJS = shopping nameL1.o
C = gcc

all: shopping

shopping: nameL1.o
$(C) -o shopping nameL1.c

clean:
rm -rf $(OBJS)


ive gone through a few revisions trying to learn this, any fixes will help
>>
>>58713289
>i want to cheat in muh vidya games
>>
>>58713289
>what is google
>>
>>58713256
command not found means that your computer can't find the file with that name from your working directory nor from any directory in the path environment variable.

you might have dyslexia

t. spent 3 hours debugging because of a typo - setub.py instead of setup.py
>>
>>58713289
https://stackoverflow.com/questions/8050825/how-to-move-mouse-cursor-using-c
>>
>>58713316

This will never compile an executable. You don't have a rule for nameL1.o, and yet it is a dependency for shopping.

CC=gcc

all: nameL1.o
$(CC) -o shopping nameL1.o

nameL1.o:
$(CC) -c nameL1.c
>>
>>58713383
make will implicitly create the object file when it doesn't see a rule for it
>>
>>58713383
OBJS = shopping nameL1.o
C = gcc

all: shopping

shopping: nameL1.o
$(C) nameL1.o -o shopping

nameL1.o:
$(C) -c nameL1.c -o nameL1.o

clean:
rm -rf $(OBJS)


is this better?
>>
someone should make a makefile monad
>>
>>58713440

>implicit rules
I always forget about those. In which case, I have no idea what the fuck his problem is.

>>58713456

Well it's certainly more complete. In any case, why don't you show us a screenshot of a typical compile and run for you, complete with a ls -la command to show the contents of the directory right before running.
>>
How do you calculate integer square roots in logarithmic time?
>>
File: Untitled.png (202KB, 1920x1080px) Image search: [Google]
Untitled.png
202KB, 1920x1080px
What the FUCK does this mean?
>>
>>58713542
it means learn another language because java sucks
>>
>>58713456
Your first Makefile is fine and produces an executable for me. I have no idea what the fuck you are doing wrong. Are you mispelling something? Screenshot your running directory + contents and show yourself trying to make and run your program.
>>
>>58713456
>>58713383
>>58713514
>>58713561


I ran

gcc -o shopping nameL1.c

and then

./shopping

on my desktop and it worked.

So, somethings going on with my other machine cuse when i try to run ./shopping in the terminal i still get 'command not found'


I think I should go back to my more simple Makefile
>>
>>58713542
Why is Piece a concrete class? Why are you looping through the whole board just to do something for two rows? Why are all the pawns white, presuming that's what the last parameter corresponds to?
for (int i = 0; i < 8; ++i) {
piecePos[i][1] = new Pawn(i, 1, 1);
piecePos[i][6] = new Pawn(i, 1, 2);
}

Why are you using magic numbers instead of enums for the colour?
>>
if !programmer
{
return chad;
}
else
{
return beta;
}
>>
>>58713592
Sorry, second line should set the pawn's Y coordinate to 6.
>>
>>58713565
>>58713561
>>58713514

Alright, I figured it out. For some reason it wasnt allowing me to run the executable off a usb like I was, so it gave me the 'command not found' error. Is this normal?
>>
>>58713542
>pawn has it's own x and y variable when piece can just have it
you've already fucked up inheritance and you've hardly done anything

And then I see how you're doing the board, so each piece holds where it is on the board, but also the board is an 8x8 array where the indices correspond to where those pieces are. That's just unnecessarily redundant and the bookkeeping is just going to be a headache.
>>
>>58713565

Show the output of everything running on the other machine.
>>
>>58713633
figured something out

>>58713633

is there a reason why it doesnt run off a usb?
>>
>>58713629

A "command not found" error should imply that there is no executable there. Without further information, I cannot say why you are getting this error. There is a reason I asked for the ls -la command. I am assuming you are running some sort of unix?
>>
>>58713670
xubuntu on what was giving me the error from inside the usb, outside its fine like my windows desktop which ran it fine.

l believe maybe it was the file permissions when the file was inside the usb that was causing problems. From the short knowledge i know, I tried chmod 777 filename but it didnt do anything to the file inside the usb
>>
So my kmalloc and kmap use separate heaps.
Would it be better to keep them separated like that to avoid memory fragmentation? or would it be better to merge the two heaps and have kmalloc work on top of kmap?
>>
Why should I learn python over other scripting languages?
>>
File: Untitled.png (149KB, 1920x1080px) Image search: [Google]
Untitled.png
149KB, 1920x1080px
>>58713592
>Why is Piece a concrete class?

Why should it be abstract?

>Why are you looping through the whole board just to do something for two rows?
I want empty squares to get filled with an X so I can visualize what is happening.


>Why are you using magic numbers instead of enums for the colour?
I tried using enums but it just told me that you can't convert between enum and int. I tried putting enum into the parameters but that didn't work.


Now can you please tell me why I am getting this exception.
>>
>>58713755
Has tons of good libraries like OpenCV, Numpy, Scipy, etc
>>
>>58713755
Jobs is basically it

>>58713780
Isn't it annoying to redeclare X and Y for every single piece on the chessboard
>>
>>58713755
You shouldn't
>>
>>58713780
>Why should it be abstract?
There is no "Piece" piece in chess.

>I want empty squares to get filled with an X so I can visualize what is happening.
You can do that regardless.

>I tried using enums but it just told me that you can't convert between enum and int. I tried putting enum into the parameters but that didn't work.
You need to use enums the whole way through.

>Now can you please tell me why I am getting this exception.
Probably because you redeclared getName as abstract and didn't implement it, though I'm surprised Java even compiles this.
>>
>>58713755
Python is for fags.
>>
>>58713702

I don't suppose you were trying to run the same executable file on both operating systems?
>>
>>58713781
>>58713783
Apart from libraries, is there anything that sets it apart?

>>58713795
>>58713814
What scripting language should I learn instead? I already know C++
>>
>>58713845
Don't listen to these retards anon.
Python is the best scripting language to use because it is the most commonly used. You will have more opportunities to actually code stuff if you learn Python.
>>
>>58713845
>Apart from libraries, is there anything that sets it apart?
No, not really. It has "easy" syntax. It's not that bad to use but Racket has much better features
>>
>>58713845
Anything but Python
Lua is popular for C++
>>
>>58713833
I'd re-make the executable every time, some other people had that problem when i googled 'running executable off usb ubuntu' but who knows. I'll just work around it for now
>>
>>58713855
Listen, guy, just because it is popular doesn't make it the best. That is some dumb logic.
>>
File: Untitled.png (130KB, 1920x1080px) Image search: [Google]
Untitled.png
130KB, 1920x1080px
OK

I restarted. Is there anything wrong with this code so far.
>>
>>58710176
I just got an idea

Would people on /g/ be open to the idea of a Tox-powered podcast?

I would run a Tox group bot on a Pi or something, and everybody joins that. We decide on a weekly schedule, record our versions, and send (torrent, upload, etc) them to each other.
>>
>>58711433
>Be me.
>Some old as fuck batch-job reporty thing is crashing in production.
>Solaris old as fuck server.
>Read the core. 50k function calls stack trace. Say to myself 'this is some swap memory bullshit.
> debug the motherfucker. Find a function macro for logging some consultants put a thousand years ago.
> set breakpoint on malloc(). Reach breackpoint. Set breakpoint on free(). breackpoint not reached.

Found the bug. Inside the macro, some call to a third party library leaking memory each time it malloc'd a string buffer for logging. Fix'd that shit in a heartbeat.

People cheer. Managers praise. Pajeet sysadmins congratulate. 'Thanks for doing the needful, anon'.

Sip some coffee. Browse some dank memes. Keep hitting the job boards ...
>>
>>58714044
Why is everything its own file?
Piece + pawn can be one class with an enum
>>
Anybody has experience working with the odeint library on C++? How do I get started?
Also is Python the easiest language to learn? I certainly think so.
>>
>want to ask for help
>thread is dieing
>>
>>58714291
ask away, i'm here
>>
>>58714218
>Also is Python the easiest language to learn? I certainly think so.
Python will corrupt your mind
>>
File: muy pronto.png (173KB, 1440x900px) Image search: [Google]
muy pronto.png
173KB, 1440x900px
>>58714296
is there anything wrong with my destructor?
>>
>>58714165
Well each piece is gonna have its own methods and checks for if it can move and how.
>>
I'm working with Common Lisp now and so far I have been using CLISP, but I'd like to know if there is anything better? I've looked up LispWorks, but don't know if it is worth it.
>>
>>58714306
Is the destructor defined in the header file? It looks fine to me, but is the first function supposed to be a separate function or a constructor (constructor needs to be Paddle::Paddle with no return type)
>>
File: 1475690639366.jpg (31KB, 635x467px) Image search: [Google]
1475690639366.jpg
31KB, 635x467px
>>58714306
>>
>>58714334
SBCL

pretty sure clisp is not maintained as much and it's also jewish
>>
>>58714306
Not him, but what's wrong is you're not including Paddle.h. The reason your "constructor" doesn't error is because you need it to be Paddle::Paddle, not just Paddle.

I can elaborate on why this occurs/how this works if you want.
>>
>>58714328
literally just a switch
>>
File: muy pronto.png (173KB, 1440x900px) Image search: [Google]
muy pronto.png
173KB, 1440x900px
>>58714359
thanks.

I'm coming from C#

Do I need to call:

SDL_Rect rect;

Paddle(void):
{
rect = new SDL_Rect(0,0, 100,100);
}

how do I get the rect line.
>>
>>58714377
Maybe I should just give up.
>>
>>58714384
cristian, please learn C++ instead of simply attempting to write C# in C++.
>>
>>58714297
>great plotting tool
>good number cruncher
>pretty solid symbolic calculator
Mind elaborating?
>>
>>58714393
I'm trying to learn.

how do I write:
paddle = new Paddle(0,0,100,100);

in C++?
>>
>>58714388
you're just over-engineering, happens to all of us. And java definitely doesn't help.

And 2bh, you could even do it with just one board class.
>>
>>58714403
You can pass parameters to a constructor (given, of course, the function and header agree with it). I would look at the SDL docs for the second half.
>>
new thread: >>58714430
>>
>>58714423
no, what I'm asking is how do I declare a new object in C++ without using new?
>>
>>58714403
>I'm trying to learn.
You're not going to learn by floundering around writing random shit and asking /dpt/ to fix it.
>>
>>58714433
NICE!
>>
>>58714384
You'll want to declare rect inside the class declaration (which is inside the header). Then, from inside Paddle::Paddle, you'll be able to access rect. Also, you don't need (void) as a parameter, you can just use ().

>>58714403
You would do
Paddle paddle(0,0,100,100);
if your paddle is a local variable, or
 Paddle *paddle = new Paddle(0,0,100,100);
if you want to create a pointer to it.
Thread posts: 321
Thread images: 41


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