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

/dpt/ - Daily Programming Thread

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

Thread replies: 321
Thread images: 20

File: Programming Penguin.jpg (18KB, 284x339px) Image search: [Google]
Programming Penguin.jpg
18KB, 284x339px
What are you working on, /g/?

Previous thread: >>61364395
>>
>>61372924
Fist for C++ generic programming deliciousness.
>>
first for the glorious C programming language
>>
Writing some Windows API toy programs to refresh my memory. The last time I programmed in Win32Api was 15 years ago. Then I switched to Linux but now I'm back to the superior OS.

Feels good to have an stable API that doesn't break every version and that works exactly the same after all these years.
>>
>>61373007
literally nothing glorious
>>
>>61373007
>no new tools to help you kode
>do everything by hand like it's 1970's
>glorious
>>
>>61373016
>superior OS.
>>
Airline Pricing Engine built on top of an ancient engine. And it's full of so much bad practice garbage I'm surprised no one has leaked the bad state of the coding within the engine. Someone already leaked the internal bugs to our customers. It's only a matter of time everyone finds out the source.
>>
>>61373169
>do everything by hand like it's 1970's
You mean calling functions where appropriate and writing your own solutions where appropriate?
As you should in every other language.
Then yes.
>>
Bumping for all of the dudes who needed help with their C problems.
>>
So my parents always struggle with restarting the WLAN on our router if it's bugged again so I though I was gonna write them a small script that automates the entire process. basically what I have to do is log in to the router configuration site and click a few buttons in a row. I guess that's doable right ?

Can anybody recommend me a Python module that does this ?
>>
>>61373247
>As you should in every other language.
There's no point handrolling your own custom data structures unless you have a hard performance requirement that you're failing to meet and your benchmarks prove that the data structure is a significant bottleneck.

Anything else is premature optimization.
>>
>>61373314
If you want to do this the super easy way, you could probably use Selenium.
But I guess you might be able to use curl as well, if you wanted to.
>>
>>61373315
>premature optimization.
Most problematic phrase used in programming.
>>
I don't understand pointers.


Should I kill myself?
>>
>>61373420
What about them don't you understand?
>>
>>61373420
I've been programming for years.

I've never used a pointer in my entire life.
>>
>>61373436
Impossible, except if you're doing pure FP.
>>
>>61373420
>I don't understand pointers.
You've probably been taught poorly. They're quite easy.
Describe pointers to me.
>>
>>61373436
You almost certainly have, even though it has tried to disguise itself as something different.
>>
>>61373425
Absolutely nothing.

>>61373453
A pointer is the location of a variable in the memory.
Beyond that I don't get a single thing about it.
I can't even tell the difference between & and *
>>
>>61373451
>>61373455
Right, I understand that.

You should understand what I'm saying; I've never personally used a pointer myself, even though I'm aware that they are used in the underlying mechanics of the high-level language I program in.
>>
>>61373016
>Feels good to have an stable API that doesn't break every version and that works exactly the same after all these years.
lolwat
examples of breaking changes in linux please, 10$ says you're just a m$ fanboy
>>
>>61373420
It's fucking numbers, addresses in the memory. That's it.
>>
>>61373516
No, you don't get it. DO you do OOP ? As soon as you pass something to a function that can modify your something you're directly using a pointer.
>>
>>61373520
>examples of breaking changes in linux please
HAHAHAHAHAHAHAHAHAAHAHAHAHAHHAAHHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHA
>>
>>61373492

& and * are opposites of each other.
& means take the address of a variable. * means get the value that is being pointed to.
int x, y, *ptr;
x = 10;
ptr = &x; // Give me a pointer to x.
y = *ptr + 1; // Add one to the value that ptr points to.

>>
>>61373314
It really depends on what "click a few buttons" does. If it triggers some JavaScript handler you need to inspect what they do or just use Selenium. If each button just triggers an HTTP request you can just use urllib or requests to fire off the appropriate series of HTTP requests.
>>
>>61373587
What an argument!
>>
>>61373589
But why do I need to use * in order to assign the location of an integer to another variable?


If I do:

int i=5;
int x=&i;


Why does it have to be int* x ?
>>
>>61373554
Again, I understand precisely what you're trying to tell me. It's semantics.

I also remember being 16 many years ago, trying to show random people how they're technically wrong.
>>
File: 1500039512586.jpg (53KB, 440x440px) Image search: [Google]
1500039512586.jpg
53KB, 440x440px
>tfw i chose to use mongodb for a personal project that involves money
Anyone else hate their life right now?
>>
>>61373625
No it's not semantics. You just use improperly the word pointer. Pointer is not just C pointer, it's everuything that act as a C pointer. SO, except if you're doing pure FP, you're using pointers.
>>
>>61373681
"ok"
>>
>>61373670
http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/

Old, but relevant.
>>
>>61373670
dumb frogposter
>>
>>61373619
char var1 = 'Y';
char var2 = &var1; // !

This code makes no sense. var2 holds a single character. A character is clearly not the same as a memory address! In the same way, a memory address is not the same thing as an integer.
char *var3;

This means "the value at the memory address specified by var3 is a char". Or more simply, "you get a char by doing * to var3". So now you can put your pointer there.
var3 = &var1;
>>
File: Unbenannt (2).png (269KB, 1920x1080px) Image search: [Google]
Unbenannt (2).png
269KB, 1920x1080px
what would you do different? Its a shopping list
>>
>>61373782
int condition = 1
while (condition == 1)

This can simply be replaced with
 while (true) 

Also, you should indent after you open your curly brace for the while loop.
 while (true)
{
doStuff();
}
>>
>>61373814
i didnt know how to turn off the loop at the end, if i do it with an int i can change the int to terminate the loop
>>
>>61373708
How can a memory location be a char?

Sorry if it sounds too stupid asking this, but I really suck at it.
>>
>>61373836
break;
>>
>>61373492
>A pointer is the location of a variable in the memory.
Correct
>I can't even tell the difference between & and *
& is the address of operator. It's a unary operator (only takes one argument unlike things like + that take two) that returns the memory address of any given variable.
The * is quite heavily overloaded in C, it can be multiplication as I'm sure you know, it's used to declare pointer and it's used to dereference pointers. Imo the two last overloads are confusing to newbies but you get around it quickly.
Example:
https://gist.github.com/anonymous/464b3adb0ae21477dd2d1d240edfdc68

Now maybe you have more questions. Ask them.
>>
>>61373840

A memory location -can't- be a char. That's the point.
char x;

x is a char.
char *y
y holds the location of a char.
>>
>>61373814
Also, you should indent after you open your curly brace for the while loop.

