[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread:

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 322
Thread images: 36

File: thank_you_for_posting_anime.png (2KB, 453x116px) Image search: [Google]
thank_you_for_posting_anime.png
2KB, 453x116px
What are you working on, /g/?
Previous thread:
>>60982367
>>
>>60990139
Why are most scripting languages dynamically typed?
Pure lazyness or are their creators mentally disabled?
>>
File: 1494028898807.png (85KB, 600x600px) Image search: [Google]
1494028898807.png
85KB, 600x600px
>>60990139
Looking through the boring parts of my language
>>
>>60990317
>Looking through the boring parts of my language
tell us more
>>
I have a personal project from I've been working on for a few years. I'd now like to release it on github

... except the name of the project, the comments, the filenames, the commit messages, are not just politically incorrect for special snowflakes but possibly career-ending.

Is there any way I can automatically find and manually replace all offensive contents in all the 1100 commits? Natural language processing? Dank recurrent neural networks magic?

>>60990317
make them cuter
also post an example of your language
>>
>Go to university
>graduate with CS degree with emphasis on software engineering
>get job as junior dev for company
>learn shit ton more about software engineering than I ever did in school

College is a fucking scam.
>>
>>60990139
Could /g/ show me an example of recursively making user like user1 user2 etc in a bash script where the starting number is inputted by the user?
>>
>>60990744
except employers know that you are, at least, able to hold a 3 year commitment, more or less

now, US college, yes that's a scam since first world countries' tuition is dozens of times less expensive
>>
>>60990808
this sounds like the shittiest assignment ever
>>
File: newestthonk.gif (2MB, 139x157px) Image search: [Google]
newestthonk.gif
2MB, 139x157px
More voronoi tinkering.
>>
>>60990843
It is
>>
>>60990821
or, in some cases, totally free

>hur, not free cuz u pay them taxes
you pay taxea AND mensality, only pay taxes so fuck off

also, what you learn in college is basically what you put in, if you only study for exams, yea, you wont learn shit, but if you spend your time going after something on your own interest, you will learn.
>>
>>60990897
Then the exams need to cover more stuff for the degree to be worth anything
>>
>>60990717
you really screwed yourself on that one, huh?
>>
>not posting an anime image just to be a rebel and edgy
act like an adult OP
>>
How to improve this /g/
>>
File: ok_jerry.png (2KB, 360x239px) Image search: [Google]
ok_jerry.png
2KB, 360x239px
>>60991104
Here, have an anime image. Purely symbolic, of course.
>>
>>60991217
what are you trying to do?
>>
>>60991217
use another language
>>
>>60991245
Plot a sine
>>
>>60991104
>wanting OP to post an anime image just to be a weeb, degenerate and pedo
act like an adult anon
>>
>>60991217
nvm I just screwed up the resolution
>>
>>60991324
>falling for the degeneracy meme
learn to think for yourself anon
>>
Anyone know where I can get some basic tutorials on I/O kit driver development? I don't want to go too in-deoth like Apple's reference since I'll just be porting a small linux driver to macOS.
>>
>>60991442
It's true, though. I proved it through eternal self-torture by watching garbage animuh and came to the conclusion that it was made for reality denying aloma snackbars and closet traps like you.
>>
>>60991490
>closet
but i am not in the closet :3

>self-torture
so you watched it? and you wanna say you hate it, silly self hating weeb :P
>>
>>60991543
>so you watched it? and you wanna say you hate it, silly self hating weeb :P
Purely for science, of course.
>>
If I wanted to get my company onto Lisp what would be the appropriate dialect?
They all seem kinda clunky and unpolished
>>
File: tc without data fetches.png (236KB, 1498x864px) Image search: [Google]
tc without data fetches.png
236KB, 1498x864px
mov rdi, [mind]
call blow
>>
>>60991629
Clojure or Common Lisp
>>
>>60991629
>They all seem kinda clunky and unpolished
They are. After all, they don't bother with the fine details of syntax or semantics.
>>
>>60991686
that said common lisp is probably the best choice of all miserable choices
>>
>>60991629
Clojure, the rest are in the maintenance mode.
>>
File: 1491257618019.jpg (57KB, 542x698px) Image search: [Google]
1491257618019.jpg
57KB, 542x698px
>mfw WinAPI
>>
Should I use C, C++ or java for desktop programs on linux? Or something else?
>>
>>60991715
Qt
>>
>>60991715
Depends.
>>
>>60991744
I just want to learn how to make GUIs.
>>
File: netrunner s.png (91KB, 1356x300px) Image search: [Google]
netrunner s.png
91KB, 1356x300px
>>60990139
We are making a web browser >>60984652
>>
>>60991795
Not-making, looks more like.
>>
>>60991772
Still depends on how much performance you need. PyQt seems pretty popular if you don't mind the big dependencies, (t)tk isn't too uncommon, it's definitely smaller than Qt and you can use it with most common languages (I use it in small-ish per script for example - but if you need speed, you can use it from C), of course there's gtk, which may be still the most common one on linux (though I haven't tried it; some people say it's a clusterfuck).
>>
>>60991676
Can someone explain please?
>>
File: WE.jpg (36KB, 450x251px) Image search: [Google]
WE.jpg
36KB, 450x251px
Working on the other side now, but its software is a lot more convoluted. I can't just sample the input because the receiver is putting out noise all the time, so I need to make sure the timings are right or reset the data buffer.

void send(uint8_t data)
{
const uint16_t T2 = 400;
const uint16_t T = 200;

set(TXPIN);

uint8_t i;

for(i = 0X80; i; i >>= 1)
{
if(data & i)
{
clr(TXPIN);
_wait_us(T);

set(TXPIN);
_wait_us(T);
}
else
{
set(TXPIN);
_wait_us(T);

clr(TXPIN);
_wait_us(T);
}
}

set(TXPIN);
}
>>
>>60992240

http://www.atmel.com/images/atmel-9164-manchester-coding-basics_application-note.pdf

And the decoder side

I still have a lot of TODOs here

ISR(PCINT2_vect)
{
diff = TCNT1 - timer;

if(bits == 8)
return;

if(q == 1 && in_range(T2,diff))
{
data |= (PIND & PD0);

timer = TCNT1;
q++;
bits++;
}
else if(q == 2)
{
if(in_range(T,diff))
{
timer = TCNT1;
q++;
}
else if(in_range(T2,diff))
{
data <<= 1;
data |= (!(PIND & PD0));
bits++;
}
}
else if(q == 3 && in_range(T,diff))
{
data <<= 1;
data |= (PIND & PD0);
q = 2;
bits++;
}
else
{
q = 1;
bits = 0;
data = 0;
timer = TCNT1;
}
}
>>
>>60991795
Shill when you have committed a single new line of code. [spoiler]So never post again[/spoiler]
>>
>>60991772
>>60992098
>some people say it's a clusterfuck
I tried once and didn't like it and find it's a clusterfuck. I have played with Qt and it's quite easy to understand and achieve something with it, like swing library in Java. (I was doing Qt with C++, not python btw)
>>
>>60990717
rm -rf .git
then delete all comments and change the project name
>>
File: 1466086847922.webm (214KB, 900x456px) Image search: [Google]
1466086847922.webm
214KB, 900x456px
>>
>>60990139
Who's the retard making these threads before the bump limit and not linking it?
>>
write a mathematical proof that programs are proofs
>>
>>60990139
Finally settled on an implementation of Functional Directed Acyclic Graph that allows me to describe it with clarity. Rewrote my instruction analyzer in it and extended it to be able to determine whether a 'mov' instruction is a load, store, load immediate, store immediate, reg to reg, etc.

Here are the top twenty instructions used in Ubuntu 16.04's bash executable:
mov (reg) 11.13%
mov (ld) 11.08%
call 8.56%
mov (imm) 7.24%
test 6.51%
je 6.37%
cmp 5.35%
jmp 5.07%
nop 4.90%
mov (st) 4.44%
xor 3.89%
jne 3.64%
pop 3.32%
add 2.79%
mov (sti) 2.64%
push 2.58%
lea 2.42%
sub 1.47%
ret 1.35%
and 0.85%
or 0.49%
jle 0.49%
xchg 0.38%
jbe 0.27%
ja 0.23%
>>
File: govnocode.webm (924KB, 600x336px) Image search: [Google]
govnocode.webm
924KB, 600x336px
>>
>>60993359
>he doesn't know what `isomorthism` means
>>
>>60993359
define proof
define program
>>
>>60993421
#define PROOF
#define PROGRAM
>>
File: 1496053981871.jpg (25KB, 390x478px) Image search: [Google]
1496053981871.jpg
25KB, 390x478px
use std::collections::{LinkedList, VecDeque};
use std::iter::FromIterator;

fn is_symmetric<I, T>(it: I) -> bool
where
T: PartialEq,
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
{
let mut it = it.into_iter();
while let (Some(l), Some(r)) = (it.next(), it.next_back()) {
if l != r {
return false;
}
}
true
}

fn main() {
let asym_odd = vec![5, -1, 1, 2, 3, 4, 5];
let asym_even = [1, 2, 3, 4];
let sym_even = LinkedList::from_iter(vec!['a', 'b', 'b', 'a']);
let sym_odd = {
let mut t = VecDeque::from_iter(vec![1.0, 2.0]);
t.push_front(0.0);
t.push_front(1.0);
t.push_front(2.0);
t
};

assert!(is_symmetric(&sym_even));
assert!(is_symmetric(&sym_odd));
assert!(!is_symmetric(&asym_even));
assert!(!is_symmetric(&asym_odd));
}
>>
>>60993637
akari is cute
>>
>>60993637
dumb akariposter
>>
>>60993637
Polymorphic code is aesthetic.
>>
File: really_implores_you_to_ponder.png (147KB, 231x361px) Image search: [Google]
really_implores_you_to_ponder.png
147KB, 231x361px
>>60993637
>>
>>60993404
Each node in the DAG performs a function, either filtering, transforming, or statefully collecting. This allows me to describe a data processing network to run multiple analyses on a dataset at once. No need to cache or do multiple passes over the data. Each disassembly dump isn't very large, but imagine if I run this over the concatenation of several program's dumps.

I hope this is easy to follow if you know what is going on. '>>' obviously means that the operations occur sequentially. '+' means to concatenate the data streams. Input for the DAG is fed into the input node, and the output is collected at the output node, which in this case is a Reduce node.

def make_x86_count_processor():

# input node
input = Input()

# extract only assembly lines
assembly_re = re.compile(r'^\s*[0-9a-fA-F]+:\s+([^<#]*)')
assembly_only =\
input >>\
Map(lambda x: re.search(assembly_re, x)) >>\
Filter(lambda x: x is not None) >>\
Map(lambda x: x.group(1).strip().lower())

# separate out mov instructions
mov_split_re = re.compile(r'(^mov[a-z]*)\s+(.*),(.*)')
search =\
assembly_only >>\
Map(lambda x: (re.search(mov_split_re, x), x))

# deal with movs
movs =\
search >>\
Filter(lambda x: x[0] is not None) >>\
Map(lambda x: mov_mode(x[0].group(1), x[0].group(2), x[0].group(3)))

# deal with not movs
instruction_re = re.compile(r'^[a-z]+')
not_movs =\
search >>\
Filter(lambda x: x[0] is None) >>\
Map(lambda x: re.search(instruction_re, x[1])) >>\
Filter(lambda x: x is not None) >>\
Map(lambda x: x.group(0))

instructions = movs + not_movs

# count instances each instruction
def inc_count(counter, value):
counter[value] += 1
return counter
counts = instructions >> Reduce(inc_count, init=Counter())

return input, counts
>>
>>60993806
Is >> actually a thing in Python or is this just pseudocode?
>>
File: 1495556343692.png (177KB, 424x335px) Image search: [Google]
1495556343692.png
177KB, 424x335px
>>60993678
[/code#![feature(slice_patterns, advanced_slice_patterns)]

fn is_symmetric<T: PartialOrd>(arr: &[T]) -> bool {
match *arr {
[] | [_] => true,
[ref l, ref inner.., ref r] if l == r => is_symmetric(inner),
_ => false,
}
}

fn main() {
let asym_odd = vec![5, -1, 1, 2, 3, 4, 5];
let asym_even = [1, 2, 3, 4];
let sym_even = vec!['a', 'b', 'b', 'a'];
let sym_odd = vec![2.0, 1.0, 2.0];

assert!(is_symmetric(&sym_even));
assert!(is_symmetric(&sym_odd));
assert!(!is_symmetric(&asym_even));
assert!(!is_symmetric(&asym_odd));
}
]
>>
File: 1497646647001.png (516KB, 1100x800px) Image search: [Google]
1497646647001.png
516KB, 1100x800px
Rewriting IDA Pro in Rust.
>>
Why should I stop using OOP languages?

I want to learn Haskell for the sake of being a better programer, but I don't really see why Functional programming is any better than OOP.
>>
>>60994003
Will it not cost a gorillion dollars?
>>
How do I find where a specific static or shared library is at runtime in C/C++?
>>
>>60994181
You start by removing C and installing a non shit language.
>>
>>60994197
>You start by removing C
But then I can no longer use literally any OS.
>>
Use Kotlin faggots.
>>
File: buhscuseme.png (106KB, 595x358px) Image search: [Google]
buhscuseme.png
106KB, 595x358px
>>60994205
>using an OS
>not using a freestanding implementation of IRB
>ishiggydiggy
>>
>>60994323
no
>>
>>60994111
It's not so much that object oriented languages are necessarily bad, but the design methodology of object oriented programming (or any other up front design methodology) doesn't work. If you use a language that makes it easy to write your code first and abstract later, you'll have a good time. Haskell is a language that definitely prioritizes this. Another thing - object oriented languages tend to lack useful and cutting edge features that functional languages thrive on.
>>
>>60994392
>write your code first and abstract later
this is a bad strategy
>>
>>60994422
No, it's not. Approach software design like a compression algorithm - only abstract when you see duplication.

API design for in development software that others are still supposed to be able to use is a different thing, so we don't go down that tangent again.
>>
>>60994449
>Approach software design like a compression algorithm - only abstract when you see duplication
this is also a bad strategy
>API design for in development software that others are still supposed to be able to use is a different thing
if this is not what we are talking about then we are not talking about real programming
>>
>>60994449
>API design for in development software that others are still supposed to be able to use is a different thing, so we don't go down that tangent again.
And actually, now that I think about it, the same technique works here, as long as you don't delete abstractions when they are superceded (except with major version changes or whatever).
>>
>>60994467
Elaborate and/or fuck off with your No True Scotsman bullshit.
>>
>>60994392
>>60994422
>OOP methodology doesn't work
>The functional approach is a bad strategy

Here we get into "what's better for me" arguing. Generally, I agree with the philosophy of functional programming simply because looking at things 'top-down' and so forth is less for me to think about.

Yet the argument that one language is any better than the other based on human fallacy is extremely subjective.

What reason do people have to say that functional programming 'is the future of programming'? What objective advantages does it have to a system with side effects?
>>
What I do next
0-4 IO Interrupts
5-9 ADC
>>
>>60994486
>What objective advantages does it have to a system with side effects?
Ability of the programmer to quickly reason, ability for the compiler to aggressively optimize, etc.
>>
>>60994486
You can have FP with side effects, but purity or managed purity is better
>>
>>60994468
>the same technique works here
it basically doesn't
if you try to do things this way when writing code cooperatively then the people you are cooperating with get mad
and if you try to do things this way when not writing code cooperatively then on one hand it will work well but on the other hand you are then not really writing code
>>
>>60994508
*managed effects
>>
File: bucket-of-crabs.jpg (84KB, 400x334px) Image search: [Google]
bucket-of-crabs.jpg
84KB, 400x334px
>>60994513
>if you try to do things this way when writing code cooperatively then the people you are cooperating with get mad
>>
>>60994483
>No True Scotsman
but it's true though, no real programmer programs alone, whether for others or not
if you do this then you are a giant child playing with toys
only teams actually do adult work and accomplish things, and teams have to agree on everything constantly
>>
>>60994541
>bucket-of-crabs.jpg
>>
>>60994513
>>60994546
I don't know about you but I don't consider code monkeying around with retarded CS grads "real programming".
>>
>>60994502
Ability of the programmer to quickly forgot that this variable is also modified on another file, and introduce bugs
Ability for the compiler to deal with references everywhere instead of just caching results.
>>
>>60994568
you can call it whatever you want but it's literally the only "real programming" there is, and if it's not the kind of programming you do, you don't know what sacrifice is
you get to EITHER be a unique and intelligent individual and do everything the clever and perfect way OR create and improve on things that actually meaningfully help people and are respectable achievements
there's no overlap
>>
>>60994608
I should stop teaching people about this software design methodology because not enough people know about it already? Makes sense retard.
>>
>>60993554
what ARE proof and program though?
null?
>>
>>60990302
Isn't one of the defining traits of a scripting language to be lazy?
>>
>>60990717
>>60993159
Is the only correct answer. Also consider not being a retard next time lol
>>
>>60994625
>not enough people know about it already
That's not the issue. The issue is that the design methodology you preach only works well for personal projects and resources for public use, and when you're cooperating with a tightly knit team--which is the only scenario where you actually deserve to call yourself a programmer--it just pisses everyone off. In other words, the issue isn't that your design methodology isn't well known enough to work on a cooperative scale, the issue is that it doesn't work on a cooperative scale whether people know what they're doing or not.
>>
>>60994467
You really think you can make a perfect structure and then code without changing it ?

The cycle "implement feature -> refactor " is what works best. No over-engineered architecture, no conception of modules that will never be implemented.
>>
>>60990139
Godbless image.
>>
>>60990865
Could someone explain what this is?

>>60991715
JavaFX or C++ Qt
>>
>>60994679
>You really think you can make a perfect structure and then code without changing it ?
Whoever said anything about never changing it? That's beyond the scope of the question. API should come first, and then implementation, because that's the way it needs to be if you're working with other people, and you should be working with other people or else you're a neet. That doesn't mean API can't come again later, no one ever even said anything about that.
>The cycle "implement feature -> refactor " is what works best.
Not for teams. And for the umpteenth time, if we're not talking about teams, we're not talking about programming.
>>
>>60994673
>it pisses everyone off
I'd be much more pissed off if I wrote my code to someone else's interface only to learn that they fucked up and need to change the interface. If I write my code to their implementation and follow their compression scheme, there's no chance of this happening.
>>
>>60994648
idk, he just said to define them
>>
>>60994712
>API should come first, and then implementation, because that's the way it needs to be if you're working with other people, and you should be working with other people or else you're a neet.
How does it feel to be a corporate cuck that accepts everything you're told?
>>
>>60994719
>If I write my code to their implementation and follow their compression scheme, there's no chance of this happening.
And then they'll need to change the implementation and your code will break. Which I guarantee unconditionally, because implementations change much more routinely than interfaces. That's the whole point of an interface.
>>
>>60994743
>How does it feel to be a corporate cuck that accepts everything you're told?
If you work for a corporation, you're just as much not a real programmer as if you don't work on teams.
>>
>>60994743
>working on a project with your bros
>not the most fun
srsly dude
>>
https://www.youtube.com/watch?v=g5IVDpne5MQ
Just watching old demos while rewriting my tokenizer to just wrap boost::spirit.
>>
>>60994763
>And then they'll need to change the implementation and your code will break.
Only if you're not doing proper compression. Change only breaks things when there's duplication. And I already stated earlier that old abstractions aren't deleted, so you don't need to change any of that either. In fact, there's nothing someone else can do that will break your code UNLESS you did it wrong in the first place. Getting rid of the concept of ownership of code and allowing anyone to do their own compression is part of the key to success.

>>60994793
They're not really bros if they refuse to do something differently just because it's different, though, are they?
>>
>>60993985
operator overloading.
>>
>>60994826
>compression
This is an interface.
>Change only breaks things when there's duplication.
Which there isn't if and only if there's an interface.
>And I already stated earlier that old abstractions aren't deleted, so you don't need to change any of that either.
Code bloat.
>In fact, there's nothing someone else can do that will break your code UNLESS you did it wrong in the first place.
Oh so you mean like OOP then. Cool.
>Getting rid of the concept of ownership of code and allowing anyone to do their own compression is part of the key to success.
That doesn't follow from anything you just said in any way. Compression needs to happen, there's no question of that, but when compression happens through FP, it's scattered all over the place. Compression through OOP is much more organized.
>>
>>60994712
>API should come first, and then implementation
In practice, the implementation tends to raise problems missed at conception time, and so it forces the API to change.
For the team, nothing changes: if it's the creation of a module, then the team will wait the first implementation anyway. If it's a refactoring/rewrite, the dev should make sure the transition is done correctly, by replacing old API in one time.

>Not for teams. And for the umpteenth time, if we're not talking about teams, we're not talking about programming.
I think everyone agree on that
>>
>>60994878
>This is an interface.
Created after the fact.
>Code bloat.
If it's being used, it's not bloat.
>That doesn't follow from anything you just said in any way.
So? It was just a thought that popped into my head at that time.
>scattered vs. organized
I'm not talking objects vs. functions, I'm talking about implementation coming before interfaces.
>>
>>60994913
>Created after the fact.
Which is a problem if you work on a team, because that means before it's created, you have to write to each other's implementations because there's not yet an interface.
>If it's being used, it's not bloat.
If it's a different way to do the same thing, it shouldn't be being used.
>I'm not talking objects vs. functions, I'm talking about implementation coming before interfaces.
moving goalpost
>>
>>60990717
Plenty of projects that move onto git don't preserve their commit history.
Probably because doing that would hinder development.
>>
>>60994972
>Which is a problem if you work on a team, because that means before it's created, you have to write to each other's implementations because there's not yet an interface.
The whole point is that this isn't a bad thing.
>If it's a different way to do the same thing, it shouldn't be being used.
This "philosophy" just leads to more breaking changes. Code bloat isn't a problem until release, then the whole team can work together on trimming things down more.
>moving goalpost
Read the very first post more closely.
>>
>>60994972
>moving goalpost
He's not though
>>
>>60990302
>pure lazy
Haskell

>>60991715
idris
>>
>>60994991
>The whole point is that this isn't a bad thing.
It is though. It's worse than having to write to each other's interfaces because there's not yet an implementation. There's less to change when the interface then changes due to implementation flaws than there would be otherwise.
>This "philosophy" just leads to more breaking changes.
You are from Mars.
>>
>>60991715
C++
>>
>>60994111
>>60994467
>>60994679
>>60994892
>>60994913
>>60994991
>API
I'll just put this here:
https://youtu.be/ZQ5_u8Lgvyk
People generally don't know how to design apis and its a very good guide to architecting the system.
>>
>>60995019
>It is though. It's worse than having to write to each other's interfaces because there's not yet an implementation. There's less to change when the interface then changes due to implementation flaws than there would be otherwise.
If you write to the implementation and ensure there's no duplication, you never have to update things in more than one place unless that's exactly what needs to happen (because it was all wrong in the first place).

>You are from Mars.
I said to not get rid of old abstractions because then you don't have breaking changes, and you implied that preventing code bloat is more important, but that leads to breaking changes because you're deleting old abstractions.
>>
I'm trying to make a script that downloads music from bandcamp by exploiting the "Inspect Element -> Network" trick

My question is: How do I automate/script getting the 'request' URL so I can open it in a new tab and save it?
Pic Related
>>
>>60995149
just use curl
>>
So /dpt/, I've spent the last 12 hours rewriting my Android player framework to Kotlin. The language is...
SHIT. Java is a bad language, but Kotlin manages to surpass that. Consider the following examples:
// example 1
(0..4).forEach { println(it) }
// example 2
(4..0).forEach { println(it) }

Obviously, example 1 prints 0, 1, 2, 3. So example two prints 4, 3, 2, 1, right? WRONG! The .. operator only works if lhs is higher than rhs. Apparently you have to write
 (4 downTo 0).forEach { println(it) }
to make it work.
Putin stole the | and & bitwise operators from Kotlin, so you have to use 'or' and 'and'. They also serve as a logical operator depending on the type of the primitive.
Checked exceptions are no longer checked at compile time. This makes it a joy to interop with Java code, NOT!
Finally, the null safety hoax is just as retarded as the borrow checker in Rust.
All the Medium blog posts praising Kotlin never used it in production. They only highlight best case scenarios. Who would've thought...
>>
File: Whew.jpg (37KB, 458x523px) Image search: [Google]
Whew.jpg
37KB, 458x523px
>>60994494
>mfw already finished
Fuck it I will test it tomorrow
>>
>>60994149
No, it's Free as in Freedom Software.
https://github.com/das-labor/panopticon
>>
>>60994702

It's voronoi with moving regions, and those frames then packed into a gif.
>>
>>60995670
Oh nice, I remember someone talking about this a while ago. I'd definitely use it if it reaches IDA Pro levels
>>
File: 1465950690966.png (225KB, 470x496px) Image search: [Google]
1465950690966.png
225KB, 470x496px
>>60995431
>Finally, the null safety hoax is just as retarded as the borrow checker in Rust.
>>
>>60995194
I'm reading the "everything curl" pdf, and it sounds like something I'm going to use more often, but it seems like I still need the Request URL to download the song.
Any ideas on how to get the request URL?
>>
>>60995431
>They only highlight best case scenarios. Who would've thought...
I don't know how people still fall for the new cutting edge language meme in 2017. It's not like most of the code artisans mastered any other language.
>>
>>60995813
All the links are on the page anon.
>>
>>60995694
And a Voronoi Diagram is defined as
> a Voronoi diagram is a partitioning of a plane into regions based on distance to points in a specific subset of the plane. That set of points (called seeds, sites, or generators) is specified beforehand, and for each seed there is a corresponding region consisting of all points closer to that seed than to any other.

>>60995832
But to get the link that hosts the mp3, I need to press the play button (Can I simulate a button press through curl?) ... Or am I just being balls to the walls retarded.

>>60994181
Is this for a library you're using in a program you made?
>>
File: OpenGL.png (242KB, 3657x2074px) Image search: [Google]
OpenGL.png
242KB, 3657x2074px
Have a long road of a lot of work to do to make it better but this is what I've got working sofar.
>>
Let's not forget the languages that have died in the past year.
They will be missed.


>D
>Idris
>>
>>60995912
It's to change a library's behavior at runtime.
>>
>>60995912
You're not retarded, just naive.
The links provided on the page are stored in plain json, you need to follow them to get the actual mp3 stream, which you can then download.

my first project was a bandcamp downloader, I even added id3 tags with images because the streams themselves have no id3 tags.
>>
>>60995920
>Deutsche Bank.jpg
>>
>>60995967
Look closer. GBPUSD.csv
>>
>>60995824
Google announced official support for Kotlin on Android at Google I/O 2017. Like sheep, lots of 'young and dynamic' companies ditched Java in favor of Kotlin.
>>
File: snek with chick.jpg (142KB, 1365x2048px) Image search: [Google]
snek with chick.jpg
142KB, 1365x2048px
>>60995934
Alright... Unfortunately, that seems to be way out of my scope (pun unintended)

>>60995957
Thanks, man! You've been a great help!
>>
https://github.com/DimaSamoz/mezzo
>using types to enforce musical style

Has static typing gone too far?
>>
>>60995431
>(4..0)
Theres good reasons for this.
Consider your normal C style for loop:
for(int i=0;i<n;i++)

If you pass it an n that's less than 0 it won't execute.
If you had this:
 (0..n)

And passed a negative value it can either have the same behavior as in the C example and not execute. Or you could have it explicitly go both ways. Or you could have it explicitly go downwards.

I'm not a fan of kotlin either but having it do downto implicitly just because of the parameters is not a good idea. What they should give you is something to put when you mean up, down and both ways. That'd be useful.
>>
>>60996085
>list of people who care:
>>
>>60996085
not far enough
>>
>>60996085
Static typing was a mistake.
>>
File: Screenshot.png (49KB, 1008x673px) Image search: [Google]
Screenshot.png
49KB, 1008x673px
import std.stdio, std.conv, std.algorithm, std.range, std.string, std.bigint;

void main()
{
auto arr =
stdin
.readln
.strip
.splitter
.array
.permutations
.map!(join)
.map!(to!BigInt)
.array
.dup
.sort();

writeln(arr[0], ' ', arr[$-1]);
}


user0@primary:~/devel/proj/d/pilot$ dmd main.d
user0@primary:~/devel/proj/d/pilot$ echo 420 34 19 71 341 | ./main
193413442071 714203434119
user0@primary:~/devel/proj/d/pilot$ echo 79 82 34 83 69 | ./main
3469798283 8382796934
user0@primary:~/devel/proj/d/pilot$ echo 17 32 91 7 46 | ./main
173246791 917463217
>>
>>60996104
The '..' operator is misleading. I expect it to go both ways, but it only goes up. I'd rather have them remove the '..' in favor of 'upTo' so it's in sync with 'downTo'.
>>
>>60996228
>BigInt
>>
>>60996307
Well sometimes there are too many inputs
>>
>>60991715
Electron
>>
Took me 2 days to implement threadpool in C.
Runs finally without errors trough valgrind.
Fuck multithreaded programming though.
>>
>>60996344
It's more the name that bothers me
>>
>>60996391
>>
>>60996391
Now implement green threads.
>>
>>60996413
Chapel makes multithreaded software easy.
Go makes programming painful by not having any features.
>>
>>60996085
>hey this sounds cool!
>doesn't compile
Dumb piece of software, music is too dynamic for this
>>
>>60996391
CPUs aren't getting any faster, you want to embrace multithreading and SIMD and GLSL frag shader computation and if you want any real benefit from modern systems.
>>
>>60996574
Music is not "too dynamic", you worthless fucking nihilist, and if you really fucking want you can use a custom rule set so you can play you're dubstep "music"
>>
>>60996588
>GLSL frag shader computation
don't forget your meds grandad
>>
File: timert.png (15KB, 641x339px) Image search: [Google]
timert.png
15KB, 641x339px
I was messing around with timeit in Python earlier today and eventually ended up doing something like the picture.

I recall I was once reading some Python info page where the global keyword was kind of treated like a goto statement, in terms of "you shouldn't use this ever". I can certainly understand that from the point of program organization but I don't think I've ever heard it mentioned that global can result in considerable speedups(around 1/4 the time of anything else I tried).

I know these are just little tests, possibly meaningless and I'm aware of
>python
>speed
, but I'm really just curious at this point. I tried almost every method of getting the value 128 into the function that I could think of, and using global outdid them all by about a factor of 4 at best. Is there any way to match global's speed in functions operating on named variables? I can imagine the difference is even greater when larger classes/data are involved.
>>
>>60996705
Also, the code in case any of you care to bother copypasting for whatever reason:
import timeit
x = 128

def tbs(x):
while(x>4):
x >>= 1
def tbsx():
x = 128
while(x>4):
x >>= 1
def tbsy():
global x
while(x>4):
x >>= 1

q1 = timeit.timeit(lambda x = 128: tbs(x))
print(q1)
q1 = timeit.timeit(tbsx)
print(q1)
q1 = timeit.timeit(tbsy)
print(q1)

>>
>>60996736
No one wants to copypaste this.
>>
>>60996649
Yes it is, I find the more interesting stuff is made by ignoring general convention.
>nihilist
>dubstep
Wrong on both counts, nice try though
>>
>>60996749
>ignoring general convention
You are literally a nihilist you stupid fucking hipster.
You and your fucking marxist music.
>>
>if it's not autism tier classical it's "marxist"
>>
>>60996773
>You and your fucking marxist music.
Name your favorite bands/composers
>>
>>60995920
Hey, it's you again! Nice to see you and your progress.
>>
>>60996085
I could see it being useful for procedural music.
>>
>>60996816
If you think it's better to ignore convention, you're probably a marxist, you dumbass.
I notice you didn't reply, probably because you know you can't win the argument.

Silence is not a form of music.
One note is not a form of music.
>>
>>60996842
If you think convention should be followed for convention's sake you're a drone.
>>
>>60996842
Thank you for your opinion, oh great authority on all that is music
>>
>>60996862
>convention should be followed for convention's sake
I'm not saying that, it's you who's saying convention should be ignored, which is the opposite of convention

>>60996876
No man, the "great authority on all that is music" is the entire fucking history of music.
YOU are the jackass that thinks he's smarter than everyone else in history.
>>
>>60996951
>it's you who's saying convention should be ignored
Whomst've'll'd are you quoting?
>>
>>60996957
Who says > is a quote? Convention?
>>
>/dpt/
>ignoring mongodb
What are you, some sort of hun?
>>
>>60996973
What the fuck does that have to do with anything?
>>
>>60996951
Even classical composers broke rules, it's not like it's a recent phenomenon. Not like you would know since you only have a basic view of music.
>>
>>60996986
They may have broken some rules of the time but they didn't do so because of a fetish for breaking convention. They didn't do it for the sake of breaking convention. That is critical theory, that is marxism.
>>
malloc here, I just returned NULL to your program, what are you going to do about it
>>
>>60997019
execute the halting algorithm
>>
>>60997019
It's ok, I only asked for 0 bytes
>>
File: suffering-never-ends.jpg (57KB, 800x600px) Image search: [Google]
suffering-never-ends.jpg
57KB, 800x600px
How to progress to the final point on this chart?
>>
>>60997051
Depends on the language
Shitposting and language baiting is actually a good way to progress

>in X this is just
>>
>>60996830
Thanks for the interest and encouragement.
>>
>>60997051
1. learn to use github/gitlab/etc
2. learn the programming language.
3. get an overview of the project and make a meaningful modification.
4. get a pull request accepted
>>
>>60996228
import Data.List (permutations)

main = do
input <- getLine
let as = map (read . concat) (permutations (words txt)) :: [Integer]
soln = [minimum as, maximum as]
putStrLn (unwords (map show soln))
>>
>>60996999
>but they didn't do so because of a fetish for breaking convention
Yes, they did it because it lead to more interesting musical ideas which was my original point. I'm not saying it's a must.
>>
>>60996980
SQLITE YOU NU-MALE
>>
>>60997155
>Integer
Don't do this, try bignum or something
>>
>>60997145
>PR ignored
>"this isn't really what we're looking for"
>"the code style is all wrong"
>"I can see what you're going for here but it would be quicker if I just rewrite it"
>>
>>60997157
They were constructive, and even when they were ignoring some conventions they were following others. They weren't destructive or anarchistic.

Similarly, there's absolutely nothing wrong with having something that enforces certain rules, especially when you can use your own custom rule set.

It is an interesting adventure into static typing.
>>
>>60997200
"Integer" is an arbitrary precision type: it will hold any number no matter how big.
>>
>>60997200
haskell's Integer is unbounded
it has a bounded Int

>>60997155
i think you mixed up "input" and "txt"
>>
>>60997184
Have fun with your nigger tier where clauses and autistic inner joins faggot. Meanwhile, I can query any field I want, any document I want, 300k starting.
>>
>>60996228
Why is D so comfy, lads?
>>
>>60997227
yep thanks
>>
>>60997019
flip the global HALT_EXECUTION semaphore for all threads and keep retrying every second for more memory.
>>
File: scr.png (57KB, 1680x1050px) Image search: [Google]
scr.png
57KB, 1680x1050px
>>60990139
>What are you working on, /g/?

Exploring the darkest corners of Racket.

>>60996228
here mine using Racket.

#lang racket

(for-each (lambda (x)
(let ([sl (string-split x)])
(printf "~a ~a~%"
(string-join (sort sl string<?) "")
(string-join (sort sl string>?) ""))))
(port->lines))


what's your excuse for not learning Racket, anon?
>>
>>60997348
My excuse is that it's not a very good language
>>
File: 1497968866044.png (85KB, 592x576px) Image search: [Google]
1497968866044.png
85KB, 592x576px
>>60997348
>what's your excuse for not learning Racket, anon?
>>
>>60996413
Terrible way to multithread if your goal is performance
>>
>>60997348
>([
>>
>>60997348
unnecessary use of cat
>>
I'm implementing Lisp interpreter in Lua. Since it's just an interpreter, would it be okay to implement macros as functions that don't automatically evaluate their arguments (remembering that normally they would return just the code to be executed so here I'll have to eval it)? It would actually fit into my interpreter very well since my functions are a special case of... uh, something that kinda is a function but doesn't evaluate the arguments.
>>
>>60997885
He is following the Unix philosophy
>>
>>60997348
>what's your excuse for not learning Racket, anon?
#lang racket
(display "What the fuck are you talking about.")
(newline)
>>
>>60997912
Writing shitty code?
>>
>>60997919
Nope. See point 1 and 2 of the philosophy
>>
>>60997917
>pickup Racket
>Hello World
>drop Racket

excellent work anon
>>
>multithreading in any way other than a thread pool with a futures API
O I am laffin.
>>
>>60991629
>they all seem kind clunky and unpolished
explain what this means pls
>>
>>60997910
http://www.lispworks.com/documentation/HyperSpec/Body/03_.htm
>>
>>60997961
>garbage threading
>>
File: 2017-06-21-000051_564x123_scrot.png (12KB, 564x123px) Image search: [Google]
2017-06-21-000051_564x123_scrot.png
12KB, 564x123px
>>60997885
pic
>>
>>60997937
Racket was the first language I ever learned actually. I loved it until I learned C and realized how slow and ugly Racket is by comparison.
(with-handlers ([exn? identity]) (error "worst possible way to construct and return an exception object"))
>>
>>60997348
I've seen the basics of Racket. Don't really have much time for learning another language as I learn a plenty of them at my colleague anyway. But recently I got really interested in Lisps so I might find some time for it after all.

Also, any opinions on Shen?
>>
>>60997917
why not displayln?
>>
Now... how the hell do I work with this...
import Data.Vect
Rank : (n : Nat) -> Vect n Nat -> Type -> Type
Rank Z [] a = a
Rank (S k) (x :: xs) a = Vect x (Rank k xs a)
>>
>>60997201
>This code uses problematic language such as "GIMP"
>>
>>60998037
TL : (n : Nat) -> Rank n a -> a
TL Z a = a
TL (S n) (a :: _) = TL n a
>>
>>60997201
>some faggot adds functionality to my program
>reject it because [bullshit reason]
>delete PR
>block user
>rewrite their PR into my next commit several weeks later

What are you gonna do about it, faggot
>>
>>60997999
I that's a bad way to return exceptions because it's slow, then it's actually okay. Exceptions don't have to be fast.
>>
File: clivecoding.jpg (42KB, 768x1024px) Image search: [Google]
clivecoding.jpg
42KB, 768x1024px
>>60997999
>I loved it until I learned C and realized how slow and ugly Racket is by comparison.

Racket:                         3.618877176 seconds time elapsed
C clang: 9.971914301 seconds time elapsed
C++ clang++: 5.518077517 seconds time elapsed
C++ G++: 4.659448453 seconds time elapsed
D DMD: 9.432905226 seconds time elapsed
D GDC: 25.970303586 seconds time elapsed
D LDC: 6.347934615 seconds time elapsed


Apologize!
>>
Decidable problem: check statically
Undecidable problem: delay and check dynamically or solve with a proof assistant
>>
>>60998102
>Undecidable problem
>>
>>60991629
Clojure.
>>
>>60998100
https://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html
>>
>>60998100
>>60998133
>Look mom, I posted it again!
>>
>>60997999
Racket uglier than C? A state of art programming language when talking about PLT is uglier than a programming language that has ignored PLT for now 50+ years? Confirmed for troll.

Remind me, how do you declare a procedure returning a pointer to an array in C?
>>
>>60998133
Haskell confirmed for shit
>>
>>60998166
>a procedure returning a pointer
A procedure cannot return anything, you're thinking of a function.
t. Dr Pedantor
>>
>>60998133
this site always seemed unreliable to me because it requires users to submit programs for benchmarking. hence popular languages will have optimized solutions while unpopular languages will be neglected and left with naive slow solutions
>>
>>60998172
http://lambda.jstolarek.com/2013/04/haskell-as-fast-as-c-a-case-study/
https://two-wrongs.com/on-competing-with-c-using-haskell#rf1

you just have to write autistic hideous code
>>
>>60998037
wrote >>60998083 wrong but you get the idea
>>
>>60998191
What? In what way do procedures permute the state of the program then? If they can't have side effects or return values they're not doing anything.
>>
>>60998202
https://benchmarksgame.alioth.debian.org/u64q/haskell.html
You're telling me this code isn't hideous?
>>
>>60998258
isn't hideous enough
honestly there aren't enough benchmark autists
>>
>>60998248
state machine model, procedures modify machine state. C just formats it to look like we return things when we really just place it in a convenient location to be retrieved later
>>
>>60998191
a function is more than a procedure returning a value. and to be pedant, a function is actually a mathematical concept that has no counterpart in programming (sicp, chapter 1)
>>
>>60998326
>that has no counterpart in programming
proof that SICP was written by idiots
>>
Why can't I take a language with no {} seriously?
I'd love to learn Nim but it follows python syntax and it hurts my brains.
>>
>>60996951
>I'm not saying that, it's you who's saying convention should be ignored, which is the opposite of convention
So saying "convention should be ignored" == saying "convention should be followed for convention's sake"?
>>
>>60997019
Deallocate all resources, print an appropriate message to the terminal, and exit.
>>
>>60998299
Ugh, yeah that's really pedantic.
>>
>>60998355
what? how did you even get that from what i said?
>>
>>60998350
written by math literates, a now rarity in computer science.

https://www.youtube.com/watch?v=FKFH_-QogN0&t=16m50s
http://lamport.azurewebsites.net/tla/math-knowledge.html

never forget that.
>>
>>60997019
I never called you. Where are you returning null? You're not even included in my program. I guess I don't really care unless you mess up my registers.
>>
>>60998110
Undecidable doesn't mean it can't be solved, only that no one has found a way to solve it yet.
>>
>>60998351
>I'd love to learn Nim but
You love to be uneducated.
>>
>>60998416
Can you think of an undecidable problem that isn't purely theoretical?
>>
>>60998416
No, undecidable means that you're not guaranteed an answer in finite time.
>>
>>60998248
>procedures can't have side effects
Who said that?

>>60998386
The other person accused you of following convention for convention's sake. And then you said "no, that's what you're doing, the opposite of convention".
>>
File: solve (5).png (754KB, 1280x720px) Image search: [Google]
solve (5).png
754KB, 1280x720px
>>60998432
>>
>>60998449
No, that is intractable.
>>
>>60998449
But since time isn't finite, there is still an answer.
>>
>>60998462
What purpose does this serve?
>>
>>60998458
I didn't say that he was doing what he accused me of doing, I said that I wasn't doing that and that he was saying something ridiculous that could run parallel to what he accused me of (but i'm not saying it's similar, because it isn't, "doing something because, it is convention to do it" and "not doing something, because it is convention to do it" are not equally rational), it's complicated but it makes sense if you re-read it
>>
>>60998458
>>60998501
to say it again


>I'm not saying that, it's you who's saying convention should be ignored, which is the opposite of convention

>I'm not saying that

>It's you who's saying "convention should be ignored" [because it is convention]

>which is the opposite of convention
(which relates to what i just said about them not being equally rational)
>>
>>60998476
Undecidability reduces to intractibility with an algorithm that can enumerate all algorithms.
>>
>>60998351
learn idris then
>>
What languages let you set up your data using conditions like
>must be a continuous set of data
>must be 16byte aligned
>must be packed so and so
>is SOA not AOS
And then you just write procedures operating on whatever granularity you want within that data (element, primitive, bytes, byte, bit) and give all the freedom you can to the compiler (aside from the constraints you put up) to just optimize it.
I don't want to care about all this shit again but it's vital to write acceptable programs.
>>
>>60998100
>Apologize!
#lang racket
(require 2htdp/image)
(define TILE_SIZE 32)
(define WIDTH_IN_TILES 20)
(define HEIGHT_IN_TILES 15)
(define GRID_SCENE
(empty-scene (* TILE_SIZE WIDTH_IN_TILES)
(* TILE_SIZE HEIGHT_IN_TILES)))
(define (draw-grid-starting-from x y x-offset y-offset grid color scene)
(cond
[(empty? grid) scene]
[(empty? (first grid))
(draw-grid-starting-from
0 (add1 y) x-offset y-offset
(rest grid) color scene)]
[(first (first grid))
(place-image/align
(square 32 'solid color)
(* (+ x-offset x) TILE_SIZE)
(* (+ y-offset y) TILE_SIZE)
"left" "top"
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene))]
[else
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene)]))
(define (draw-grid grid color (x-offset 0) (y-offset 0) (scene GRID_SCENE))
(draw-grid-starting-from 0 0 x-offset y-offset grid color scene))
(define (listof-string->grid los)
(map
(compose (curry map (compose not (curry eq? #\space)))
string->list) los))
(define (draw-grid-from-strings los color (scene GRID_SCENE))
(draw-grid (listof-string->grid los) color 0 0 scene))
(draw-grid-from-strings
`("NN N OOOOO"
"N N N O O"
"N N N O O"
"N N N O O"
"N NN OOOOO") 'red)
>>
>>60998622
Oops, fixed to avoid hideous syntax highlighting
#lang racket
(require 2htdp/image)
(define TILE_SIZE 32)
(define WIDTH_IN_TILES 20)
(define HEIGHT_IN_TILES 15)
(define GRID_SCENE
(empty-scene (* TILE_SIZE WIDTH_IN_TILES)
(* TILE_SIZE HEIGHT_IN_TILES)))
(define (draw-grid-starting-from x y x-offset y-offset grid color scene)
(cond
[(empty? grid) scene]
[(empty? (first grid))
(draw-grid-starting-from
0 (add1 y) x-offset y-offset
(rest grid) color scene)]
[(first (first grid))
(place-image/align
(square 32 (quote solid) color)
(* (+ x-offset x) TILE_SIZE)
(* (+ y-offset y) TILE_SIZE)
"left" "top"
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene))]
[else
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene)]))
(define (draw-grid grid color (x-offset 0) (y-offset 0) (scene GRID_SCENE))
(draw-grid-starting-from 0 0 x-offset y-offset grid color scene))
(define (listof-string->grid los)
(map
(compose (curry map (compose not (curry eq? #\space)))
string->list) los))
(define (draw-grid-from-strings los color (scene GRID_SCENE))
(draw-grid (listof-string->grid los) color 0 0 scene))
(draw-grid-from-strings
(list "NN N OOOOO"
"N N N O O"
"N N N O O"
"N N N O O"
"N NN OOOOO") (quote red))
>>
Is it me or does Scala tooling get worse with every release?
>>
>>60998661
Why are you using Scala?
>>
>>60998680
Work, my choices are Scala and Java
>>
>>60998688
I'm so sorry
>>
>>60998530
Not if you can't prove a suitable algorithm exists at all.
>>
>>60998713
Good point.
>>
>>60998697
Please send help, anon.

Please.
>>
>>60998661
what happened with the most recent release?
>>
>>60998650
Fixed to be better.
But my point still stands: C is better than this garbage.
fite me
#lang racket
(require 2htdp/image)
(define TILE_SIZE 32)
(define WIDTH_IN_TILES 20)
(define HEIGHT_IN_TILES 15)
(define GRID_SCENE
(empty-scene (* TILE_SIZE WIDTH_IN_TILES)
(* TILE_SIZE HEIGHT_IN_TILES)))
(define (draw-grid-starting-from x y x-offset y-offset grid color scene)
(cond
[(empty? grid) scene]
[(empty? (first grid))
(draw-grid-starting-from
0 (add1 y) x-offset y-offset
(rest grid) color scene)]
[(first (first grid))
(place-image/align
(square 32 (quote solid) color)
(* (+ x-offset x) TILE_SIZE)
(* (+ y-offset y) TILE_SIZE)
"left" "top"
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene))]
[else
(draw-grid-starting-from
(add1 x) y x-offset y-offset
(cons (rest (first grid)) (rest grid))
color scene)]))
(define (draw-grid grid color (x-offset 0) (y-offset 0) (scene GRID_SCENE))
(draw-grid-starting-from 0 0 x-offset y-offset grid color scene))
(define (listof-string->grid los)
(map
(compose (curry map (compose not (curry eq? #\space)))
string->list) los))
(define (draw-grid-from-strings los color
(x-offset 0)
(y-offset 0)
(scene GRID_SCENE))
(draw-grid (listof-string->grid los) color x-offset y-offset scene))
(draw-grid-from-strings
(list "N N OOOOO"
"NN N O O"
"N N N O O"
"N N N O O"
"N N N O O"
"N NN O O"
"N N OOOOO") (quote red) 2 4)
>>
>>60998732
idris compiles to jvm, tell them scalaz/cats is just idris with heavy syntax
>>
>>60998754
Massive IDE slowdown and lag, almost unusable.
>>
>>60998802
do the same in C
>>
>>60998808
I'd like to but my coworkers are all in love with akka and play, they love the object-functional rubbish.
>>
>>60998808
Idris is dead though. Also slow.
>>
>>60998802
>C is better than this garbage.

lambda expression? no
closures? no
intelligent macros? no
eval? no
continuations? no
decent type systems? no
decent standard library? no
string type? no
garbage collection? no
Homoiconic? no
exceptions? no
safe iterations? no
pattern matching? no
modules? no
lazy evaluation? no
gradual typing? no
repl? no
objects? no
...

yes, C definitively better. Do you even realize that programming in C is like programming in the seventies? you are missing so much and ruining your life on tedious tasks that you could have easily avoided with a modern programming language.
>>
>>60998945
btfo
>>
>>60998945
C gives me speed and control
>>
>>60998945
Rekt
>>
>>60998945
>gradual typing
Bad.

>lazy evaluation
Bad for C.

>objects
Bad.

>built-in exceptions
Bad.

>macros
Bad.

>homoiconic
Fetish.
>>
JavaScript is the best functional programming language
>>
>>60998974
I like Rust better
>>
>>60998945
>largely useless features that are easily substituted and add to the mental overhead of reading code
Yeah. I'm quite happy C doesn't have that. C isn't perfect by any stretch but if the answer to those questions would be yes in the case of C it'd be terrible.
>>
>>60998966
>gradual typing
Isn't that just "I know I should use static typing, but I'm not smart enough to use it in non-trivial situations"?
>>
>>60998819
>>60998945
#include <SDL2/SDL.h>
#include <stdio.h>
static int const PIXW = 32;
static int const PSW = 20;
static int const PSH = 15;
static void sdl_try(int l, int s) {
if (!s) {
fprintf(stderr, "SDL error at line %d: %s\n", l, SDL_GetError());
exit(1);
}
}
int main(int argc, char const** argv) {
SDL_Window* window;
SDL_Renderer* rend;
sdl_try(__LINE__, SDL_Init(SDL_INIT_VIDEO) >= 0);
sdl_try(__LINE__, !!(window = SDL_CreateWindow("",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
PIXW*PSW, PIXW*PSH, SDL_WINDOW_SHOWN
)));
sdl_try(__LINE__, !!(rend = SDL_CreateRenderer(
window, -1, SDL_RENDERER_ACCELERATED
)));
SDL_Event e;
SDL_Rect pos;
pos.x = 0;
pos.y = 0;
pos.w = PIXW;
pos.h = PIXW;
int quit = 0;
int x, y;
SDL_SetRenderDrawColor(rend, 0xff, 0xff, 0xff, 0xff);
SDL_RenderClear(rend);
char const* NO =
"N N OOOOO "
"NN N O O"
"N N N O O"
"N N N O O"
"N N N O O"
"N NN O O"
"N N OOOOO ";
int no_w = 16;
int no_h = 7;
int no_x = 2;
int no_y = 4;
SDL_SetRenderDrawColor(rend, 0xff, 0, 0, 0xff);
for (x = no_x; x < no_x + no_w; x++)
for (y = no_y; y < no_y + no_h; y++)
if (NO[(y - no_y)*no_w + x - no_x] != ' ') {
pos.x = x*PIXW;
pos.y = y*PIXW;
SDL_RenderFillRect(rend, &pos);
}
SDL_RenderPresent(rend);
while (!quit) while (SDL_PollEvent(&e) != 0)
quit = (e.type == SDL_QUIT);
SDL_DestroyRenderer(rend);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
>>
>>60998994
It's so fucking stupid.
Just create a flexible type called dynamic if you want that, don't add some kind of autistic backdoor
>>
>>60998912
show them how close FP is to OOP, usually works for most
>>
>>60998945
>Do you even realize that programming in C is like programming in the seventies?
Remind me again how this, which is shorter than the Racket version: >>60999019
is symptomatic of an outdated language.
>>
File: A "Simple minded" person.jpg (43KB, 547x300px) Image search: [Google]
A "Simple minded" person.jpg
43KB, 547x300px
>>60998945
>No Modules
>No pattern matching
>No higher order functions
Absolutely disgusting. C is meant for "simple minded" people.
>>
>>60999063
See: >>60999053
>>
>>60999075
How does your response correlate to my post?
Are you one of those "simple minded" people?
>>
>>60999063
>No higher order functions
It has those, though.

int foo(int (*bar)(int));
>>
>>60999022
manifestly, you don't know what you are talking about because having a dynamic (c#, for example) is gradual typing.
>>
>>60998920
1.0 release is ok, repl is slow due to not using a better representation for Nats
>>
>>60999093
Let's see. Replicate this >>60996228
>>
where is the other programming general where you could ask questions?
>>
>>60998966
Macros only suck in C/C++.
>>
>>60999089
You're barging in on a conversation about which is better, Racket or C, and you're attacking C. It can be reasonably inferred that this means you think Racket is better. (If you don't, you're being unreasonable by bringing up your distaste for C in the context of this particular discussion.) By demonstrating competence in both Racket and C, but solving the same problem more simply in C than in Racket, I'm providing evidence for C's superiority, which is contrary to what you're implying.
>>
>>60999118
>>>/sqt/
>>
>>60999096
No, it's fucking obvious that YOU don't know how to program.

Create a STATIC type called "dynamic" that is particularly flexible.

>>60999127
If you need macros you're probably doing something wrong.
>>
>>60999130
That does not justify your response a single bit. You really are one of those "simple minded" person.
>>
>>60999133

no the people over there are not competent enough
>>
>>60999144
>"simple minded"
See:
>>60998802
>>60999019
>>
NEW THREAD!!

>>60999166
>>60999166
>>
>>60999144
>racket
idris is much better
>>
>>60998992
>add to the mental overhead
C is better for simple minded people.
>>
>>60999168
DUMBASS
>>
>>60999176
It's overhead. It's better for everyone to do without.
>>
>>60999019
C needs destructors*

*not C++ style where it's tied to an object, but like that gnu extension where it's tied to a function
>>
>>60999158
Okay I understand a "simple minded" person has low attention span. Now follow this instructions very carefully:
Step 1: Refer to >>60999063
Step 2: Understand what modules, pattern matching and higher order functions are. If you need help use Google.
Step 3: Admit that C is meant for "simple minded" people

>>60999174
I don't use racket
>>
>>60999130
>By demonstrating competence in both Racket and C, but solving the same problem more simply in C than in Racket, I'm providing evidence for C's superiority, which is contrary to what you're implying.

you only demonstrated your lack of competence in racket.
>>
>>60999031
It was hard enough getting them to stop using AbstractMethodInvokingFactoryProxyBean.
>>
>>60999190
>It's overhead
For simple minded people. Non-brainlets don't consider it to be "overhead".
>>
NEW THREAD
>>60999215
>>
>>60999196
How is C for simple minded people? C can behave the same way by demoting if, for, while, &c, to "functions" and implementing map, foldl/r, &c...
>>
>>60999211
Simple minded people don't realize it. When you're at a good programming phase it's a hassle to deal with code that's different from your style. How do you think having consider another set of features would impact you?
It doesn't really matter what you think though. You're clearly not an expert programmer and never will be. Anyone who would be bothered would never use your libraries anyway. So it's fine. Do as you please.
>>
>>60999206
Well I feel sorry for you and hope for the best
>>
>>60999258
Rude plus you sound like a one trick pony
>>
File: tumblr_nubwkuPAG41qd5mq1o1_540.jpg (65KB, 540x405px) Image search: [Google]
tumblr_nubwkuPAG41qd5mq1o1_540.jpg
65KB, 540x405px
anyone any good with sql? ive never used sql, and anytime ive tried to learn it I usually end up skimming through trying to find information relevant to my problem.
that works, in a very lazy, half-assed way, but i feel like im missing something.
I need to figure out a way to take input from a user (via a swing jlist component. user picks which column gets displayed by using a dropdown list) and use the selected values picked to filter shit out.
I have it setup where the query has a boolean 'included' column that gets toggled whenever a value is added to an 'exclude' list. Then very slowly i use python to find the included rows to use in a where clause on another final query.
It works and all, just that the second query is almost identical to the first, just that aggregates are applied nd shit. Also these are some huge where clause conditions, and some of these columns arent indexed. Just feel like theres a better way.
>>
>>60991715
python
Thread posts: 322
Thread images: 36


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