[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: 335
Thread images: 42

File: dpt.png (12KB, 909x113px) Image search: [Google]
dpt.png
12KB, 909x113px
What are you working on, /g/?


Functional thread: >>58244769
Previous thread: >>58251812
>>
First for bunnies
>>
When will people stop arguing over types
>>
>>58262347
>That image
It's extremely obvious that a redditor wrote that.
>>
Will 2017 finally be the year of a decent C++ alternative emerging?
>>
>>58262347
>image
I think we should make a banner out of that pasta.
>>
>>58262407
>a decent C++ alternative
Literally any other language. Java, PHP, Javascript.

>>58262424
This is a good idea.
>>
Too many languages are being designed that simply repeat the mistakes of the past. A new language should be an improvement, not a step backward. To that end, let's create a list of features that any new language must have. If it doesn't have everything on the list, it ought not to be made.

Here's a starting point:

>Static typing
>Sum and product types, with support for generic programming
>Higher-kinded types
>Higher-rank types
>Totality and purity annotations and checking
>No null
>Type inference
>Tail call optimization
>>
File: 1482600072587.jpg (29KB, 258x360px) Image search: [Google]
1482600072587.jpg
29KB, 258x360px
>people here tell me haskell is a meme and I shouldn't use it
>they dont tell me why it's a meme or why it sucks, instead tell me to learn C
>>
>>58262496
Kill yourself, you retarded frogposter.
>>
how do I learn java? anybody have books or projects or both that they recommend? I work with C++ and learned Java in school, but my dream job requires Java...
>>
>>58262496
Both C and Haskell suck.

Learn a real language like Java and stop wasting your time on meme languages.
>>
>>58262486
>unbounded polymorphic recursion
>type indexed GADTs and constraint kinds
>quotient type constructors, type equality
>isomorphisms, first class cases, bicases
>>
>>58262508
Go to an Indian university.
>>
>>58262508
>but my dream job requires Java...
what kind of a job requires java?
>>
>>58262523
>some kind of inheritance
- n o -

existentials instead
>>
>>58262486
>>58262517
Monoids in the category of endofunctors.
Zygohistomorphic prepromorphisms.
Mother. Fucking. Lenses.
>>
>>58262525
what kind of dream is job
>>
>>58262523
>should provide some solutions to
They should have done it years ago; it's probably too late now. Another useless language with countless man-hours of wasted effort behind it.

Maybe, just fucking maybe, programming language designers should listen to the PLT people instead of deciding "hurr it's all academic nonsense it's not relevant to real programmers" and later wondering why their language isn't working.
>>
File: 1453657295316.jpg (112KB, 1920x1080px) Image search: [Google]
1453657295316.jpg
112KB, 1920x1080px
>>58262543
>Lenses
t r a s h
>>
>>58262525
mlb advanced media
>>
>>58262347
>linking to splitters
kys you're selve
>>
File: browser #113.png (3MB, 1920x1080px) Image search: [Google]
browser #113.png
3MB, 1920x1080px
aw yeah, we styling now. just need to make some things optional and tweak some code.
>>
>>58262563
does it have rank n polymorphic types?
polymorphic components?
>>
What are things like microwaves usually programmed in?
>>
>>58262552
But they're so elegant, look:
type IndexedLensLike i f s t a b = forall p. Indexable i p => p a (f b) -> s -> f t
>>
>>58262607
asm or c
>>
>>58262609
>elegant
>>
File: 1481852295525.jpg (16KB, 480x236px) Image search: [Google]
1481852295525.jpg
16KB, 480x236px
>>58262650
>thatsthejoke.jpg
>>
>>58262676
>>>/global/rules/15
>>
>>58262575
did you just stole the design I stole from Pixiv?
>>
File: Untitled.png (1MB, 960x1040px) Image search: [Google]
Untitled.png
1MB, 960x1040px
>>58262727
yes, much thanks.
I had been meaning to add more text options anyway, and your pics inspired me to start on it.
>>
File: Uw8JpjN.png (23KB, 381x490px) Image search: [Google]
Uw8JpjN.png
23KB, 381x490px
to avoid having a bunch of random code style unrelated stuff in my commits, i saved the large code style refactor for the end when i was done implementing whatever i needed but it feels like it just hides any meaningful history that could have been seen at a glance, like pic related

it's probably fine but does anyone deal with it
>>
>>58262767
the last commits i make to a project are always small miscellaneous tweaks. they don't really fit very nicely together, so taking a look at my project history could probably give someone the impression that my commit habits are scattered and structureless.

the only alternative is to gather them into one commit and tag it 'misc. tweaks', which is a pretty shitty commit message.
>>
The following code keeps failing with "Error reading from datastream"
std::vector<uint8_t> wav_data =
tv_audio_get_wav_data(audio);
SDL_RWops *rw =
SDL_RWFromMem(
wav_data.data(),
wav_data.size());
Mix_Chunk *chunk =
Mix_LoadWAV_RW(rw, 1);
if(chunk == nullptr){
std::cout << Mix_GetError() << std::endl;
}


Any ideas why?
>>
>>58262924
>this is valid C++ code
>>
>>58262924
God damn, that is some awful code formatting.
>>
File: ?.png (7KB, 120x120px) Image search: [Google]
?.png
7KB, 120x120px
how do you know when you're ready to work in a real job related to programming?
>>
>>58262924
Here is tv_audio_get_wave_data
static std::vector<uint8_t> tv_audio_get_wav_data(tv_frame_audio_t *frame){
std::vector<uint8_t> retval;
tv_audio_wave(&retval, "RIFF");
tv_audio_wave(&retval, (uint32_t)frame->get_data().size());
tv_audio_wave(&retval, "WAVE");
tv_audio_wave(&retval, "fmt ");
tv_audio_wave(&retval, (uint32_t)16); // length of data section
tv_audio_wave(&retval, (uint16_t)1); // uncompressed PCM
tv_audio_wave(&retval, (uint16_t)1); // channel count
tv_audio_wave(&retval, (uint32_t)frame->get_sampling_freq());
tv_audio_wave(&retval, (uint32_t)frame->get_sampling_freq()*1*frame->get_bit_depth()/8);
tv_audio_wave(&retval, (uint16_t)(1*frame->get_bit_depth()/8)); // block aligh
tv_audio_wave(&retval, (uint16_t)frame->get_bit_depth());
tv_audio_wave(&retval, "data");
std::vector<uint8_t> frame_data =
frame->get_data();
tv_audio_wave(&retval, (uint32_t)frame_data.size());
retval.insert(
retval.end(),
frame_data.begin(),
frame_data.end());
return retval;
}

"frame" here is just a snippet of raw audio samples with some info about it
>>
>>58262924
C++ is the problem
>>
>>58262959
I want to stick to the 80-col rule, and this code was nested pretty deep. I'll refactor it since it isn't nested as deep
>>
>>58262959
std::vector<uint8_t> wav_data = tv_audio_get_wav_data(audio);
SDL_RWops *rw = SDL_RWFromMem( wav_data.data(),wav_data.size());
Mix_Chunk *chunk = Mix_LoadWAV_RW(rw, 1);
if (chunk == nullptr) {
std::cout << Mix_GetError() << std::endl;
}
>>
>>58262486

>Static typing
Fairly standard for most compiled languages.

>Sum and product types, with support for generic programming
Translated into C++ terms -- tagged unions, structs, and templates.

>Higher-kinded types
>Higher-rank types
I know that one of these is equivalent to template template types, and do not know what the other is.

>Totality and purity annotations and checking
Purity should be optional, ideally.

>No null
This necessarily implies that raw pointers are impossible, and therefore while we will be using a compiled language, it will not be a systems language. Not suitable for replacing C, C++, Rust, or Ada (or D with the garbage collector turned off), it may be suitable for replacing Haskell.

>Type inference
>Tail call optimization
These should be implemented in pretty much every language.
>>
>>58262961
tv_audio_wave just adds the data to the end of the std::vector
>>
>>58262991
>80-col rule
Yeah, that rule only works if you're deliberately avoiding unnecessary nesting.
I prefer to use the soft-80, hard-100 rule:
Try to keep it under 80, but if it hurts readability to split the line there, you can go over. You must not go over 100 at all, though.
>>
File: know.gif (999KB, 250x251px) Image search: [Google]
know.gif
999KB, 250x251px
Is this place exclusively for programming, or do you guys mind if I make some reverse engineering and possibly encryption/decryption questions?
>>
>>58263028
My way is easier to read IMHO
>>
>>58263040
drop it like it's hot
>>
>>58263064
whoops, meant
>>58263012

>>58263040
shoot
>>
>>58263022
A higher rank type is something like

(forall a. a -> b) -> (x,y,z) -> (b,b,b)
>>
>>58263022
>>58263105
The key point being the parametric nature of the parameter. You aren't just passing a "template instantiation", you're passing a parametrically polymorphic function.
>>
>>58263022
>Totality and purity annotations and checking
>Purity should be optional, ideally.
That's what he means.

We assume that he's advocating the same handling of totality and purity in this sentence. Since he's referred to them as annotations, it implies the possibility of the absence of these features. Furthermore, if he were saying that purity should be mandatory, he would also be saying that totality should be mandatory. I do not think he is saying that all new languages should be Turing incomplete. Therefore, he is saying totality is optional via annotation, therefore he is saying purity is optional via annotation.
>>
>>58262486
First class functions
Scheme-like macro system
>>
>>58262961
is tv_audio_wave() appending a null byte to the vector when you pass a string literal to it? Like here:

tv_audio_wave(&retval, "RIFF");

That would fuck the format up.
>>
>>58263199
no, here is the char* code
static void tv_audio_wave(std::vector<uint8_t> *retval, const char *data){
retval->insert(retval->end(), data, data+strlen(data));
}


I will force it to do +4 and not +strlen, since there is no place where it isn't four long
>>
What's your excuse for not being outside enjoying New Year's Eve?
>>
>>58263224
>>58263199
I'm thinking it is an endian mismatch
>>
>>58263270
Today is just an another arbitrary day chosen as reference for what you define as "new year".
>>
>>58263312
So because you have no friends?
>>
>>58262347
That pic also forgot to mention the fucking weebs fighting to see who gets to post their favorite anime picture in the OP
>>
File: 1468266827746.png (297KB, 640x480px) Image search: [Google]
1468266827746.png
297KB, 640x480px
>>58263330
OP here. Sorry I didn't include an anime image.
Here you go
>>
>>58263142
Yes - being able to write something like

total pure Nat factorial(Nat n) = ...


and have the compiler then refuse to compile if it detects that factorial is impure or non-total. You would be able to use them independently, e.g.

total void negate_some_global_somewhere() = ...

pure Nat i_cant_prove_this_terminates_but_it_has_no_side_effects() = ...


or use neither of them:

void do_whatever() = ...
>>
File: insults.png (43KB, 667x778px) Image search: [Google]
insults.png
43KB, 667x778px
Rather lost when it comes to using OpenGL with C++. Using this tutorial (http://www.opengl-tutorial.org/) to learn what I can, but I eventually want to make a snake game.

I think my biggest question is, given a window, how can I read keyboard inputs? Would I have to use cin? Because I want it to be like a regular video game, where the key press registers relatively quickly without needing to press ENTER
>>
>>58263406
You would need another library for keyboard inputs
>>
>>58262960
"Can you program?"
"Ehh... Maybe?"
"Alright you got the job!"

I wouldn't worry too much about this, anon. Just try to work on personal projects to build a personal portfolio, and see how companies react to it.
>>
>>58263406
cin is terrible for on the fly keyboard inputs
If you want to stick to a terminal, use non-canonical mode (a text editor for example).
Since you are making a game, I would opt for SDL_input
>>
File: 20161231_184701.jpg (3MB, 4032x3024px) Image search: [Google]
20161231_184701.jpg
3MB, 4032x3024px
I've been working on this build of RetroPie for ages. I basically shoved a RPi 3 into a PSX and wired the controller ports directly to the Pi's board.

I noticed soon after it was complete that the controllers were throwing random inputs when the RPi was using lots of CPU. Tracked it down to the gamecon driver, and after rewriting half of the PSX related code and adjusting timings, no more random inputs.

Fuck yeah, feels good bruhs.
>>
>>58263441
Fuck you
>>
>>58263430
>>58263417
Thanks, kind anons!
>>
>>58263441
wut
>>
>>58263105

So you're taking a function that turns all of its arguments into something of type b, and a 3-tuple, and the result is a 3-tuple with all of its elements of type b. Presumably the function in the first argument is able to take elements of different data types?
>>
>>58263466
Yes - that's what the forall is for.
>>
>>58263224
>>58263286

Yeah, that's probably it.

Write the vector to a file and open it up in a hex editor. If you see "RIFF" backwards in the hex dump it's an endian problem.
>>
2017 is the Year of Rust; get over it!
>>
>>58263489
No, that isn't it. Using RWFromFile and a test wave file worked, and they have everything in plaintext written like I have it in the calls. I'll look at the numbers in a hex editor to see what comes up
>>
>>58263516
Some people are happy using crippled languages, get over it!
>>
>>58263466
Yes, the point is that normally, even if your function was templated, its PARAMETERS (per instance) would be monomorphic. E.g. it would take a std::function<int(float)>;

But here, you can take TEMPLATED functions (and other parametric) as parameters.
So here it's like

template <typename X, typename Y>
std::tuple< X,Y,X,Y>
myFunction(template <typename a> std::function<std::pair<a,a>(a)>, std::pair<X,Y>);

If you think of one SPECIFIC instance, e.g. X = Int, Y = String

std::tuple<Int,String,Int,String>
myFunction(template <typename a> std::function<std::pair<a,a>(a)>,
std::pair<Int,String>);

our parameter is still templated/polymorphic
because of this we know we could call that parameter on BOTH of the members of our pair, e.g.
it's not just been reduced to an (int -> (int,int)) or a (string -> (string, string)), it is LITERALLY an (forall a. (a -> (a, a)))

You can sort of do this in C++, but it's not actually type safe.
>>
>>58263406
http://www.glfw.org/
>>
Hey guys,

I spend a lot of time practicing practice algorithms problems for job searching, but oftentimes I legitimately don't understand the solutions and can't really see how to come up with it myself.

What do you do in those situations in order to "learn" the problem even when you really dont understand it?

Or rather, what do you do to understand solutions that are really unintuitive to you?
>>
>>58263555
By not actually type safe, I mean it will follow the regular C++ convention

>instantiate template
>does it have this operator for int? yes?
>does it have it for string? no? fail

a sort of dynamic static typing (in the sense that errors are being deferred)
and you get these errors that occur when the template is instantiated, but don't occur inside the actual function that makes wrong assumptions

while in Haskell, there is no reason to assume that any arbitrary type can be called with an int and with a string.
so something like

template <typename T>
auto func(T f) { return f(3); }


is valid C++, but not valid Haskell
>>
>>58263555
>C++
>not actually type safe
Quelle surprise.
>>
>>58263555

Ah, so where higher kinded types take a type constructor (templated type) and produce another type, a higher ranked type takes a function constructor (templated function) as an argument, producing another function?
>>
Can you show me how to do monad transformers in C#?
>>
>>58263224
Surely this should be giving you some compiler warnings? You're passing in things like uint32_t for "data". What do you think strlen(uint32_t) is going to give you?
>>
>>58263489
Turns out I never supplied it any bit depth info
>>
>>58263629
Those are defined as separate functions. I would have used templates, but the documentation I was reading said something about different endians for different types of data
>>
>>58263580
An useful way to learn how to solve problems is to thing of the basic building blocks of the problem, it's properties and how they relate.

I'm supposing you don't have a STEM background right? It's something you can learn by writing proofs.

Books that may help you are:
Calc I - Tom Apostol
A transition to advanced mathematics - Smith, Eggen(requires calculus)
Any introductory book in algebra(not linear algebra)
Some book about linear algebra
Some book about mathematical logic
>>
>>58263612
Something like that

A higher ranked type can take polymorphic types as arguments.

So the main difference is that we can re-use that same function with different types, because we KNOW it has a polymorphic type.

Another thing Haskell allows is PolymorphicComponents, which means that you can store polymorphic types.
>>
>>58263637
Ah, ok. Headers can be annoying to get right sometimes.
>>
>>58263686
>implying that was the only problem
it still doesn't work, same error. It has to be some endian junk or something
>>
>>58263670
>tfw Im a cs major

I dont have problems "coding," or thinking about some problems, but a lot of algorithms problems that someone should prepare for job interviews can give me trouble.

I think I just need to spend more time at it and try to work through something more carefully when I dont get it.

Thanks for the recommendations. I havent done / taken calc in awhile and its something id like to do again.
>>
>>58263682

I see. I don't tend to find a use for that level of polymorphism, but I will try to remember it in the future.
>>
>>58263711
Alright. Just use this

http://soundfile.sapp.org/doc/WaveFormat/

and a hex editor, you'll be fine
>>
>>58263757
The main use for the former would be that in Haskell you can have infinite polymorphic recursion, i.e.

data Fix f = FixConstructor (f (Fix f))


Given a functor, e.g. [] (list)
and omitting the constructor name (FixConstructor)

Fix [] = [Fix []] = [[Fix []]] = [[[Fix []]]]
etc, to infinity. So you end up with the infinite type
[[[[[[[[[[[[[[[[[[[[[[[[...]]]]]]]]]]]]]]]]]]]]]]]
i.e. a list of lists of lists of lists ...
>>
>>58263802
That problem never really comes up in C#.
>>
>>58263068
>>58263073
I'm trying to figure out how a certain defunct online game dealt with its files and cache. Here's what I know.

For any file that needs to be used by the game but isn't in its cache folder, it requests and gets the (unencrypted?) file from the server. They're all simple files, generally a texture in gif format with a seemingly proprietary mesh file appended at the end, or just another simple proprietary file. What's important to me is that they're not encrypted until they're received by the game, because they might be a clue as to what the game does.

These files are saved in the cache folder encrypted, with a file size bigger than the original, and a seemingly random name so you can't figure out what became what at a first glance. Unfortunately I'm pretty sure it's not just the original file with a xor/not applied, so I am clueless as to how to proceed. I decided to turn my head to reverse engineering, as It might be easier to just look at a specific area of the assembly code than try to crack some encryption, right? It's actually just as confusing, since I end up having to explore lots of assembly code. They're not exactly easy to sift through.

I could use some directions. What should I look for in encryptions? Or in disassemblies? Any alternative ways to tackle this?
>>
>>58263580
hackerrank DOT com
either the tests pass or they dont.
>>
>>58262496
They don't want competition for their $300,000 full-time Haskell jobs.
>>
>>58263802

I'm not sure if I'd ever need that, to be honest.
>>
>>58263802
>>58263839
>>58263962
It's very niche, but rank-n types and polymorphic components are a lot less niche.
>>
>>58263996
I can honestly say I've never needed either of those things when using C#. Or monads.
>>
>>58264061
Not yet grasshopper
>>
>>58262515
>real language


like ruby?
>>
And really, if I wanted arrays of arrays of arrays of ... in Ruby, I might implement something like this:

class Object
def array_wrap
[self]
end

def multi_send message, n, *args
result = self
n.times { result = result.send message, *args }
result
end
end

4.multi_send :array_wrap, 5 # => [[[[[4]]]]]


It won't allow infinite depth, since there's no lazy evaluation in my solution, but I probably don't need it to truly be infinite.
>>
are video games programming
>>
>>58264144

Are you developing video games?
>>
>>58264144
a huge portion of it
>>
File: 1482604421182.jpg (94KB, 499x542px) Image search: [Google]
1482604421182.jpg
94KB, 499x542px
>>58262515
>real language like Java
>>
>>58264121
No, the magic is that it is lists all the way down.
All it is is the infinite nesting of lists.
No room for ints or actual elements.

So you end up with properties that come from the structure itself - i.e. you can have an empty list, or a cons list.

Pretty sure [[...]] is sort of like a tree without values.

Similarly if you take the optional type, then you nest it, then you end up with

Maybe (Maybe (Maybe (Maybe (Maybe ...

which can be
Nothing
or Just (Nothing
or Just (Just Nothing

but if you think of Nothing as Z
and Just as S

Z
S Z
S (S Z)
this is an encoding of the natural numbers
>>
>>58264172
The most difficult part of making a good video game is game design which does not require programming skills, albeit logical structured thinking.
There are millions of programmers who can implement a good idea, but it's hard to come up with something original.
>>
>>58264184
Why not just make an explicit type?

data Nat = Zero | Succ Nat
>>
>>58264184

Yes, but if it's an infinite list of lists of lists, what would be the purpose of this value? What would you use it for?

>>58264189

Ideally, that's what business majors are for. They come up with ideas to try and pawn off on the public, while we tell them why it's impossible to implement. Then they come up with another, similar idea, we implement it, and they pay us for our time.

Programmers should not be made to be the ideas guy. That's someone else's job.
>>
you wouldn't program a video game
>>
8, 13, 14]}
[11, 2]
{'s': [2, 3, 5, 6, 8, 11, 12, 14], 'h': [3, 5, 7, 9, 10, 13], 'c': [2, 4, 5, 6, 8, 12, 13, 14], 'd': [7, 8, 13, 14]}
[8, 5]
{'s': [2, 3, 5, 6, 8, 11, 12, 14], 'h': [3, 5, 7, 9, 10, 13], 'c': [2, 4, 6, 8, 12, 13, 14], 'd': [7, 13, 14]}
[8, 7]
{'s': [2, 3, 5, 6, 8, 11, 12, 14], 'h': [3, 5, 7, 9, 10, 13], 'c': [2, 4, 6, 12, 13, 14], 'd': [13, 14]}
[8, 10]
{'s': [2, 3, 5, 6, 11, 12, 14], 'h': [3, 5, 7, 9, 13], 'c': [2, 4, 6, 12, 13, 14], 'd': [13, 14]}
[13, 14]
{'s': [2, 3, 5, 6, 11, 12], 'h': [3, 5, 7, 9], 'c': [2, 4, 6, 12, 13, 14], 'd': [13, 14]}
[11, 5]
{'s': [2, 3, 5, 6, 12], 'h': [3, 7, 9], 'c': [2, 4, 6, 12, 13, 14], 'd': [13, 14]}
[7, 3]
{'s': [2, 3, 5, 6, 12], 'h': [9], 'c': [2, 4, 6, 12, 13, 14], 'd': [13, 14]}
[13, 4]
{'s': [2, 3, 5, 6, 12], 'c': [2, 6, 12, 13, 14], 'd': [14]}
[5, 12]
{'s': [2, 3, 6, 12], 'c': [2, 6, 13, 14]}
[6, 2]
{'s': [3, 6, 12], 'c': [2, 13, 14]}
[6, 3]
{'s': [12], 'c': [2, 13, 14]}
[14, 2]
{'c': [13]}
{}


took me WAY too long to figure out how to deal out an entire deck of cards. i'm such a noob.
>>
>>58264218
With the other encoding they become distinct types. This'll be obvious in an example I'm about to give

>>58264184
data WeirdType a = Han a (WeirdType [a]) | Solo a

this is a very strage example, but if you look, WeirdType takes two forms
1) Han a (WeirdType [a])
2) Solo a

If you imagine a is our "element type"

In the first case, we have an a, but then we actually have our WeirdType again, but with the parameter instead being [a].
So our second element in the Han constructor instead contains a WeirdType of LISTS of a.

In the second case, we only have a single item of a.

x :: WeirdType Int
x = Han 3 (Han [1..3] (Solo [[1..3], [4..6], [7..9]]))


So if you look, first we have an Int
Han 3 ...
then a [Int]
Han [1..3] ...
then a [[Int]]
Solo [[1..3], [4..6], [7..9]]

So if we want to nest further, we have to store a list of our previous type.


>>58264255
it's pretty mathematical
>>
File: wampvoip.png (14KB, 961x1054px) Image search: [Google]
wampvoip.png
14KB, 961x1054px
I'm still working on my protocol, on new year's eve.
>>
File: 1483131407584.png (1MB, 1200x1198px) Image search: [Google]
1483131407584.png
1MB, 1200x1198px
>>58264061
You'll get there one day.
>>
>>58262347
Please guys acknowledge my successful meme.

>>58264121
You are not a real woman and will never be.
>>
>>58264346
You've got it the wrong way around, Ruby pretends to be a man.
>>
>>58264328
and this creates a strange kind of list:
(a, [a], [[a]], [[[a]]], ... )
>>
>>58264328
What's the use of reusing List for this instead of making a distinct type, though?
>>
File: 1482586276695.png (3MB, 2048x1714px) Image search: [Google]
1482586276695.png
3MB, 2048x1714px
>Zygohistomorphic prepromorphisms

>Used when you really need both semi-mutual recursion and history and to repeatedly apply a natural transformation as you get deeper into the functor. Zygo implements semi-mutual recursion like a zygomorphism. Para gives you access to your result à la paramorphism.
>>
Made a little minesweeper game in python with tkinter. It's alright and everything but when it's initializing the board it takes so fucking long I can grab a screenshot like the left here. Probably takes about 1-2 seconds to fill in 25x25 squares which isn't that many..
Anyone know how to improve this?
>>
>>58264351
Everyone here is actually a woman pretending to be a man, some of who want to be a woman. Our dear Ruby is the last.
>>
File: tumblr_n1gnoiWyBx1rw701fo1_1280.png (379KB, 850x951px) Image search: [Google]
tumblr_n1gnoiWyBx1rw701fo1_1280.png
379KB, 850x951px
>>58264189
Free ideas giveaway!
-agar.io with black holes
-online conway game of life
-shoot'em up with time travel
-drawing contest (short games where a player out of 3 chose the subject and the winner)
-just make another online game where the rules change in real time according to genetic programming

annnd I forgot others ( O~O)
>>
>>58264255
>Yes, but if it's an infinite list of lists of lists, what would be the purpose of this value? What would you use it for?
Infinitely recursive datatypes are useful for things like fixpoint combinators, for one.
>>
File: 1475313715476.png (34KB, 811x473px) Image search: [Google]
1475313715476.png
34KB, 811x473px
>>58264392
forgot pic, shit.
>>
>>58264189
i'm trying to develop a framework for making games (not an entire engine, necessarily) and it's driving me up a fucking wall

trying to follow data-oriented principles to make it as fast as possible, utilizing multiple threads, i.e. one to iterate through all components of the system in contiguous memory and another to pass messages from clusters of objects, etc.

unfortunately i'm just not a good enough programmer to make everything fit together. i've got some code written but its all disconnected and nonfunctional so far. i'm missing that last piece to tie every system together. if i was doing this in standard lazy OOP i would have been done with my game by now probably. wew lad
>>
>>58264392
>>58264410
>Anyone know how to improve this?
Don't use Python.
>>
>>58264359
What do you mean?
It's just an example.
If we instead make that a parameter

data WeirdType f a = Han a (WeirdType (f a)) | Solo a


Our old type becomes (WeirdType []) and we can create new weird types like (WeirdType Maybe) or (WeirdType ((,) Int))

Another example would be this, based on something I saw on stack overflow

data Tree f a = Leaf a | Node (Tree f (f a)) a (Tree f (f a))

This is like your regular binary tree - except that the f modifies your element type as you descend!
So for instance, Tree [] would be single elements at the top, lists on the first level, lists of lists on the second, etc etc.
>>
>>58264411
Ron Gilbert, creator of Maniac Mansion, advices game programmers to aim for quick results instead of perfecting abstract frameworks.
A custom code base for each game.

You can distill abstraction out of the finished game, instead of the other way round.
>>
File: polymorphic recursive tree.png (11KB, 674x558px) Image search: [Google]
polymorphic recursive tree.png
11KB, 674x558px
>>58264437
With the example.
>>
>>58264457
Whoops, that middle one should have two children
>>
>>58264424
Damn, I thought that might be it :(
>>
def deal():
l = []
for i in suites:
if len(dictionary[i]) == 0:
del dictionary[i]
suites.remove(i)

a = random.choice(suites)
first = dictionary[a]
x = random.choice(first)
print(x)
first.remove(x)
print(dictionary)
for i in range(52):
deal()


took me an hour to get this ;-;
>>
>>58264325

>her
You obviously don't respect me that well.

>>58264396

>agar.io with black holes
Or just agar.io without Facebook integration/accounts and the ability to join arbitrary servers. You know, like it was when it first came out. That alone would be worth playing.
>>
>>58264478
To be honest, you could almost certainly get it to run at a decent speed. Post your code.
>>
File: polymorphic recursive tree.png (17KB, 1152x642px) Image search: [Google]
polymorphic recursive tree.png
17KB, 1152x642px
>>58264457
>>58264467
fixed
>>
>>58262347
Please acknowledge the fact that my advanced shit posting was used in the OP.
I'm very very happy.
>>
>>58264498
Ruby, we don't care that you're female. We won't treat your contributions any differently because of it. You know more about useless programming languages than anyone else here, including OSGTP and nv.
>>
>>58264556
That explains why he and OSGTP don't want to learn Haskell.
It's too useful.
>>
>>58264567
>she
FTFY
>>
>>58264498
>discrediting a post because something popular was mentioned
Senpai, the rules are quite interesting from a game design point of view. You don't even have to use PajeetScript. I'm allowing you to use your favorite language. Which is... Haskell, is that right?
>>
>>58264571
there are no girls on teh internet
>>
>>58264580
>Ruby's favorite language
>Ruby's
>Ruby
>>
>>58264571
thanks
>>
>>58264556
OSGTP is an idiot.

>>58264580
Don't be silly, he likes Ruby.
>>
>>58264535
>it's still wrong
fml
>>
>>58264580

I'm not discrediting the post, I'm merely suggesting that if Anon bother copying agar.io, that they bother copying an earlier version, rather than the fucked up version that it is now.

And no, favorite language is not Haskell. I don't even use Haskell. I use Ruby for scripts and C++ for anything that needs performance or low level shit.

>>58264556

I am fairly sure there are quite a few Anons that know more about useless langs than me.
>>
>>58264328
>it's pretty mathematical
Translation: it's completely useless but I still get to feel like an elitist for knowing about it.
>>
>>58264652
You should learn more useless languages, Ruby.

The whole point of Computation Theory is to explore different approaches to the process.
Contrary to popular belief, languages are not just tools; they are modes of thought.
>>
>>58264664
Yeah sure, I mean ALL of computer science and every programming language can almost entirely thank mathematics for basically everything, but this one mathematical idea is definitely useless because lol, mathematics
>>
>>58264677
Just read the post before you. I think it's pretty relevant.
>>
File: art.png (43KB, 673x461px) Image search: [Google]
art.png
43KB, 673x461px
I made a simple .gif decoder in >Java
>>
>>58262347
>What are you working on, /g/?
nothing, because I am fucking depresse, you stupid cunt.
>>
>>58264703
Aren't you at least happy the OP image contains your trollpasta?
>>
>>58264507
https://github.com/ayy1337/minesweeper
>>
>>58264391
it's a meme not even haskell oldfags could demonstrate a valid real world use for it
>>
>>58264709
I didn't even read it.
>>
>>58264755
You do realise that it's a joke, right?
>>
>>58264799
haskell? yes
>>
>HaskLEL is useless and, pure functional and stateless languages are a meme
>Lisp is only used for third class text editors
>SICP is not a good book and this is why it's given away for free
>Anime is shit
>Maki a slut
>C++ is much better than C
>Java is the language of the future
>JS is a good choice for server side
>The best software engineers are indians
>>
>>58264834
ahahahahaha holy shit that one really made me laugh
>>
>>58263022
not true. you don't need the concept of a null pointer to use pointers.
also, product types are not structs. they're tuples. a labelled tuple is more analogous to a struct, and these are done in a variety of ways. for example, row polymorphic types allows for labelled rows within the type for each piece of data in the struct. another solution (which Haskell uses) is having functions over something stored (more or less) as a tuple internally -- a record type T that contains f :: Float and s :: String is really syntactic sugar for a function f :: T -> Float and s :: T -> String. instead of t.f and t.s, you write f t and s T (because f and s are functions from a struct to one of its elements).
on paper, this second solution is like a fancy product type, however languages with row polymorphic record types don't have anything like C++ structs. as an example,
{x : Int, y : Int | a}
is assumed to be the type Int x Int if you think of it in terms of product types. However, the remainder of the type is polymorphic, so really all you can say is ∃T.IntxIntxT (in this case, T could be two more Int labels or even the unit type, which means there's no other info in the record).
>>58262607
JAVA EMBEDDDD EDITION POWERS MILLIONS OF DEVICES WORLDWIDE, SUCH AS SMART CARDS AND MICROWAVES
>>
>>58264670

What it comes down to it, the purpose of a programming language it to produce a computer program. You can come up with a billion levels of abstraction to hide it, but every last program is ultimately equivalent to an impure, procedural program. This program is ugly as sin, and not as easy for humans to understand, but it's the only thing a computer can understand. Because this program is ugly as sin though, many of us tend to not think about it much when designing our programs in higher level languages. And I think this is a mistake, really. We put all of our trust into a program written by other humans to magically transform our highly abstracted programs into efficient machine-understandable programs. It is not always easy to do this, and increasingly, it seems that the cost of higher abstractions may be the cost of lower performance. We seem to think that computers can get faster forever, and so many of us have no desire to make our programs faster. And when our programs inevitably are slower than our expectations, we will always find a way to blame something else. It was that goddamn JavaScript framework. It was Windows' fault. AMD CPUs are shit.

But the problem is in us. A programming language is just a tool for making programs, just as a pencil is a tool for writing letters, and we musn't forget the limitations of the paper we are writing on.
>>
>>58264926
What about lisp machines?
>>
File: polymorphic recursive tree.png (11KB, 968x424px) Image search: [Google]
polymorphic recursive tree.png
11KB, 968x424px
ok, here is the fixed fixed image

each level you go down, the node label becomes a list of whatever it was before
>>
>>58262369
>been shooting pests the last week
>see cute bunny and can only feel an overwhelming desire to skin it.
They're just a bad as rats.
>>
>>58264987
so the first level of the tree is an int, the second level a list of ints, the third level a list of list of ints, etc
>>
>>58264916

>not true. you don't need the concept of a null pointer to use pointers.
The concept of a null pointer is not necessarily a language construct but a construct of the process' environment. A process is given a virtual address space, and 0 is mapped to an invalid page, so if it is dereferenced, the process will crash with a segmentation fault. If you cannot have null pointers, then you cannot have a pointer with a value of 0. Therefore, it is not possible to store any old value in a pointer. You thus do not have raw pointers at all, but some sort of restricted pointers, like references or smart pointers.

>also, product types are not structs. they're tuples.
You have a variable that stores multiple values, each in a different memory address. Call it what you want, it's a struct.
>>
>>58264978

Lisp machines are dead. Long live x86.
>>
I'm too sick to work (major headaches and feeling dizzy, doc says I should rest/lay down and die).
Where can I casually absorb information on neural networks and other AI tech? Not the basics. Not some CS paper. Ideally just people presenting their research through talks or podcasts.
>>
>>58264997
You're a horrible person. Bunnies are wonderful. If they nibble all your crops it's your fault for not growing more.
>>
>>58265016
How about they go grow their own damned crops if they're so wonderful.
>>
>>58265029
They produce hops.
>>
>>58265029

They don't have hands
>>
Looking to learn GUI development in C#.

I have prior experience in Java using AWT/JavaFX and I have never used C# before.

Where do I start and does anyone have any recommendations for books, tutorials, posts, or videos to get me started?

I do -not- want to use any visual designer, I prefer to write my interfaces in code.
>>
>>58265042
Invent prosthetics?
You're just being lenient on them because they look cute.
>>58265038
I chuckled.
>>
File: booke.png (22KB, 804x743px) Image search: [Google]
booke.png
22KB, 804x743px
>>58265062

>I prefer to write my interfaces in code.
>>
>>58265075
>frogposting in 2017
>>
File: guard.gif (87KB, 600x437px) Image search: [Google]
guard.gif
87KB, 600x437px
>>58265088
>>
>>58265075
It's a bit autistic, I know, but I have an easier time with it compared to this FXML garbage that Oracle is trying to push on us.
>>
>>58265062
>write my interfaces in code
Well there's not much to learn then.
Make a .net application, Google the UI elements you need (or look them up in a designer, easier) and get working.
>>
File: HappyMaskWojak.jpg (94KB, 601x508px) Image search: [Google]
HappyMaskWojak.jpg
94KB, 601x508px
>>58265014
>Lisp machines are dead.
>>
>>58265062

http://zetcode.com/gui/csharpwinforms/firststeps/
>>
>>58265095
>.gif
>not animated
>>
>>58265075
It's a perfectly valid approach. A bit unnecessary for trivial applications though.
>>58265062
Since they're all OOP. They do translate rather well from one to another.
>>
>>58265114

Following along with this now, seems pretty-close to what I'm used to at the moment.

>>58265101
>>58265135

Good to know that there isn't a massive amount to learn then. I'm getting a bit sick of writing in Java and this seemed like a good change.

Thanks
>>
>>58265004
yes, you could have the type restrict your pointer x > 1. If you really needed NULL you could just use an external function to create it.
>>
>>58265198
type NullablePtr a = Maybe (Ptr a)
>>
>>58265172
>getting sick of Java
>learning C#
You'll never leave hell, ever.
>>
>>58265210
I believe that.

The switch is mainly to get away from the piss-poor default look and feel of Java GUIs since it takes a lot of guess work to get anything looking half-presentable. Try creating a CSS style-sheet for a JavaFX application and come back to me in a few hours when you get fed-up with their piss-poor documentation for it.
>>
>>58264507
pls respond senpai
>>
>>58265198

And maybe you're working in a freestanding environment, and you need to overwrite the interrupt vector table, which in our hypothetical architecture, starts at address 0. Regular old raw pointers do this job fair enough, because pointers are just integers with a dereference operation, and different semantics for addition and subtraction.

I somewhat like Rust. It does most things pretty high level, but when you need to do something weird, you can take the safety gloves off and shoot yourself in the foot as much as you like.
>>
File: cyclic list.png (21KB, 577x368px) Image search: [Google]
cyclic list.png
21KB, 577x368px
Can your language do this?
Is there a use for this?

NO
>>
>>58265309
for anyone wondering
A list that contains an int, followed by a string, followed by a bool, followed by a double, etc.
Only that sequence is allowed. (But it can start from any of them)
>>
>>58265285
>I somewhat like Rust
Get out.
>>
>>58265342
Could make an object that mimics that behavior pretty easily in any OOP language...
>>
I'm a girl. Pls give me (You)s.
>>
>>58265369
>object that mimics
It's type safe
>>
>>58265374
Fuck (You).
>>
>>58265347

What don't you like about Rust, Anon?
>>
>>58265342
>Haskell can solve problems that using Haskell creates

It's like LISPfags bragging about macros.
>>
>>58265435
What are you talking about?
It's a solution for a problem nobody has.
It's not a Haskell problem
>>
>>58265456
>It's not a Haskell problem
Strong static typing is a Haskell problem, though it is not exclusive to Haskell.
>>
>>58264922 ( that guy whose thread died probably because of a mega link )

i can't honestly get this to run in any of my browsers

/shrugs/

the values for your positions seem inaccurate. most 3d games / etc don't use algorithms to compute this, but rather 'magic numbers' which are static and pre-computed, which is maybe what you are asking.

i'm drunk and don't really use webgl so i can't really understand if vertex values are supposed to be that way, but with bigger numbers ie: 30 instead of [ -1, 0, 1 ] or 28.82094, you might have better workings.

i think the problem maybe is you have to pre-compute the ideal hedron positions beforehand and not just assume you can assign them numbers and have it work out that way.
>>
File: 1429042807715.jpg (91KB, 786x581px) Image search: [Google]
1429042807715.jpg
91KB, 786x581px
>>58263875
>it requests and gets the (unencrypted?) file from the server
Use wireshark to see what comes in and cross reference that with the the GIF format. What game is it?

>>58264396
I have a few good ideas, not all of them are video games strictly.
Decentralized first person shooter game, no upper limits on players, map is completely giant, nothing too complex, multiple games can happen (stored as a 16-bit number at the protocol level?) or use 0 for the global game. This one is the coolest IMHO (even though I don't play video games).

Conway's game of life in multiple dimensions, along with a detector for cool little phenomena. Hoard all of the cool information and post about it on here

Something like no mans land, except all planet names and cool information is guided by a deterministic algorithm

>>58265014
>long live x86
>implying ARM isn't the superior architecture
>>
>>58265435
>>58265456
Basically it's a list, except the elements have to be a certain sequence of types, e.g.

Int - String - Bool - Double - [Int - String ..
You can start from wherever and terminate wherever.


>>58265462
Strong static typing isn't a problem.
Everyone agreed many years ago that it's the right way to program.
>>
For new years I challenge you all to make a useful program in my interpreted language.
https://github.com/salvadorp2001/64LMC
>>
File: Consensus-Field.jpg (354KB, 799x666px) Image search: [Google]
Consensus-Field.jpg
354KB, 799x666px
>>58265482
>Everyone agreed many years ago that it's the right way to program.
>>
>>58265497
It's not my problem that you didn't get the memo.
But you should really learn what you're talking about before you start trying to talk about it.
>>
Finally set up my old gitscrub set up, so now I can contribute to all your guys' shitty projects. :^)
>>
>>58265510
Okay kiddo
>>
>>58265497
That image perfectly describes OOP.
>>
>>58264692
Can it do animation?
>>
>>58265521
Glad you understand.
Now please go back to your thread >>>/g/wdg
>>
>>58265567
Nah
>>
>>58265580
It's not a question of "nah", nobody is asking you.
You aren't welcome here.
You're just annoying everyone.
We aren't here to adapt to fit you
>>
>>58265588
Okay let me think about it

Nah
>>
>>58265519
I don't want any of your racemixing microcuckery touching any of my code.
>>
>>58265601
Oh, I get it.
You're under 18.
>>
>>58265606

very rude.
>>
>>58265611
GTP, rate my data structure >>58265309
>>
>>58265611
Hi there!

You seem to have made a bit of a mis take in your post. Luckily, the users of 4chan are always willing to help you clear this problem right up! You appear to have used a tripcode when posting, but your identity has nothing at all to do with the conversation! Whoops! You should always remember to stop using your tripcode when the thread it was used for is gone, unless another one is started! Posting with a tripcode when it isn't necessary is poor form. You should always try to post anonymously, unless your identity is absolutely vital to the post that you're making!

Now, there's no need to thank me - I'm just doing my bit to help you get used to the anonymous image-board culture!
>>
>>58265627
That pasta is more autistic than tripfags themselves.
>>
>>58265634
That's because newfags have normalised reddit culture
>>
>>58265618
>>58265627
I would have had no idea that poster was using a trip if you hadn't brought it up.

Why can't you fucks see that you're just as big a problem as they are?
>>
>>58265618

I'm not sure I see a use case.
>>
>>58265643
>I am blind, how dare you point out out problems in the community that I have not seen!

>>58265652
I don't either
>>
File: images.jpg (8KB, 181x279px) Image search: [Google]
images.jpg
8KB, 181x279px
>>58262347
always with this project, thanks for the anon who helped me with the strings. it works now.

so this is a simple http server (tcp sockets) with c. that send the requested html/text files to the client which is a browser in this case.

but now, the browser can request to execute a file, so when i see that the file wanted is executable or is script (bash for example), i shoulf fork a child, and that child executes the file with exec or system, but what's required in the project is that somehow the script sends his own response to the client !

what the actual fuck ? can a shell script write into a socket if i give it the file descriptor of the socket ?
or i should print the result of the execution into a file, then send that file when the child terminates ?
>>
>>58265661
Without the undue attention posters give to them, trips are nothing.
>>
>>58265342
Well you can make a linked list that links to a doubleNode which links to an intNode etc.
Id imagine that works in most languages.
It's a bit more tricky to get an array backed list to work like this though. This is certainly a very clean solution for this very unlikely problem.
>>
>>58265662
>the browser can request to execute a file
Jesus, talk about a security hole. You should consider whether you actually want this.
>can a shell script write into a socket if i give it the file descriptor of the socket?
Just rediriect stdout to the socket or some shit.
>should print the result of the execution into a file, then send that file when the child terminates?
Also valid.
>>
>>58265688
it's not array backed
also you're right, but that's not even OOP
>>
File: 1483042407061.gif (4MB, 422x418px) Image search: [Google]
1483042407061.gif
4MB, 422x418px
>>58265482
>Strong static typing isn't a problem.
>Everyone agreed many years ago that it's the right way to program.
>>
>>58265482

Honestly, it makes more sense to just make a struct of bool, int, double, and string, and make a list of that struct.

>>58265495

I am not sure if I could make a useful program in this rather limited language. I might be able to make a compiler for it for funzies though, which would be making a useless program in a useful language!
>>
>>58265721
>Honestly, it makes more sense to just make a struct of bool, int, double, and string, and make a list of that struct.
That's not the same though!
You can't stop in the middle, you can't start at an arbitrary point
>>
>>58265705
>rediriect stdout to the socket
mah nigga, this is so shrewd, i totally forgot dup().
>>
>>58265472
>Use wireshark to see what comes in and cross reference that with the the GIF format. What game is it?

That's exactly what I did. The unencrypted data comes in (gif), goes through whatever the game does to it, and comes out encrypted on its cache folder. Here's an example: https://a.pomf.cat/clzjlm.zip with the .dat file being the output.

The game is an old (2005) and short-lived wizgate bomberman game.
>>
>>58265721
I've been trying to make a code-cross-compiler for it (what's it called when you compile between two languages?) for some days now but I can't get the hang of it.
>>
>>58265497
What's the problem with having predicable types?
For a good system you put a type specifier in one place. Or it may even be implicitly typed in which case it's like a language with weak typing except you can get type errors at compile time.

The major complaints I hear from weak typists is that you have to write what type you have everywhere (pun and double entendre intended). But it's really not the case. It's just that a lot of languages happen to decide you have to do that. It's not required.
>>
>>58265754
>what's it called when you compile between two languages?
A transpiler.
>>
>>58265707
I'm not the guy who said anything about oop. I hate oop.
>>
>>58265762
Dynamic typing users are ACTUALLY too stupid to understand even the most basic typing rules.
That's the only possible reason at this point.
>>
I'm learning java through some YouTube videos as a beginner rn. Any suggestions for books or other places to learn?
>>
>>58265784
well then you were right about just being able to have a series of node types
>>
>>58265800
Yeah. I get your comment, we agree. I just didn't want someone to accidentally think an OOP user formed a coherent thought.
>>
>>58265721

That was about to be my solution for that 'in my language'. If you can do operator overloading, you can even do it such that indexes work correctly.
>>
>>58265736

If you really need to have stopping in the middle and starting at arbitrary points, you could have some sort of integer field added on top to denote which of the fields are "active"
>>
File: 1453656893900.png (1021KB, 870x717px) Image search: [Google]
1453656893900.png
1021KB, 870x717px
>>58265857
>require there to be uninitialised fields
>fuck with ownership and reference semantics
>>
>>58262407
I think it would be cool if y'all invented a computer language of emojis, and the information could be stacked,. The data that make up the emojis would be the base , the emojis strings could be layer 2 of the language and then the final layer of information would be the unique wave form of the entire data package,. When you scroll the screen down really fast and tilt your head,. All those sentences and where they skip
Down to the next line of typing,
That fast scroll wave that it makes could also be a source of info transference
<I thinks it be cool)
>>
>>58265875

It's not our fault that our languages aren't expressive enough.
>>
>>58264392
>>58264410
>>58264714
Anyone?
>>
>>58265754

Language A -> Language B = Transpiler. Or just call it a compiler in general, since we can consider bytecode and machine code to be languages of some sort.

Cross compiler is where the target computer does not match the host computer (i.e. compiling for ARM Linux from x86-64 Windows)

>>58265875

You can initialize the fields, just don't use them. Use a default value.

If there seems to be too much overhead for manipulating it, wrap all of that shit in method calls.
>>
>>58265915
>You can initialize the fields, just don't use them. Use a default value.
>If there seems to be too much overhead for manipulating it, wrap all of that shit in method calls.
all of this is the problem
what if it's some resource type?
>>
>>58265905
Where are you getting the random data from? In POSIX, /dev/random blocks because the data isn't random enough. Use /dev/urandom (or, better yet, use a nonblocking random function)
>>
>>58265785
It looks that way. But that'd be really boring. Nobody likes a solved problem.
>>
>>58265921

I have yet to see an actual use case for this to begin with.
>>
Best intro to haskell YouTube guide?
I'm too lazy to do anything but look and listen.
>>
>>58265949
Maybe in some kind of streaming situation

>>58265955
>youtube
there are none
use the wikibook
>>
>>58265927
I don't think that would be slowing it down; when I was just printing the board on terminal it wasn't slow at all.
>>
>>58265975
>Why is this useful?
>Maybe in some kind of streaming application
>Maybe

>>58265979
Printing the board on the terminal isn't using any random function (hopefully)
>>
>>58266004
>Printing the board on the terminal isn't using any random function (hopefully)
Actually nor is drawing them on the window; all the random calls occur after that's done.
>>
>>58266018
Is the slow part when it gets random numbers?
>>
>>58266042
No the slow part is when it's initialising all the boxes and drawing them to the window. No random calls are happening here.
>>
>>58264670
Yes yes yes. . . Thank you. ... And my opinion is If y'all look at it as Art ,rather than language , I think y'all could make something so cool. . . (I tried to share my idea with you all, but I think the eye in the sky thought it needed to be deleted
>>
>>58266052
oh, by initializing I thought you meant generating. I can't help you on drawing the board.
>>
>>58266042
for i in range(size+2):
self.boardboxes.append([])
for p in range(size+2):
self.boardboxes[i].append(mbox(i,p,self.window)) #this is slow part; where the boxes are drawn
#distributing bombs
bombs = 0
self.bombs = []
while bombs < (size*size)/7:
row = randint(0,size-1) #random calls happen after all the boxes are drawn, assigning bombs to random boxes
col = randint(0,size-1)
if self.boardboxes[row+1][col+1].value != 'b':
self.boardboxes[row+1][col+1].value = 'b'
self.bombs.append(self.boardboxes[row+1][col+1])
bombs += 1
>>
I'm giving my panties away. Tell me what you want me to do with them and post your address. I'll send them for (You).
>>
>>58266182
>>>/soc/
>>
>>58265975

I think if I was going to be streaming data, I'd like to be consistent about the order of data sent/received.
>>
>>58266195
Holy fuck someone make this dude CTO of IEEE
>>
>>58266195
depends on the type of stream
if it's live stream, i probably wouldn't care much about data order
>>
I have an awesome terrible idea for a distributed imageboard!

Instead of doing like nntpchan and have a decentralized moderation, what if we had a large scale neural network (under the hood kind of like ethereum but with less security and checking) where this artificial intelligence would be our sole moderator, and our God.

Who's with me?

If you say it's retarded I'll just keep posting anime images until the frog ratio is low enough.
>>
>>58266233
/b/ will probably teach it to legalize CP in this site so it's not good
>>
>>58266233
>distributed anything
>sweet now all our users are legally liable for hosting it, despite having no control over what is posted
top kek
>>
>>58262575
I would totally use this. Wanna share source? Is the tooltip the first few posts?
>>
>>58266233
What is this neural network trained on. What are the technical details of this project.

You can't just say "NEURAL NETWORK" and expect to get support.
>>
>>58266182
pics of panties? what kind of panties are they

not that i'm giving out my address tho
>>
>>58266291
Well, encryption can be helpful
>>
>>58266303
That is true.

>>58266233
Check FreeNet, doesn't have moderation and no one is liable.
>>
>>58266313
>what kind of panties are they
They are very diverse. Do you have anything in mind?
>>
>>58266232

I suppose, but even with protocols that can work out of order, it helps to have consistent packet structures. If you want a list of (int, bool, double, string), it makes little sense to mix around the order of the individual elements, or to skip one of the elements. Although mixing around the order that each of the tuples is sent may be more reasonable, so long as they can be put back together in the right order.
>>
>>58266348
r u a dude?
>>
>>58266348
i like most panties, i probably prefer shape panties and shiny stretchy panties, lace/mesh can be nice too
>>
making a poker engine but i'm a succ

['d', 6, 'h', 9]
['s', 6, 'h', 2]
['c', 3, 'h', 8, 's', 9, 'd', 8, 's', 10]
>>
File: Untitled.png (94KB, 1440x860px) Image search: [Google]
Untitled.png
94KB, 1440x860px
>>58262347
>What are you working on, /g/?
Porting
>>
>>58266291
My decentralized Tv system solves this in a few ways
>keep data locally, only relay when queried
>RSA crypto
>route everything over multiple threads
>>
>>58263580
look into the philosophy of it or maybe find a scaled version of the same problem.
>>
>>58266442
Threads of tor circuits, not cpu threads
>>
>>58266442
Listen kiddo, i bet you couldnt decode a base64 from a binary string. I know all of the encodings and encryptions from the back of my hand. I could send you a virus right now and make your puter that your mommy bought you go byebye. See my display name? Yep, I'm in anonymous. I'm the leader actually. I've ran multiple operations on hidden deepdarknet mIRCs and could onion route your null ping from icmp using tracer-t to dox the site you're currently on. I'm currently telneting your http client ports to send to my kali linux, where I have access to a range of tools, which I'll use each one to slowly dissect your ip address until it becomes 0, you'll be ddos'd for an entire lifetime.
>>
>>58266303
I don't know... it would suck even if the initial data came from the reports of every users. Since /b/ blacpblabla. So the idea is to have the networks teach each other just like humans do. I'm not sure if this could be feasible but there is no reason to dismiss the idea nor proof that it's actually impossible.

>>58266341
Anon I'm not this retarded. Well... Actually...

Also is moderation a necessity?
>>
File: me-btw.jpg (394KB, 1270x947px) Image search: [Google]
me-btw.jpg
394KB, 1270x947px
>>58266373
>r u a dude?
I can be whatever you want babe.

>>58266400
Pic related is my favorite, what do you think?
>>
File: 1480116496573.jpg (95KB, 850x850px) Image search: [Google]
1480116496573.jpg
95KB, 850x850px
>>58266451
>HUR DUH
The post.
>>
>>58266474
https://www.youtube.com/watch?v=uq-v1TTUyhM
>>
Should I use UINT8_MAX or 255?
>>
I made a transpiler from my language to C++. It could use some polish though. If some of you are that bored on new year's, I'll gladly accept patches.
https://github.com/salvadorp2001/64LMC
>>
>>58263682
So, a higher ranked type is something like what the gallois theory describes?

I'm still not grasping it fully as I've only just started researching more on haskell. Could you maybe point me to some literature or maybe an example for use in one of the C-typed languages?
>>
File: 1407905937240.jpg (23KB, 500x375px) Image search: [Google]
1407905937240.jpg
23KB, 500x375px
>>58266481
>Should I use <descriptive constant> or <magic number>?
I don't know.
>>
>>58266462
>Also is moderation a necessity?
If no one is liable, not much, it is good to prevent shit posting. See 4chan for example, without moderation it wouldn't have the high content quality it's known for. You said you would add moderation, i just wanted to inform you.
>>
>>58266493
UINT8_MAX is never not going to be 255, and 255 is much easier to type out.
>>
>>58266473
they look really nice

there is more variation in terms of the material with panties like pic related, so i tend to buy more of them, but i like lace a lot too
>>
>>58266506
>UINT8_MAX is never not going to be 255
So? It's still way more descriptive.
>255 is much easier to type out
Do you use single-letter variable name exclusively as well?
>>
>>58266483
>salvador
>it's from Uruguay
Wew, that's ironic.
>>
Anybody working on C# projects?
>>
hey guys just learning git how do I push the code to production?
>>
>>58266517
Learning about unit testing in CuteSharp right now.
>>
>>58266512
What brands do you like?
My favorites are Agent Provocateur and Adore Me, /fa/ memed me.
>>
>>58266517
I miss C#.

I had an internship where I had to write server monitoring software in C# comfy as heck
>>
>>58266483
>C++
Could you have picked both a worse target language and implementation language?
>>
>>58264359
Not him and I'm sure you're going to get a vague and magnanimous response but I'm thinking you could probably use this kind of thing to create segfaults and the like for the many different types and different possible types. Only a super computer would ever use them all in its typing over the existing low order values, if you catch my drift.
>>
>>58266487
// Representation of a polymorphic function
trait Forall[F[_]] {
def apply[A]: F[A]
}

// Function that takes a polymorphic function from A to List[A] and returns an Int
def foo(f: Forall[List]): Int = ???
>>
>>58264402
So would that be good for like p2p connections in real time?
>>
>>58266515
I got a lot of that in elementary school.

>>58266537
It doesn't really use a lot of C++, it's mostly because I can't into C file IO.
>>
New thread:
>>58266570
>>58266570
>>58266570
>>
>>58266532
i'm not too picky with brands, even some budget/literallywho brands can have some nice ones, but the fancy/expensive brands like triumph, primadonna, maidenform/flexees, miss mary, scandale, miraclesuit and others have a lot of good stuff, but i don't pay the retail price (some of this is 50-100+ dollars a piece), i get them on places like ebay, but ebay usually isn't that great imo (maybe if international shipping was cheaper it would be better for me), not sure what alternatives to ebay you have where you live
>>
File: 55974453_p0_master1200.jpg (124KB, 467x467px) Image search: [Google]
55974453_p0_master1200.jpg
124KB, 467x467px
>>58266498
Yeah I can agree with that. Without moderators the community will be average after a short time (which is retarded relative to us). A neural network could be impractical since it might delete posts when unable to understand including... "genius posting".
It can't be helped. I'll just kill myself.
>>
>>58266620
>not sure what alternatives to ebay you have where you live
Use your local ebay. Only buy things that have already being legally imported somehow.
>>
>>58266576
This thread was shit, so I delete it.
Someone else can make a new one.
>>
>>58266576
>404
>>
>>58266653
yeah the local ebay or equivalent site is the best
>>
File: 1483244884505.jpg (148KB, 563x712px) Image search: [Google]
1483244884505.jpg
148KB, 563x712px
>>58266660
Too bad I really liked the image. Beautiful drawing.
>>
>>58266666
Please don't reproduce
I met many retarded people in my years on this site but you easily made it into the top 10 with this

You actually don't understand shit, so please let me give you this one advice, and please take it:
You are horribly stupid and it hurts, don't ever try to spread the shit you believe to know about anything ever again.

Now please try to think about the shit you're telling us here for at least 5 minutes and maybe you find the giant flaws in your logic all by yourself.
No one is here to give you private lessons. Maybe google "How was Facebook monetarised?".
If you still don't get it then, just kill yourself
>>
>>58266679
lolwut
>>
NEW THREAD

>>58266684
>>58266684
>>58266684
>>
>>58266679
You can count on me for memeing this until the multiverse collapse!

>>58266685
Not as good as linguistic but basically, kys.
>>
>>58266666
quints

>>58266653
I meant illegally.
>>
>>58266689
Nah
>>
>>58266626
I think it would not be that bad if it was only one site. Like just a image board. FreeNet didn't get off because being so wide makes it painfully slow.
It could use a web of trust to assign ip addresses to each post. So it would be easy to filter shit posting.
>>
>>58266556
Yeah that's in code and essentially they're taking apples and returning chemicals but I'm wondering if maybe you understand the pragma and can find this same construct in the mathematical basis.

Your code reminds me of Legend of Zelda A Link to The Past when link looks in the mirror and get sent to the Dark World except that we don't yet have the Moon Pearl so we keep getting sent back to code.

It kind of reminds me of a lens. I figure these higher ranked types will be where we find the new main in the quantum typed languages and will act like the main manifold?
>>
>>58266233
How would you make the neural network learn what's bad posts and what's good posts? Up votes and down votes?
I like the idea of neural networks for moderation. It's not like mods here are that much better than random selection. And mods elsewhere often have their own agendas.

I'd be more interested in a topic selector bot. The board grows in thread number based on users online and their interests. It then builds a tree dynamically based on interests and figures out by googling what's the 'hot stuff' people want to talk about. It then creates threads for those topics if there's enough interest for it and poster retention would be an indication of success.

It might just be pure shit like canv.as (iirc) but with discussion instead. But it's at least interesting.

Users would have to list their interests in some way and the neural network tries to make their interests more specific and tries to figure out their alignment (in dpt for instance it'd try to label me as an procedural programmer).

Once you've gone that far filtering off topic isn't that hard. Rules aren't that difficult to enforce because the bot knows the users sort of intimately. Though gauging reactions is still a problem. Presumably a toxic users participation would lower the amount of time people spend in the topic.

NN is so interesting but it's hard to get good training data. So generating it seems like the only good choice.
>>
>>58266514
With 255 you're expressing the conscious limit you already have in your brain-cache (since you're already conscious of the limit when you decide to use the number). You don't have this arbitrary label for the number 255. Practically nobody thinks 'INT_MAX' internally. You think about the maximum value of an int conceptually.
In the case of int its too big to accurately type out so the label helps. 255 is well know among most programmers, is a small number and is short in characters.

Single character variables are good but only when you can intuitively feel what they are in context.
Like calling the first number of your number averaging function a and the second b.
They don't describe anything but being in sequence but they're short enough to not clutter like a longer name might.
That's an extreme case obviously. 'First' and 'second', 'number1' and 'number2' work just as well.

Man I listened to this one talk on cognition and analogies and it was so spot on its bothering me.
>>
>>58266481
in what situation?
>>
>>58267072
this
>>
>>58265662
is it
lol
tomoko
Thread posts: 335
Thread images: 42


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