what does that mean?
>>
>>61373843
Actually I should probably have posted this instead.
https://ideone.com/VkV223
Makes more sense to not have you set up a project right now.
>>
>>61373855
So pointers have to be of the same type as the variable I'm pointing it to?
>>
>>61373882
Pointers have a pointer type of the variable you're pointing to. When you dereference a pointer you get the type you were pointing to back.
>>
>>61373843
>>61373895
Why would I need to dereference a pointer?

Actually, now that I get a bit more how pointers work I don't really know why I would use them.
>>
>>61373869
//bad
while (true)
{
doSomething();
}

//good
while(true)
{
doSomething();
}


Also there's a common trick for expressing "for every line of the input". I'm not sure how it looks in C#, but it should go something like this.
while ((String currentLine = Console.readLine()) != null)
>>
Anyone have any good resources for learning VHDL?
>>
>>61373999
the only good
void tmpfn()
{
if(cond) {
int x, y;
fn( &x,
&y);
}
}

>>
>>61373895
I mean first of all, why would I declare a pointer when I can always use the & operator?
>>
>>61374089
Forget sepples references dumb fuck.
Use pointers only.
>>
>>61373976
Dereferencing retrieves the value that is pointed to.
A pointer which cannot be dereferenced is fairly useless.

The easiest example to understand is a "swap" function.
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}

int main()
{
int x = 4;
int y = 7;
swap(&x, &y);
}


>>61374089
Where do you keep it?
>>
>>61374117
When I pass a variable by reference, do I always use * for each variable inside the procedure?
>>
>>61373782
The number of branch statements a programmer uses is inversely proportional to their skill level.
>>
>>61374216
No that's stupid. I could do everything in one while loop and one switch case. And according to your post I would be an awesome programmer.
>>
>>61374205
Yes. In C you must explicitly state to follow the reference.
int *x;
x = y; // The pointer has changed - it may be pointing to a new int.
*x = z; // The pointed-to int has changed, but it's the same int.
>>
>>61374089
you make a pointer because sometimes passing arguments by value makes a copy of that value and is expensive, so passing just one memory address is cheaper and lets you modify that value inside the function.

another reason for declaring pointers is that you not always want the address of a variable, sometimes you want to create arrays, like this:

/*this means that str is pointing to a sector in
memory where the value of ten characters
are stored continiously*/
char* str = malloc(10);
>>
>>61374205
References (C++) are syntax sugar for pointers.
I think the best way to actually learn when to use pointers or references is to program something and learn from your mistakes.
>>61374216
No it depends enough on the current problem to be completely irrelevant to programmer skill. Some problems have very nice algebraic solutions. Others simply don't.
Some have algebraic solutions but you'd be a fool if you use them.
>>
>>61373420
reference everything, fuck pointers.
>>
>>61374267
if anon is struggling with the basic ideas of pointers, it may be unwise to introduce arrays and pointer arithmetic

>>61374307
kys yourself
>>
There is nothing wrong with programming python. Python is incredibly useful for some tasks.
>>
>>61374374
>python
>a programming language
pick one
>>
>>61374374
There's nothing wrong with programming COBOL. COBOL is incredibly useful for some tasks.
>>
>>61374374
>There's nothing wrong with programming FORTRAN. FORTRAN is incredibly useful for some tasks.
>>
>>61374374
There's nothing wrong with programming node. node is incredibly useful for some tasks.
>>
>>61374393
COBOL is incredibly useful for making 400k, so yes, you are correct/
>>
>>61374374
There is nothing wrong with programming brainfuck. Brainfuck is incredibly useful for some tasks.
>>
>>61374374
There is nothing wrong with programming Haskell. Haskell is incredibly useful for some tasks.
>>
>>61373016
>Feels good to have an stable API that doesn't break every version and that works exactly the same after all these years.
Yeah I agree, programming for the linux kernel is pretty great.
>>
>>61374374
except that's wrong fagooooooooooooooooot
>>
>>61374571
Nice argument.
>>
any good book about c++ expression templates?
>>
>>61373315
>premature optimization.
No such thing.
All optimization is good optimization, and if the result is that you're no longer able to comprehend the problem, that simply means you're a brainlet.
>>
>>61374574
thanks
>>
>>61374595
I guess that random shitposter retard #61374595 is smarter than that brainlet Knuth then
>>
>>61374629
>just because guy is know for something makes everything he says automatically true
>>
>>61374629
Well, yes, because Knuth is actually Trump, and there's literally no one who isn't smarter than Trump.
You see, in C, it's impossible for more than one object to have the same name.
Such as the name "Donald."
Naturally, this also means Donald Duck is actually Trump.
>>
File: c4a.jpg (23KB, 600x484px) Image search: [Google]
c4a.jpg
23KB, 600x484px
>>61374656
nice english retard
>>
>>61374663
dumb frogposter
>>
Considering starting some open source node contributions do you get banned if you're not very good?
>>
>>61374683
no you don't understand
that picture is you
you are the dumb frogposter
i am not even a frogposter
>>
FOY
>>
>>61374089
Are you talking about C++ references?
In general, you should only use pointer when you can't use references.
>>
>>61374700
>post frogs
>not frogposter
>>
>>61374716
bad advice
>>
>>61374737
Fuck off Ctard.
>>
>>61374745
but I like C++
>>
>>61374754
Fuck off Bjarne.
>>
File: python.png (84KB, 1225x868px) Image search: [Google]
python.png
84KB, 1225x868px
>>
>>61374761
This is good advice
If you write a test that passes that implies you've already implemented the module the test is meant to be testing which is the wrong order of doing things because you should have written the test first so you don't lose sight of what your module needs to accomplish
>>
>>61374783
people like you create poorly designed, error riddled code
>>
>>61374754
Well then you should agree with my advice.

You wouldn't do this in C++ code:
void foo(int *x) {
*x = something;
}

When a reference would be way more suitable.

Sepples references are a bit restricted, you can't change where they point to, so they can't be used everywhere.
And my advice was, where they can't be used, or where pointers would result in cleaner code, then use pointers.
And when you DO use pointers, consider smart pointers first, and fallback to raw pointers.

If you disagree with this, you're not programming C++ properly.
>>
>>61374794
>designed
what design?
>>
>>61374794
no u
people like me create code that works and does what it's supposed to do and doesn't do anything extra
your code categorically either doesn't work or does too much because you didn't program in what your aim was before you started aiming for it
>>
>>61374761
This is correct. How am I supposed to know if my function works without testing it? And if I'm gonna test it, may as well automate what I'm gonna do in the reply anyways.
>>
>>61374761
Unit tests are absolutely hopeless at spotting bugs or even proving that the implementation works.
They are an utter stupid waste of time.
>>
>>61374796
>Sepples references are a bit restricted, you can't change where they point to
You can't really do this in C either
void foo(int *x) {
x = somewhere;
}

The function foo is now effectively a no-op
>>
>>61374807
there are people more intelligent than you who will be able to break your code if you roll your face on your keyboard untill your program works in the small subsets of situations your small brain can imagine
>>
>>61374796
>You wouldn't do this in C++ code:
I absolutely would, because I would never write a function that does this
int x = 0;
foo(x);
x != 0; // == true


Smart pointers should only be used to represent ownership (i.e lifetime semantics). Non-owning pointers should be raw pointers.
>>
File: 1492923105243.jpg (47KB, 645x968px) Image search: [Google]
1492923105243.jpg
47KB, 645x968px
>Write a test that fails, then code until it passes
>>
>>61374595
>All optimization is good optimization
Absolutely wrong.
>>
>>61374839
>if you roll your face on your keyboard untill your program works
why would anyone do this
since when is this what we're even talking about
programming to the test is about maintaining a sense of direction, not being able to semi-safely abandon one
>in the small subsets of situations your small brain can imagine
it's not about what you can imagine, it's about what you care to support
leaving some possible uses unsupported is an inherent problem of all interface design, not just unit testing
>>
>>61374859
Dont tell me you test your code by hand?
>>
>>61374875
See rest of post. If you have ever had an experience with optimization being bad optimization, it wasn't the optimization that was bad, it was you.
>>
>>61374833
And? that's just that specific use case.
Sepples references can't be changed at all, they are effectively auto-dereferencing const pointers.

>>61374852
>I absolutely would
Enjoy stupidly checking for null pointers.

>Smart pointers should only be used to represent ownership (i.e lifetime semantics). Non-owning pointers should be raw pointers.
I agree.
>>
>>61374907
Nope. You've clearly never ran a project in the real world.

If someone spends 40 hours optimizing a one-second task into one-tenth of a second, they just wasted time if that task only runs once a year.

Optimization that does not pass a cost-benefit analysis on the time required to implement is not good optimization.
>>
>>61374852
>Smart pointers should only be used to represent ownership (i.e lifetime semantics). Non-owning pointers should be raw pointers.
What do you have against weak_ptr?
>>
>>61374595
I compile my code to assembly instead of machine language, and then hand edit the assembly before compiling it to its final state.
>>
>>61374896
Manual testing is the most effective form of testing.
Print debugging is the most effective form of debugging.

Retards please leave.
>>
>>61374944
>If someone spends 40 hours optimizing a one-second task into one-tenth of a second, they just wasted time if that task only runs once a year.
If someone spends 40 hours optimizing anything to any scale of benefit whatsoever, he is a brainlet.
>>
a minecraft bot that does certain tasks like laying bridges, mining and making its own pickaxes.
>>
>>61374948
>>61374954
fucking kek
we got some 1990s pro hackers here boys
>Retards please leave.
"let he without sin throw the first stone"
>>
>>61374883
>it's not about what you can imagine, it's about what you care to support
>leaving some possible uses unsupported is an inherent problem of all interface design, not just unit testing
hello mr. chinese hacker, just don't enter any input that i haven't tested on or exploit a race condition i don't know exists. thanks
>>
>>61374968
Just use ComputerCraft or OpenComputers.
>>
>>61374921
int &x = * (int*) nullptr;

Where is your god now?

Seriously though, null pointers fucking suck. A maybe type is much better.
>>
Need statically typed and compiled language with easy C ffi and that's cross platform.
Ocaml has fucking ugly ffi.
Go doesn't have any features.
Chapel can't use libraries compiled with it.
Swift is propably just apple specific.
>>
>>61374982
>Where is your god now?
Undefined, thanks to you.
>>
>>61374982
>int &x = * (int*) nullptr;
>Where is your god now?
cleaning up the remains of your stillborn program
>>
>>61374954
>Print debugging is the most effective form of debugging.
Stop being a pussy and learn how to use gdb already.
>>
>>61374976
Debuggers are horrible. They don't scale with large software at all.
They are a complete waste of time.
>>
>>61374977
>i am bad at picking tests to write to and therefore writing to the tests is bad
>>
>>61374982
>C-style casts
eww
>>
>>61375007
>debuggers
ewwww
literally just use unit tests
>>
>>61375005
Enjoy stupidly stepping through hundreds of instructions to trace some function when you can just easily place a few print statements.

Bad programmers use debuggers.
Good programmers just print stuff.
>>
>>61375033
What cast should I have used there?
>>
>>61375042
a unit test
>>
>>61375007
I use debuggers with a 500,000+ line software. What problems have you encountered?
>>61375035
I use debuggers when my tests fail and I don't know why. Logging is good to but instead of inserting print statements everywhere I increase the log level to debug.
>>
>>61375035
Unit tests are also a horrible waste of time.
They are absolutely hopeless at finding bugs or even proving the implementation works as intended.
Manual Human testing is the most effective form of testing. Nothing beats being able to see the actual output and judge for yourself than letting some stupid test case (which could also be buggy) assert some things.
>>
i wish to learn lamb the calc you less but i only know two ring my sheen :(
>>
>>61375040
You don't know how to use a debugger.
>>
>>61375088
>Unit tests are also a horrible waste of time.
>They are absolutely hopeless at finding bugs or even proving the implementation works as intended.
Wrong.
>stupid test case (which could also be buggy
Also wrong.
Manual human testing is only superior to unit testing when the human in question is stupid and cannot write good unit tests.
>>
>>61375042
static_cast
>>
>>61375013
yeah we know
>>
>>61375112
Why?
>>
>>61375127
>he cannot into greentext
>>
>>61373492
what i struggled with a long time that nobody would ever explain to me properly was what the 'point' of pointers was.

yea no shit it's a reference to a spot in memory, but why? why not just use the normal variable?

this is all language dependant but you'll find most work like the following:

function main() {
int x = 0
ourfunction(x)
print 'main-' + x
}
function ourfunction(int x) {
x += 2
print 'ourfunction-' + x
}


the output of this will be:
ourfunction-2
main-0

this is because most languages pass variables by VALUE. if you change the x within the function it allocates a new area in ram and copies your new value into it rather than changing the original x from main.

what if you want to change the original x variable from main? well then you need to pass the variable by REFERENCE.

visual basic of all things has very clear syntax for this:
function newfunction (ByRef x as int) {
x += 2
print 'newfunction-' + x
}


if you replaced our above call to ourfunction with newfunction instead you would end up with the following output:
newfunction-2
main-2

any subsequent uses of x in main would then have a value of 2 instead of 0.

Using a pointer is basically exactly the same as that ByRef syntax. Changing the value pointed at by a pointer changes the value in the original spot in memory so anything that is POINTING to that referenced memory address will be changed
>>
>>61375133
Because C-style casts are equivalent to reinterpret casts and reinterpret casts are 9 times out of 10 undefined behavior
>>
>>61375088
Manual testing is great but you can automate parts of it with automatic testing. Manual testing is a chore so automating parts of it is a good idea. Unit tests automate part of manual testing so hence they are a good idea.
>>
>>61375162
It's not undefined behavior there.
>>
>>61375162
I'm dereferencing a null pointer.
Do you think I give a shit about undefined behavior?
>>
fuk u
>>
>>61375228
you're waifu a shit
>>
 fuk u 
>>
>>61375245
(defstruct shit)
(defvar youre-waifu (make-shit))
>>
>>61375088
automated testing should not replace manual testing, it simply catches a lot of shit before it even arrives at manual testing
>>
File: python-2.png (97KB, 1271x648px) Image search: [Google]
python-2.png
97KB, 1271x648px
python is so BASED, you can just write a size 5000 lookup table instead of using regex!
>>
>>61375228
>>61375242
>>61375245
>>61375312
underrated interaction + POC lisp
>>
>>61375312
define_method(:assert) {|b|
raise unless b
}
Shit = Module.new
Person = Class.new {
attr_accessor :waifu
}
You = Person.new
(You).waifu = Person.new
(You).waifu.extend Shit
assert( (You).waifu.is_a? Shit )
>>
>>61375346
I hate python but if a lookup table us truly faster, easier to read and easier to maintain than a regex, it's a better solution
>>
>>61375346
Python is literally the language for dropout brainlets.
>>
>>61375346
What does that have to do with python specifically?
>>
>>61375346
lookup tables is a well know optimization technique.
>>
>>61375359
Please.
Please no.
The memes.
Please god no the memes.
They is too dank.
>>
var boy = {"top" = "tshirt", "bottom" = "jeans"};
var girl = {"top" = "blouse", "bottom" = "skirt"};
function crossdress(boy) {
boy.top = "blouse";
boy.bottom = "skirt";
}

rate my code
>>
>>61375346
I have trouble believing a 5000 entry lookup table is going to be faster than just calculating the numeral. That table is going to span several pages so access time is going to be a bitch.
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
I like visual studio because it does a good bit of the setup/tedious shit for me. If I need to use java, what would be the best/lowest effiort IDE to go to between netbeans and eclipse?
>>
>>61375408
boy === girl //false 

Sorry anon but you can't change what's inside.
>>
>>61375416
i'm not saying it's not optimal, i'm saying why include it in a book about how to program python? everyone knows how to make a table, fewer know regex
>>
>>61375432
IntelliJ IDEA
>>
File: what.jpg (9KB, 667x69px) Image search: [Google]
what.jpg
9KB, 667x69px
>>61375445
>===
>>
>>61375447
Because hard-coding is the Pythonicâ„¢ way
>>
>>61374595
>No such thing.
I agree, what they should be referring to is premature code solidification. Earlier on in development you wish for your code to be more malleable because you're not sure what your systems will look like. So you shouldn't build in any requirements you don't need into your API.

Most of what people call "premature optimization" doesn't touch this though.
>>61375346
They should just memoize it if they're having issues.
I imagine with how slow operations can be in python a lookup table would often be a good solution.
>>
>>61375408
0/10 not correct
function DressedPerson() {}
DressedPerson.prototype = { top: null, bottom: null };
function Boy() {
DressedPerson.call(this);
this.top = "tshirt";
this.bottom = "jeans";
}
Boy.prototype = Object.create(DressedPerson.prototype);
Boy.prototype.constructor = Boy;
function Girl() {
DressedPerson.call(this);
this.top = "blouse";
this.bottom = "skirt";
}
Girl.prototype = Object.create(DressedPerson.prototype);
Girl.prototype.constructor = Girl;
function crossdress(person) {
console.assert(person instanceof DressedPerson);
if (person instanceof Boy) Girl.call(person);
else if (person instanceof Girl) Boy.call(person);
}
>>
>>61375458
nigga I aint paying for that shit
>>
>>61375546
It's free, you stupid faggot.
>>
>>61375555
yeah for the gimped version
>>
>>61375445
>Sorry anon but you can't change what's inside.
On the contrary, to add to this: >>61375530
function doSurgery(person) {
var chainLinkToChange = person;
while (chainLinkToChange != null) {
var nextLink = Object.getPrototypeOf(chainLinkToChange);
if (nextLink === Boy.prototype) {
Object.setPrototypeOf(chainLinkToChange, Girl.prototype);
return;
} else if (nextLink === Girl.prototype) {
Object.setPrototypeOf(chainLinkToChange, Boy.prototype);
return;
}
chainLinkToChange = nextLink;
}
}
>>
>>61375346
A hash table would be much faster, and if you need to validate a lot of roman numerals it's the only reasonable solution.
>>
>Decided to learn C#
>After learning the fundamentals no idea on what to do next
>Now learning C++
>>
>>61375640
As a self-identifying shitlord, I have only one thing to say about this code.

Ahem:
"Ree."

That is all.
>>
>>61373016
Are you retarded? The Linux kernel is rigorous when it comes to binary interfaces. Breaking user space is essentially the worst thing you can possibly do as a kernel developer, and there are quite a lot of ways to fuck up. It's guaranteed to make Linus slap your shit in public.

Microsoft used to care about this stuff. There's a lot of buggy ass programs Windows treats specially just to make sure they work. At some point they stopped caring though. Some time around Vista they started making all-new APIs for everything that were nothing but vaporware, the only result being lost market share to the web. They're returning to form but it's a pretty bad track record.
>>
How the fuck do I learn a programming language without feeling lost after learning the fundamentals?
>>
>>61375571
There's nothing in the non-community version that you'll need.
>>
>>61375791
By using it.
>>
>>61373315
>being this fucking stupid

Program design starts with data structures. Once you get those right, the algorithms fall in place quite neatly.
>>
>>61375772
Does KFC have their own OS yet?
They should write the kernel from scratch and publish it as Kernel Sanders
>>
>>61375801
Yeah but you don't need to actually write either of them, they're both already written for you, you just use the standard data structures and algorithms and build your code over those.
>>
>>61375791
Dont just copy and paste.
It may seem silly, but type out all the examples.
And dont jump immediately to the exercise solution.
>>
>>61375460
>comparing strings to ints

Now that's what I call retarded
>>
>>61375845
>type out all the examples.
actual brainlets out
>>
>>61375793
>database tools
>any web support
I do mostly backend and a little bit of front-end if needed. Perhaps I'll just pirate it like I used to do with VS
>>
To sort a list of words in the file:

List<String> sorted = new IterableAsList<>(
new SortedIterable<>(
new SplitText(
new BytesAsText(
new InputAsBytes(
new FileAsInput(
new File("/tmp/names.txt")
)
)
),
new StringAsText("\\s+")
)
)
);
>>
>>61375891
in Haskell this is just
fmap (sort . words) . readFile
>>
>>61375864
typing out examples when learning is the proper approach
when you learn math, you solve problems, you dont just examine solutions
same with programing
>>
>>61375878
If you need the premium features they offer, you can afford it. If you're a student, you won't need any of that shit, and if you're a hobbyist, you won't need any of that shit.
>>
>>61375772
The new API functions they introduced around Vista are all pretty useful actually, it took some time for developers to start using them because compatibility with XP was a big concern for a while but anyone writing new software will be using the new API functions now that you can finally safely assume the user won't be running XP.
>>
>use dark on light color scheme
>yellow text shows up
REEEEEEE
>>
Spending my time among Elixir, Clojure, and Haskell.

Feels comfy.
>>
>>61375908
In bash it's just sort.
>>
>>61375864
literally what is brainlet about that?
>>
for my first python project I think about a webdav client to download stuff from my university website
>>
>>61375827
The only data structures typical modern languages offer by default is some kind of dynamic array and a hash table. Those don't even scratch the surface of what's possible or even what's best for your program. They're generic solutions to common programming language problems like "how do I pass parameters to functions". Pretty much every modern language has those two structures baked right into their own semantics. Their implementations are just being nice and letting you play with their own data structures. Languages make it easy for you to use them so that the language as a whole will be nice, comfortable and malleable, not because they're the right tool for your job. They're the right tool for the language's job.
>>
>>61376009
How do you sort by lines?
Haskell:

fmap (sort . lines) . readFile
>>
>>61374374
I agree everything has a usecase,
pythons would be to substitute pseudocode at universities so dump ppl can actually run the pseudocode and dont have to work on translating it into a proper language.
Also script languages are generally good if you just want to explain a concept and quickly show something
>>
>>61376009
sorts by lines not words
>>
>>61375910
when you learn math, you don't copy down the example problem that have already been solved, brainlet
>>
>>61376074
>nothing in math is learned by memorization
alright
>>
What do you use linked lists for?
What did you use linked lists for recently?
>>
>>61376301
I wrote a garbage collector using them. The implementation is a linked list of every object ever allocated. Sweeping is just iterating through the list while freeing objects.
>>
>>61376301
My regular language is Common Lisp.
>>
>>61376301
>What do you use linked lists for?
anytime I need a list of indefinite length and I know I dont need random access.

>Do I know the length of the list in advance?
Array
>Do I need random access?
ArrayList
>Otherwise
LinkedList
>>
>>61376301
cons cells my dude
>>
>>61376301
i haven't used a linked list recently, since python lists aren't linked lists
>>
>>61376301
Linked lists are a terrible data structure and have few good use cases.
Only use linked lists if you are going to be a doing a lot of insertions.
>>
>>61376441
linked lists are incredibly flexible as long as you dont need random access
>>
>>61376497
Which you need in most cases
>>
>>61376301

I haven't found too many times where I'd actually want to use a linked list over something else. That said, the ideal use case for one is where you either need lots of insertion/deletion in the middle of a list. It's also useful if you want to do lots of insertion at the beginning or end of a list, and you can't have amortized time costs under any circumstances (as in real time software, or software which might find its way into real time software).

>>61376497

They're not exactly fast though if you're just iterating over the list and pushing at end. Cache locality is pretty important.
>>
>>61376497
Even if you don't need random access, dynamic arrays are almost certainly better. They have better cache locality, fewer allocations, and require less memory (by a constant factor, but depending on what you're storing this could more than double your memory usage).

I'd only reach for a linked list when storing large structures compared to the size of a pointer (perhaps megabytes or more) where the number of items I'm storing is usually small, but sometimes gets really big (ie, you'd have to manually shrink your dynamic arrays to prevent wasted memory), and I'm not doing any random access.

Even then, profile.
>>
>>61376507
most of the time I iterate though lists and dont use random access. linked lists are fine there.

when I do need random access, I find that arrays with integer keys often dont make sense. in that case I'll use an associative map or hashmap for constant time access rather than an array
>>
>>61376625
Link lists are far worse at iteration than dynamic arrays. You have to chase a bunch of pointers to random places in memory for a linked list, vs. dynamic arrays where you almost always have the next item in cache after requesting the first.
>>
File: Untitled.png (7KB, 902x273px) Image search: [Google]
Untitled.png
7KB, 902x273px
Problem time, /dpt/!

I want to render 3D beams of variable lengths. I want these beams to have borders which always remain the same width.

My first idea was to create a textured cube, and then scale that cube to achieve the beams I want. However, this gives me the problem illustrated in the image. The borders get stretched along with the rest of cube, breaking the look and feel.

How do I solve this stretching issue? Do I render the centre-cross and then the border separately? Or must I specify various fixed-length beams and use those instead?

I'm using OpenGL, if that matters.
>>
>>61376659
>>61376659
linked lists are only 1/3 slower
its not a huge diffrence
small price for the flexibility of a linked list
>>
>>61373420
>>61373492
>A pointer is the location of a variable in the memory.
>I can't even tell the difference between & and *

I'd just like to chime in and say this: think of pointers as either "looking" at the location of a box with something in it or looking at what's inside the box.

& would be used to look at the location of the box without regard to what's inside the box. * is used to look at (and get) what's inside the box.

Or at least that's how I think of it, maybe this is the wrong way.
>>
>>61376722
you could alter the way you access the texture map
>>
File: 2017-07-14-162345_1440x900_scrot.png (233KB, 1440x900px) Image search: [Google]
2017-07-14-162345_1440x900_scrot.png
233KB, 1440x900px
I'm too retarded for this shit.

I can understand the top line.

but can someone explain to me the second bottom line?
>>
>>61376754
>linked lists are only 1/3 slower
Depends on the operations you do on every node.
200 cycles is an L2 cache miss. So if you're within that, you operate on every node and your CPU is doing excellent prefetching (generally it's not that easy) you'd just be stomping your cache carelessly with random data. No penalty.
1/3rd is what a stupid person would say.
>>
>>61376861
>line
Do you mean vector or line of code?
>>
>>61376878
the bottom line of code.

why do you need to substact from the desired vector direction your ship velocity?
>>
>at interview
>"What's the difference between linked list and array?"

wat do?
>>
>>61376861
Look at the diagram in the bottom-left.

In order to change the velocity to the grey line, you need to impel the object by the bottom-right vector, the method gives you that vector.

t. I know nothing about game programming.
>>
>>61376911
Say what they are and what the advantages of each are.
It's an easy question.
>>
>>61376844
You mean alter the UV coordinates? That had crossed my mind, but then still the location of the location of the vertex would be altered due to the scaling.
>>
>>61376866
expect I literally profiled it before I made the comment

Linked: 2279733
Array: 1545755
>>
>>61376906
Because the resultant vector is the sum of the two others, so calculating one of those contributing vectors requires its subtraction.
>>
>>61376912
really?

I though you only needed a small rotation angle.

So, basically I use the bottom vector as a rotating force.

I guess I could limit it with a delta rotation.

>>61376945
man, I'm too retarded for vector math.
>>
>>61376930
the vertex isn't really a problem, the point is just that you are mapping the texture differently
>>
>>61376939
If this is a linked list traversal vs random access contiguous array traversal your profiling is wrong.
>>
>>61376960
>>
>>61376395
list is an abstract type that is not necessary implemented with a linked list.

>>61376301
lock free concurrency.

>>61376621
>amortized time
amortized time with linked lists is possible too when you use a node cache. the main problem is the fragmentation of the data which increase cache miss.
>>
>>61377003
import java.util.*; 

public class ArrayTest {

public static void main(String[] args) {
System.out.println("Linked: " + profile(new LinkedList<Integer>()));
System.gc();
System.out.println("Array: " + profile(new ArrayList<Integer>()));
}

static long profile(List<Integer> ints) {
int a = 0;
long startTime = System.nanoTime();
for (int i=0; i<100000; i++) {
ints.add(i);
}

for (Integer i : ints) {
a += i;
}
long endTime = System.nanoTime();
long duration = (endTime - startTime);
return duration;
}

}
>>
Why is programming so sterile and mundane?
>>
>>61377044
> java ArrayTest 
Linked: 38549662
Array: 24085667
>>
>>61377087
 24085667 / 38549662 = 62%
33% slower
>>
>>61377074
Try any Lisp.
>>
>>61375346

Hrm... you don't need a regex to validate though. You can do validation in the same step as conversion. If you encounter an illegal character as you're going along, you throw an error.
>>
>>61377044
>Java
Ah.
So you're probably not doing a node list vs contiguous array test then but rather a list of buckets vs contiguous array.
They're very similar in concept. Also I believe the arraylist is a dynamic array rather than a contiguous block.
Just guessing. That's fine. It's certainly a lot better than linked lists.

But you're basically profiling two special cases of linked lists here.
>>
>>61377023
I guess that makes sense.

[spoiler]Not really, I'm retarded[/spoiler]

but thanks.
>>
>>61376960
Subtraction of vectors can be understood as creating a vector that if placed at the end of vector A (the head) point towards the end of vector B. >>61377023 See the dotted line here.
That vector, when placed at the origin (as vectors are) is the return of the function.

I don't see the confusion really. It's pretty clear.
>>
>>61377135
back 2 school

this is basic algebra bro
>>
>>61377147
>>61377152
is there any math I need to study before linear algebra?
>>
>>61377118
Staring at a screen for long periods makes my eyes heavy. I'm worn out, and I haven't even started. There's a reason many successful programmers move into management positions, etc or simply stop programming anything but hobby projects.
>>
>>61377186
>There's a reason many successful programmers move into management positions, etc or simply stop programming anything but hobby projects.
interesting
>>
>>61377172
I wouldn't say so. At least not the vector math bit.
You should have questions by now though. Maybe you're tired? This really isn't hard.

Do it on paper with numeric examples maybe.
>>
>>61377219
man, I never put attention in math in school and I hate it.
>>
>>61377186
I understand you.

I programme only as a hobby, it's not what I actually do. So I suppose I'm not 'forced' to do it.

I'd recommend an actual physical hobby, like walking or painting. Then come back to programming when the fancy takes you.
>>
>>61377132
ArrayList is backed by an contiguous array. When the array's is full large, the internal array is resized. Essentially a vector in C++
>>
>>61377247
what do you do instead?
>>
>>61375891
Yegor stop posting.
>>
>>61377267
I'm a highschool chemistry teacher.

Where there is no programming whatsoever. I relax at home by fiddling with programming. It helps to relax me.
>>
>>61377304
I mentioned 'relax' twice, but whatever. I'm also drunk.
>>
>>61377232
Just explain to us what you're thinking about this. It's the only way to actually progress.

Perhaps you're confused about the context here? Like why you'd want that vector.
>>
>>61377304
nice.

you don't "waste" time preparing classes, though?

or you don't care about the students=?
>>
>>61376301
I use linked lists every day in Scheme for almost everything of course.
>>
>>61377342
>I use linked lists every day in Scheme
for real work?

or just playing in the terminal at the basement?
>>
>>61377333
I'm just trying to understand how do you get A from C by basically substracting it from A.

Is like making a hen from a egg that I made after getting the hen in the first place and the egg in second place.

I just want to make a square to chase the mouse.
>>
>>61377341
Of course. But I'm an old hand at it now. If I know I must teach... the halogens on Monday, I have all the shit already, from the previous years. A little bit of fiddling for the current year's stupid/bright kids, and I'm done.

On the weekends, I try to teach myself programming. It's interesting coming at programming later in life (I'm 38), and from a science background. I'm constantly thinking how I can apply stuff to chemistry/biology (I was a pharmacologist before a teacher, so protein folding, drug discovery type of stuff.) But mostly I just see how many fizzbuzzes I can do in various languages.
>>
>>61375223
>I'm dereferencing a null pointer.
no, you're not
>>
any libgdx guy here?

I have a chicken class that contains a 3D modelinstance and other data.

In my gameloop I have an arraylist of this chicken class.

but my problem is that I cannot render it.
modelbatch.render accepts a list of instancemodels, but I can't iterate over the chicken array because is not an array of modelinstances and sending the chicken.get(0).model gives me an error that is not a list.

help pls.
>>
File: kobold has seem some shit.jpg (39KB, 408x360px) Image search: [Google]
kobold has seem some shit.jpg
39KB, 408x360px
>>61377263
False. Since it's Java, only the pointers to the objects contained within the ArrayList are guaranteed to be contiguous. The objects themselves can be all over the place.
>>
>>61377470
Make Chicken inherit from 3D modelinstance (assuming it's a template or whatever that's called in Java -- Interface?) and then just override all the methods and point them to the member modelinstance's methods
>>
File: python-3.png (57KB, 1301x603px) Image search: [Google]
python-3.png
57KB, 1301x603px
>>
File: scr.png (162KB, 1680x1050px) Image search: [Google]
scr.png
162KB, 1680x1050px
>>61372924
>What are you working on, /g/?

Exploring the deepest, darkest corners of Racket
>>
>>61377548
What the fuck am I reading? How is it related to Python?
>>
>>61377544
I guess I'm retarded then.

thanks.

also, what's the diference between implements and extends in java?
>>
>>61377395
Ok. Well the velocity you want is one that would take you from the mouse to the cheese. That's a vector pointing from the mouse to the cheese with some magnitude. Our "desired velocity". So you can get that vector by subtracting the position of the mouse from the position of the cheese.
See the first line of code, it takes the target, subtracts it form the current position normalizes it (makes it length 1).
When that's done we have a vector pointing at our target from where we stand. If we multiply it by the max velocity to get the actual vector we would want. If you just apply this vector as the velocity the mouse will walk straight at the cheese with max speed. It's not what they wanted in this piece of code. What they wanted is a vector which they can apply as a force to eventually get the mouse to max speed in the target direction.
As you can see when DesiredVelocity==m_pVehicle->Velocity() the result is 0. Making no further change in velocity when you apply this as a force.


So this function is what they use to figure out the force to apply to the vehicle to get it to steer at the target over time. Outside this function you'd likely have something that takes the magnitude of this, normalizes it and applys some portion of the vector as a force to the vehicle. Bounded by the magnitude.

Read and post where I lost you.
>>
>>61377395
>>
>>61377571
I think I learned about this in uni a long time ago. Java doesn't have multiple inheritance, meaning you can only extend from one class. You can extend as many interfaces as you'd like, though, which basically does the same.
>>
>>61377571
Implements is for a class inheriting an interface, extends is for a class inheriting a class or an interface inheriting an interface.
>>
File: 1500066461598.jpg (126KB, 1920x1080px) Image search: [Google]
1500066461598.jpg
126KB, 1920x1080px
>>61377560
>Exploring the deepest, darkest corners of Racket

what did he mean by this?
>>
Does anyone know a good guide for making your own GUI framework? I'm using Rust and SDL. The problem I've run into is how to "attach" code to the button for it to run when clicked. Callbacks implemented with closures seems like the recommended way, as both GTK and Conrod toolkits work on it. My question is, are callbacks a good idea at all? I hear a lot of people complain about callback hell in node.js and I'd like to make this as easy on myself as possible
>>
>>61377186
Bright,pure colors drain you faster.
If your IDE/TE doesnt allow you to change the disgusting white background, then change.

Google a saturated color set generator and use those.
>>
>>61376861
It's basic phsyics/maths. If you add d_vdc - c_vec to c_vec, by definition you get d_Vec. This is why you return d_vec - c_vec, in the update phase you add this to your objects velocity vector, and it will produce a velocity pointong to the target
>>
>>61377568
the target audience.
>>
>>61377609
thanks, the last part make it clear now.

>>61377584
thanks it makes sense.
>>
>>61377670
>callback hell
A complaint that issues mostly from people who can't into promises or don't know about Function.prototype.bind.
Nothing wrong with callbacks, but if you have an eventing system and main loop built into the language/runtime a la Node's EventEmitter, it wouldn't hurt to try it.
>>
>>61377364
I think we both know the answer to that question. I do real work in my basement.

But I do know we have a CLfag in /dpt/ who writes command line utilities in CL at his job.

>>61377670
Callbacks were basically designed for GUIs. Don't be afraid. Callback hell is just when you have nested callbacks on callbacks, but for a GUI, you should only have like layer of callback.
>>
>>61377624
>Java doesn't have multiple inheritance
it kinda does with interface default methods
>>
>>61377822
That was a Java 8 addition and it was very much against the spirit of interfaces, basically a hack to get Streams working.
>>
What do you think about the openCV library? Is there a good intro/tutorial/book on it?
>>
File: fuck-you.jpg (416KB, 3000x2584px) Image search: [Google]
fuck-you.jpg
416KB, 3000x2584px
>>61375891
This is the most disgusting thing I've seen in quite a while… had to make this into a le epig meem
>>
Thoughts on Golang and Rust?
>>
thats a QT-pi programmer pengu OP!
>>
>>61375416
>accessing a hash table of 5000 entries is going to be a bitch

So… you're retarded?
>>
>>61377890
More like nolang
>>
>>61377873
>He doesn't know
http://www.takes.org/
>>
>>61377873
>This is why people need GC
I'd make GC illegal if I could.
>>
>>61377890
Used Go for a couple of jobs, it's alright but it get's really annoying really fast

Pros:
writing with it is pretty fast
goroutines are comfy
built in dependency management

Cons:
you set a data member to public by capitolising it
you cannot compile if you have unused variables, even while testing
GC
if I remember right, the opening curly brace for a function MUST be on the same line, otherwise no compile for you
dependency management sucks ass because it only works properly if it's on github
your source must be organized very particularly for multi-file programs, and how to organize it is poorly documented

also, it's not a system language, don't be fooled.
>>
>>61375447
>slower and more complex
Then get a regex book and you'll learn more than a cursory treatment in a Python or every other language that uses libpcre would give you. What the Python book WILL give you is a sense of when to use one solution over another. Regex golf is not a worthwhile sport.

>>61375891
Awesome. It's like JavaScript 1.1 all over again.

>>61377972
Shit up your own neighborhood, Ramakrishna.
>>
>>61377806
The problem with event loops and callbacks is they're equivalent to coroutines. You need extremely good programmers to make good, bug-free software. Do you think javascripters fit in that category?
>>
>>61378172
>they're equivalent to coroutines
Are you claiming that multithreading is easier than cooperative run-to-completion? Really?
>Do you think javascripters fit in that category?
I think you're generalizing.
What's your babby-safe solution, then?
>>
>>61378224
Coroutines aren't really green threads. You manually specify when to switch continuations.
>>
File: Kill me!.gif (2MB, 445x250px) Image search: [Google]
Kill me!.gif
2MB, 445x250px
>>61377873
>This is the most disgusting thing I've seen in quite a while
Probably not as bad as what I've been doing.
#include <stdio.h>

typedef double vec3[3];
typedef double vec4[4];
typedef double mat3[3][3];
typedef double mat4[4][4];

void** cyclicPermutation(void** matrix, int size, int y, int x){
double** temp;
int i, j;

if(size==3)
temp = (mat3)malloc((size_t)sizeof(mat3));
else
temp = (mat4)malloc((size_t)sizeof(mat4));

for(j=0; j<size; j++){
for(i=0; i<size; i++){
temp[j][i] = matrix[(j+y)%size][(i+x)%size];
}
}
return temp;
}

int main(){
mat3 testMatrix = { {1.0, 2.0, 3.0},
{4.0, 5.0, 6.0},
{7.0, 8.0, 9.0}
};
testMatrix = (mat3)cyclicPermutation((void**)testMatrix, 3, 1, 0);

int i;
for(i=0; i<3; i++){
printf("%1.f, %1.f, %1.f\n", testMatrix[i][0], testMatrix[i][1], testMatrix[i][2]);
}
}

It's far from working at the moment and I've lost sight on what I wanted to do, instead pursuing void pointers, not understanding what I'm actually doing.
>>
>>61378224
>Really?

Wait, so you think turning processor time into a manually managed resource and having subpar programmers handle it is a sound idea?

Write a really simple time-consuming function and watch as it completely clogs up your Node event loop. It's not just Node either; pretty much any event loop will get clogged by any function of significant running time, increasing latency of the entire system.

Any event loop. Try it.

>babby-safe

The kernel manages processor time for you by scheduling program execution.

Event loops are really about multiplexing multiple independent functions onto a single thread. It has lower memory usage due to not maintaining multiple execution stacks but in practice it is limited in what it can do by parameters such as the rate at which events arrive and the acceptable latency when processing them.
>>
working to break recaptcha v2 as my first deep learning project.

First I'm going to generate a dataset by just recording all my recaptcha solves I already do to shitpost daily.

Then I'm going to first try to solve the challenges where you have to select an image.

1. capture the recaptcha region with x11, to avoid injecting any js into the recaptcha iframe
2. if an example image is provided, use that image to generate embeddings by extracting the softmax from a pretrained Imagenet VGG.
2.1 if an image is not provided, google image search it, then generate embeddings from the first couple of results, then average them.
3. generate embeddings for all the images in the challenge, if |embeddings_example - embeddings_challenge_n| < epsilon, mark box n for later checking.
4. take random mouse paths from the mouse path database, since recaptcha actually check your mouse paths, and check all the marked boxes with


should be simple enough, will require 0 training, and even if it's not perfect it's going to be pretty fast to correct its mistakes by not automatically submitting.

For the challenges that have a mosaic of a photo and you have to summarily segment it, I'm pretty sure any random pretrained network is going to be accurate enough, since it doesn't have to be accurate at all to work. Even one of the latest YOLO architectures will probably work.
>>
>>61378488
Doesn't Google do this precisely to 'generate their dataset'?

You'd be reinventing their wheel.
>>
>>61378529
>Doesn't Google do this precisely to 'generate their dataset'?

Isn't that beside the point? If I'm effective at guessing the answer, I could improve my shitpost per hour rate.
>>
>>61378576
literally just turn on recap v1
>>
>>61378436
>Write a really simple time-consuming function and watch as it completely clogs up your Node event loop
Then don't do that. It really isn't hard to break these things up by using async/await.
>The kernel manages processor time for you by scheduling program execution.
Ayy hol up, now you're telling my babby-daddy programmers to
>smacks lips
coordinate tasks across processes that could be running simultaneously on different cores?

>>61378576
Spent that same amount of time mowing lawns and use the cash to buy a pass.
>>
File: brainlets.jpg (101KB, 750x802px) Image search: [Google]
brainlets.jpg
101KB, 750x802px
>>61378629
lawnmowing looks great on a CV
>>
>>61378576
Just get a pass.
>>
>>61378629
>Spent that same amount of time mowing lawns and use the cash to buy a pass.
or spend that same amount of money making a captcha bot and buy a 1000 zombie in a botnet for 5$ for unlimited shitposting potential

yeah im going with the captcha bot thank you
>>
>>61378726
>it's real
>he lost it in a car wreck
>he can speak
Holy fuck science has gone too far
>>
>>61375312
What esoteric programming language is this?
>>
>>61378529
>>61378605
>>61378738

>programming thread
>shilling pass instead of encouraging fun engineering a solution

literally what
>>
>>61378784
Please dont lump me in with pass shills your faggot.
Also why would you encourage him to feed more data to google?
>>
>>61378784
I didn't consider the potential of shit-training google. Carry on lad.
>>
>>61378726
Now I know where they got the inspiration from:
https://www.youtube.com/watch?v=J5NHUpKmhTY
>>
Has anyone tried pouchdb? Is it a meme or does it actually work?
>>
New thread:
>>61378870
>>61378870
>>61378870
>>
>>61378821
>training google
>>61378818
>feed more data to google


You have no idea how this works. If a publicly available pretrained network is answering correctly, google is getting 0 new data. Not only is labeling from today's network useless to train tomorrow's networks, but they probably already ran their data through pretrained networks as a preprocessing step (maybe they exclude examples where the networks they have are very certain, maybe they exclude examples that are deemed way too difficult by those same networks).
>>
proper new
>>61378912
>>61378912
>>61378912
>>
>>61378902
>probably
>still have to spend months feeding it and google data before its even iffy
>any data at all to them
fuck off
>>
>>61378629
>break these things up

You're essentially programming in some bastard variation of continuation passing style, a form intended only for compilers to consume. You take a function and cut it up into unreasonably small pieces and weave their execution through the event loop. Little atoms of code all over the timeline. Suddenly, every function turns into async/await, not one of which returns useful results. Code looks nicer but program flow is still unclear. One of them blocks and the whole process degrades. It's great for system calls but an absolute mess for regular API code. Try it with a regular expression with pathological behavior.

>now you're telling me

I'm telling you schedulers don't depend on programmers so they won't fail. You can easily guarantee real time performance. Even Node will eventually move in that direction. The web already has "worker threads". Node has several half-baked extensions and an old pull request that morphed into a sophisticated object serialization API, which will serve as the prelude to interprocess communication.
>>
>>61378957
again, you really don't understand this.
>still have to spend months feeding it and google data before its even iffy
no, I don't have to feed it a single image to train it.
>>
>>61379007
you still have to solve capchas you fucking retard.
>>
>>61379018
holy fucking shit, no I don't! are you trying to be retarded on purpose??? what part of ``pretrained network'' and ``using the softmax to generate embeddings'' do you not understand???
>>
>>61379046
> by just recording all my recaptcha solves I already do to shitpost daily.
>>
>>61379064
ok, you're just trolling me. you can't not understand the concept of a validation set.

That's just required to sanity check and evaluate my model while i'm building it, and it could be as low as 10 examples for this application.

>b-but you have to send g-google 10 examples
you're retarded AND autistic if you don't realize that there are many orders of magnitude more examples being validated each day by google and that my 10 example validation set is completely insignificant.
Thread posts: 321
Thread images: 20


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