Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 2.23 MB, 3840x2160, 1538945408235.jpg [View same] [iqdb] [saucenao] [google] [report]
68098389 No.68098389 [Reply] [Original] [archived.moe] [rbt]

What emulator software are you writing up /g/?

Previous >>68091443

>> No.68098398

>>68098389
Kpop fags get out, post anime girls

>> No.68098409

For me, it's the zig guy

>> No.68098410
File: 7 KB, 480x360, 1527831486059.jpg [View same] [iqdb] [saucenao] [google] [report]
68098410

Is there a sane, simple to use C++ socket library that also supports IPv6?

>> No.68098414

>>68098409
this

>> No.68098439

do you guys have some (possibly obvious) tips regarding performance that you can share?

>> No.68098455

>>68098439
Use multithreading whenever you can

>> No.68098465

>>68098439
don't use multithreading whenever you can

>> No.68098475
File: 15 KB, 300x300, sedgewick-robert-image.jpg [View same] [iqdb] [saucenao] [google] [report]
68098475

>>68098439
You should check out my book.

>>68098455
Multithreading is a bit of a meme. Dividing a problem into smaller pieces gives a large benefit, doing those smaller pieces parallel gives a relatively small one.

>> No.68098477

>>68098439
Work on abstract types whenever you can

In days of my youth working with Linq in C# I always used .ToList() or .ToArray() methods, which is stupid and impairs performance if you can work with IEnumerable

>> No.68098479

>>68098439
Don't optimise before you're certain your code works as it should, in all cases.

Also, run experiments on runtime multiple times. Begin with at least 10 times in a row. If you've got the time, do it 100 times or more.

>> No.68098482
File: 80 KB, 504x688, regexbenchmark.png [View same] [iqdb] [saucenao] [google] [report]
68098482

>>68098439
Don't fall for the Java/C# meme

>> No.68098483

>>68098475
>You should check out my book.
which one?

>> No.68098492

>>68098475
Wait what? Aren't you wasting your cpu cores for not using them?

>> No.68098497

>>68098482
what language for implementing high level logic fast would you recommend?

>> No.68098504

>>68098492
Are you wasting your muscles by not continually flexing and relaxing them?

>> No.68098505

>>68098497
Pick your favourite Lisp.

>> No.68098512

>>68098475
Any sort of number crunching that can be parallelized gets a massive performance boost (see: any parallel numerical analysis, e.g. CFD applications such as Ansys Fluent) up until inter-process communication and disk I/O throttle it. Many well parallelized programs scale linearly with the amount of FLOPS it has available into 1000s of cores.

>> No.68098518

what would the time complexity be of a loop where after each iteration the iterator increases by a factor of 1, 10, 100, etc?

>> No.68098528

>>68098505
but i don't like any

>> No.68098532

>>68098504
this is what retardation looks like

>> No.68098536

>>68098518
O(n), I think.

>> No.68098538

>>68098528
Pick your favourite functional language.

>> No.68098543

>>68098483
It's simply called "Algorithms" by me, Sedgewick and some other dude. It's available for free, and there's also a course website as well as a free course on coursera with video lectures.

>>68098492
Quick google gives this (lmao medium)
https://medium.com/@chanakadkb/overhead-of-parallelism-d1d3c43abadd

>>68098512
For sure, in some applications there are massive benefits to parallelism, but those are fewer and farther in between than I think people in general believe.

>> No.68098545

>>68098536
but the iterator isn't being increased by a constant

>> No.68098561

>>68098518
log_factor(N)

Every iteration it "skips" another part of the problem. Check out complexity analysis of binary search trees, it's the same thing. You get log2(N) performance since you always divide the problem in half each iteration.

>> No.68098572

>>68098561
thanks i actually just then thought it may be log_10(n) so i apprieciate the validation

>> No.68098586

>>68098572
np bro <3

>> No.68098607
File: 111 KB, 640x484, 1495649258667.jpg [View same] [iqdb] [saucenao] [google] [report]
68098607

>>68098439
IOstream(e.g Cin and Cout) can be faster than the standard scanf and printf if you disable io synchronization, but having that io synchronization is generally helpful and in all other cases scanf and printf will vastly outperform the IOstream.
It is therefore a good general idea to just use scanf and printf instead of Cin and Cout.

>> No.68098609

>>68098479
>run experiments on runtime multiple times. Begin with at least 10 times in a row

this
when benchmarking remember to call GC right before calling benchmarked method
if you're benchmarking two methods try chaning their order and see if results are consistent
when measuring time always make at least 100 iterations of each method

>> No.68098613

>>68098410
>sane socket library
Does not exist, whatever the language.

>> No.68098700

>>68098613
Zeromq?

>> No.68098837

Should I even bother writing a CMakeList.txt for a project with 2 files?

>> No.68098845 [DELETED] 

So I'm still having problems with this piece of code:

I keep getting errors about how the argument of a a void function cannot convert a bool to bool[][20] even though I made clear everywhere the bool variable is an array.

Why is this happening?
both rows and columns are defined constants.
void Cell_Status(char cell[rows][column], bool cellState[rows][column]);
void check_state(bool cellState[rows][column]);


void Next_State(char cell[rows][column], bool cellState[rows][column]){

int x,y;

for(x = 1; x < rows; x++)
{
for(y = 1; y < column; y++ )
{
check_state(cellState[x][y]);
cell_status(cell[x][y], cellState[x][y]);
}
}
}



the problem is I'm passing arguments that should be arrays as single values.
So I tried what this anon told me >>68092686

The problem is that the check_status void needs an array to go through, what this function does is take one cell[x][y] and check the nearby cells like cell[x+1][y-1]

How should I fix this thing?

>> No.68098885
File: 136 KB, 311x360, Yuki-Using-Computer-GIF-yuki-nagato-38663943-311-360.gif [View same] [iqdb] [saucenao] [google] [report]
68098885

Today I did the Hackerrank problem Mini-Max Sum which asks you to find the maximum and minimum sums possible using 4 out of 5 input numbers.
Here is my code:
// Complete the miniMaxSum function below.
void miniMaxSum(int arr_count, int* arr) {
long int minsum, maxsum;
int min, max, sumnummin, sumnummax;
sumnummin = sumnummax = 0;
max = min = arr[0];
maxsum = minsum = 0;

//Go through input array to find max and min numbers
for(int i = 0; i < arr_count; i++){
//New max value
if(arr[i] > max){
max = arr[i];
}
//New min value
if(arr[i] < min){
min = arr[i];
}
}

//Go through array to find max and min totals
for(int i = 0; i < arr_count; i++){
//Add max number to maxsum
if(arr[i] == max & sumnummax!=4){
maxsum = maxsum + arr[i];
sumnummax++;
}
//Add min number to minsum
if(arr[i] == min & sumnummin!=4){
minsum = minsum + arr[i];
sumnummin++;
}
if(arr[i] != min & arr[i] != max){
maxsum = maxsum + arr[i];
minsum = minsum + arr[i];
sumnummin++;
sumnummax++;
}
}
printf("%ld %ld", minsum, maxsum);
}

>> No.68098908

>>68098439
yes, embrace object oriented programming asap.

>> No.68098919

>>68098837
nigga I've never used that shit for projects bigger than 5 C files

>> No.68098926

>>68098908
ignore this massive memer

>> No.68098995
File: 44 KB, 636x616, 1474325315193.jpg [View same] [iqdb] [saucenao] [google] [report]
68098995

Employed Haskell programmer reporting in

>> No.68099100

Newfag here
Best way to learn python for someone next to no experience in programming ? Reason for python is due to uni course

>> No.68099122

>>68098995

How about reporting out?

>> No.68099149

>>68099100
hackerrank

>> No.68099152

why is c so hard?

>> No.68099178

Help me understand circular references. This is invalid
// class A header
#include "B.h"
class A ...
B* b_ref;

// class B header
#include "A.h"
class B ...
A* a_ref


But this isn't.

// class A header
#include "B.h"
class A ...
B* b_ref;

// class B header
class B ...
class A* a_ref

// class B source
#include "A.h"


First, what's wrong with circular references? In many cases I know two classes to know about each other. And keeping a direct reference to the other (through weak pointers, not through raw pointers like I did in the example just for brevity) is very useful. Besides, if circular references are bad, why does the language give you a tool to include them through forward declarations?

>> No.68099179

>>68099152
it's not though, it's so simple

>> No.68099183

javalet here
How do I instantiate objects of different classes to an arraylist?
for instance, I have a super class called animals, with two subclasses: cats and dogs
I want to add 1 animal, 2 cats, and 2 dogs to my list.

>> No.68099198

>>68099183
Use base class pointers.

>> No.68099206

>>68099178
In 1st one, looks like both files will infinitely include the other file, which obviously wouldn't work

the 2nd one, B source includes A header, which in turn includes B header. There's no circular reference, no infinite inclusion of 2 files

>> No.68099218

>>68099178
Circular references are fine. They only cause issues with reference counting.

>> No.68099219

>>68099206
So the only problem is with headers including each other? Then forward declarations are fine to use like that? I've heard a few times that I should avoid forward declarations

>> No.68099232

>>68099219
>Then forward declarations are fine to use like that?
From your 2nd example, it looks like that. Expanded B.c would look like the following and contain forward declarations:
// class B source
class B ...
class A* a_ref

class A ...
B* b_ref;

>> No.68099246

>>68099183
I don't understand what your problem is
ArrayList<Animal> a = new ArrayList<Animal>();
a.add(new Animal());
a.add(new Dog());

>> No.68099255

>>68099218
>>68099232
Cool, that's a much saner approach than casting when I needed to access A from B

>> No.68099267

>>68099246
I just realized I sounded condescending, I was just trying to say that I wasn't sure if that snippet of code was what you were asking for

>> No.68099294

>>68098389
>Holds P1 stick
>Presses P2 buttons
What did she mean by this?

>> No.68099306

>>68099294
Only the cutest kpop idols are hardcore enough to control 2 players at once

>> No.68099337

>>68099294
she inputs cheat code.
I cant tell what game is on screen but Bubble Bubble for example does that.

>> No.68099346

>>68099306
So none of them?

>> No.68099348

Hello, programming help desk? I've started to misuse extension methods, please send help

>> No.68099428

>>68098439
Whatever you're doing you should probably consider hashsets

>> No.68099572
File: 369 KB, 1000x494, 1539753243576.png [View same] [iqdb] [saucenao] [google] [report]
68099572

JavaScript rocks!

>> No.68099606
File: 84 KB, 478x618, enemy of the state.png [View same] [iqdb] [saucenao] [google] [report]
68099606

>>68099348
Haskell will help you

>> No.68099623

>>68099572
Javascript paper! I win!

>> No.68099646
File: 48 KB, 979x505, shaders.png [View same] [iqdb] [saucenao] [google] [report]
68099646

I feel like I should've added some kind of timestamp to the printout

>> No.68099662

>>68098504
Is carrying a weight with one hand easier than with two?

>> No.68099672

>>68099572
Javascript scissors.. aw shit

>> No.68099821

>>68098885
That solution is pretty over-complicated.
void miniMaxSum(int array_size, int* array)
{
int min = INT_MAX;
int max = INT_MIN;
int sum = 0;
for (int i = 0; i < array_size; i++)
{
if (array[i] < min)
min = array[i];
if (array[i] > max)
max = array[i];
sum += array[i]
}

int minsum = sum - max;
int maxsum = sum - min;
print(whatever the fuck);
}

>> No.68100007
File: 6 KB, 488x43, Screenshot from 2018-10-17 15-33-18.png [View same] [iqdb] [saucenao] [google] [report]
68100007

kek

>> No.68100127

>>68098439
Avoid floating point operations and use lookup tables wherever possible.

>> No.68100130

>>68098885
>>68099821
Isn't this whole problem based on sorting an array of numbers and then getting the n objects from each end of it and sum them?
def minimax(argarr, count):
finalarr = sorted(argarr)
print("Min is {:d}, Max is {:d}".format(sum(finalarr[:count]), sum(finalarr[count:])))

I assume the inputs are caught before sent to it, so count is strictly < argarr.len

>> No.68100180

>>68099662
Multithreaded code is much harder to get right and even then Amdahl's Law applies. A 3-legged race is a better metaphor.

>> No.68100191

>>68098398
fpbp

>> No.68100194

Writing an OS is a good use of your time

>> No.68100216
File: 709 KB, 1000x1024, youshouldbeabletosolvethis.png [View same] [iqdb] [saucenao] [google] [report]
68100216

>>68100191
>calls it best post
>doesn't post anime girl
you had one job, anon

>> No.68100227
File: 50 KB, 400x400, 1526195828936.jpg [View same] [iqdb] [saucenao] [google] [report]
68100227

Quit your job
Make videogames

>> No.68100239
File: 36 KB, 550x550, todd.jpg [View same] [iqdb] [saucenao] [google] [report]
68100239

>>68100227
Why would you make video games when you could buy them

>> No.68100259

>>68100227
Most self-employed video game programmers fail.
Most employed video game programmers work horrible hours at mediocre pay.

>> No.68100290

>>68100259
ummm sweatie ever hear of a little game called, I don't know, maybe "Minecraft"? ;)

>> No.68100292

>>68098439
Locality is big given the way cache works. Compact homogeneous data structures will be much faster than indirect heterogeneous ones. This favors arrays over linked lists in defiance of big-O up to surprisingly high scale, this favors structs of arrays over arrays of structs, and this favors languages that give you control over layout and specifically over boxing/unboxing over more purist OO or FP languages where everything is boxed and every data structure is a rat's nest of pointers.

OTOH computers are fast now, so write that compiler in Haskell rather than C++ unless you really know you need sanic speed.

>> No.68100297

>>68100290
https://www.merriam-webster.com/dictionary/most

>> No.68100300

>he uses OOPs in 2018

>> No.68100313

>>68100290
you know what "most" mean, don't you?

>> No.68100346

>>68100290
eeeerm my dear ever heard of funny little guy called Jeff Bezos, also known as RICHEST FUCKING MAN ON PLANET? why don't you just make online bookstores?

>> No.68100347

>>68100300
>he uses a functional language in CURRENT YEAR

>> No.68100366

>>68100297
>>68100313
cave story, stardew valley, touhou, rim-world, ...
I could go on but if you're not good enough then you're not good enough ;)

>> No.68100383
File: 333 KB, 1106x962, anecdotal.jpg [View same] [iqdb] [saucenao] [google] [report]
68100383

>>68100366

>> No.68100393

>>68100290
>>68100366
Now compare it to buying lottery tickets.

>> No.68100403

>>68100366
>rim-world
you REALLY REALLY REALLY don't want to go there senpai

>> No.68100421

>>68100403
BUY MY BOOK AND SOUNDTRACK YOU MOTHERFUCKER.

>> No.68100454

>>68100300
>>68100347
multi-paradigm languages rock. I want a tool, not a church.

>> No.68100481

>>68100454
Multi-paradigm code is a mess

>> No.68100485

>>68100454
>keeping a handful of spaghetti in with your tools
why tho

>> No.68100660

>>68098389
How would you request a random entry from an API call in python?

>> No.68100696

>>68100660
J/k

>> No.68100820

>>68098389
Why would you allow overriding registrations with SimpleInjector?

>> No.68100827

>>68100481
Lisps eternally btfo

>> No.68100852
File: 69 KB, 723x542, 2018-10-17-170709_723x542_scrot.png [View same] [iqdb] [saucenao] [google] [report]
68100852

>>68098389
Just some file uploading tool, to make things faster

>> No.68100865
File: 1018 KB, 477x185, common_lisp.gif [View same] [iqdb] [saucenao] [google] [report]
68100865

>>68100481
>>68100827

pic related

>> No.68101066

Needs help here, this is a small bit of my code covering a void function that is not woking, this is how I tested it.

It should display a + character, but nothing appears.


void check_cell(char cell, bool cell_status);

bool cell_status[rows][columns];
char cell[rows][columns];

int main()
{
cout<< "hi"<<endl;
cell_status[3][2] = false;
check_cell(cell[3][2], cell_status[3][2]);

cout << cell[3][2] << endl;
cin.ignore();
cin.get();

}


void check_cell(char cell, bool cell_status){

if (cell_status == true){
cell = '■';
}
if (cell_status == false){
cell = '+';
}

return;
}

>> No.68101107

>get back to a project after 2 months
>not a singe comment throughout

>> No.68101115

Why did € turn into 竄 on different machine?

>> No.68101148

>>68100852
>if(d == True)
>if( ... )
>comparing booleans
stop

>> No.68101149

>>68101066
cell and cell_status are not initialized
check_cell does its operations on arguments that are passed by copy
should either work on a reference/pointer or simply return the char you want to set

>> No.68101169

>>68101066
you're working with declared variables, not pointers, you're changing the content of the cell in check_cell, not the one in cell[3][2]
it should be something like void check_cell(char *cell, bool *cell_status){
*cell_status ? *cell = '■' : *cell = '+' }
or similar

>> No.68101225

>>68098518
what do you mean increases by a factor?

for(i = 0;i < n;i+= k) is theta(n)
for(i = 0;i < n; i += k*i) is theta(sqrt(n))
for(i = 0;i < n; i *= k) is theta(log(n))

>> No.68101253
File: 47 KB, 979x505, shaders2.png [View same] [iqdb] [saucenao] [google] [report]
68101253

>>68099646
It's still going

>> No.68101264

>>68101149
>>68101169
error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]

>> No.68101295

>>68101264
you're supposed to feed it as check_cell(&cell[3][2], &cell_status[3][2]);
that's terrible form however, you should rewrite it to give it access to the arrays via pointers AND the coordinates as just values.

>> No.68101298
File: 806 KB, 1001x823, 1498564882917.png [View same] [iqdb] [saucenao] [google] [report]
68101298

>>68100227
My current plan
>Finish CS degree
>Become backend web dev, the good stuff
>Make games in free time
>Quit job when game earns money

>> No.68101408

>>68101295
>that's terrible form however, you should rewrite it to give it access to the arrays via pointers AND the coordinates as just values.


I've been trying to find a way to do since yesterday, would you please show me how you would rewrite it?

>> No.68101417

>>68101115
encoding

>> No.68101450

>>68100259
it's their own fault they fail. luck is a concept made up by garbage developers so they have something to blame for their lack of success

>> No.68101539

>>68101408
C isn't really my language but
void check_cell(char *arrcell, bool *arrstatus, int row, int col){
*arrcell[row][col] = *arrstatus[row][col] ? '■' : '+';
return;}

>> No.68101604

>>68101539
also, of course you should try{}catch{} it for oob within the function, but I really don't know what the scope of this is so you're on your own on that one

>> No.68101749
File: 1.61 MB, 480x270, laughing.gif [View same] [iqdb] [saucenao] [google] [report]
68101749

>his debugging is print statements

>> No.68101752

>>68101604
>you should try{}catch{} it for oob within
not in C he shouldn't
what he could do is check that row < rows and col < columns

>> No.68101783

>>68101752
better for sure, I don't know how much of a problem is writing/reading oob of a pointed array because, again, C isn't a language I use on the daily, I guess catching exceptions is better than expecting shit not to go awry inbounds

>> No.68101825

>>68101783
>I don't know how much of a problem is writing/reading oob of a pointed array
it is a huge issue of course, you read/write random memory
but exceptions do not exist in C. nobody will complain if you're reading/writing the wrong address, things will simply break randomly

>> No.68101856

>>68101115
Utf-8 doesn't have this problem

>> No.68101875
File: 658 KB, 802x767, java.png [View same] [iqdb] [saucenao] [google] [report]
68101875

>> No.68101877

>>68101539
>>68101604
I'll do with it, thanks.

>> No.68101924

>>68101875
SAVAGE

>> No.68101946

that bitch so uggo

>> No.68102000

daily reminder that Python is named after Monty Python, and like its namesake is vastly overrated among obnoxious, self-consciously "geeky", pseuds

>> No.68102018

>>68102000
>vastly overrated among obnoxious, self-consciously "geeky", pseuds
Yes

>> No.68102022

>youtube is still fucked up
the absolute state

>> No.68102025

>>68098398
fpwp
3d > 2d

>> No.68102125

>>68102025
your fucking gook doesn't even know how to play in a arcade.

>> No.68102226

What’s the best language to focus on if I want to make as much money as possible and I don’t care about anything else?

>> No.68102278

>>68102226
MUMPS

>> No.68102282

>>68102226
Java + JS

>> No.68102332

>>68102022
It's been fine for me since this morning

>> No.68102405
File: 238 KB, 1280x1110, 1525129586276.jpg [View same] [iqdb] [saucenao] [google] [report]
68102405

I took a beginner python course to fill out my electives in Uni. It was the only one that didn't have the word gender in it. I have a midterm tomorrow and I don't know how to study. It's not something you can read up on, it seems you just need to do it. Does anyone have a suggestion? It's entirely super basic stuff like printing a square of of different sizes out of a letter, or manipulating images.

>> No.68102424

// _: linear (1)
// ?: affine (0...1)
// !: intuitionistic (0...n)

type Iterator(A) = !(A *) ();

func map[A, B](xs: Iterator(A), f: !(A -> B)) -> Iterator(B) {
for x in xs {
yield f(x);
}
}

func filter[?A](xs: Iterator(A), p: !(!A -> Bool)) -> Iterator(A) {
for x in xs {
if p(x) {
yield x;
}
}
}

>> No.68102525

>>68102424
what language is this

>> No.68102542

>>68102424
Didn't you have proc instead of func at one point?

>> No.68102550

>>68102226
sql

>> No.68102559

>>68102525
Mine.

>>68102542
Yeah, I'm not committed to one or the other.

>> No.68102580

>write LLVM tool, build using GCC 8.2 and run tests
>all works flawlessly
>try building and using with clang++-7.0.0
>link time error because no standard library symbols
>fix it
>segmentation fault when calling LLVM API functions
What the fuck? I thought Debian built their packages with clang on top of that so how could it fail MORE than with g++?

>> No.68102646
File: 1.04 MB, 2023x1350, Mining.jpg [View same] [iqdb] [saucenao] [google] [report]
68102646

>>68102559
>Mine
Hey, that's not a bad name. The Mine language...
What kind of mine were you thinking of?

>> No.68102666

>>68101115
Chinks should be genocided for coming up with such an inefficient and trash writing system.

>> No.68102690
File: 96 KB, 750x750, 1512158239284.jpg [View same] [iqdb] [saucenao] [google] [report]
68102690

>>68102424
>;

>> No.68102711

Hey /g/ I want to write bots for simple games like Tetris, Zuma etc.. what programming language or library is best for this? How would you do it?

>> No.68102726

>>68102424
>>68102559
How is iterator(A) any different from !A?

>> No.68102744

>>68102690
Fuck off and kill yourself. Your taste in programming languages is appalling.

>>68102424
>func
>:
Fuck off and kill yourself. Your taste in programming languages is appalling.

>> No.68102773

>>68098389
I like kpop but imo OPs shoould have something to do with programming

>> No.68102785

>>68102773
Yeah, like anime.

>> No.68102822

>>68098995
Is Haskell any good?

>> No.68102838

whats the best C++ redis lib?

>> No.68102839

>>68102822
>Is <not a zero overhead language> good?
No, of course not.

>> No.68102844

>>68098995
why is cabal/stack still such shit

>> No.68102850

>>68102424
If you go full Pascal with the formals and actuals and replace assignment with :=, this could be something I'd use or work on with you.

>> No.68102853

>>68102424
Why is your syntax heavily imperative when it's clear you want a more functional thing?
Just copy Idris
map : [A, B] -> (xs: Iterator(A), f: !(A -> B)) -> Iterator(B)
for x in xs
yield f(x);

>> No.68102873

>>68102853
also leaving out the semi-colons as they're not needed if you use indentation like a good language.

>> No.68102879

>>68102853
Because he wants a good language not a bad language.

>> No.68102880

>>68102822
It's fine. I prefer OCaml as a language, but Haskell has its things going for it. Overall if you're planning on using one, you can easily implement functionalities from the other your yourself.

>> No.68102888
File: 9 KB, 225x225, download (4).jpg [View same] [iqdb] [saucenao] [google] [report]
68102888

>>68102873
>significant whitespace

>> No.68102892

I'm fucking bored /dpt/
I need to do something functional to do

>> No.68102898

>>68102853
>for
>yield

>> No.68102903

>>68102853
>>68102873
I don't know how anyone could possibly think this looks good.
Braces and semicolons should be mandatory for every programming language.

>> No.68102907

>>68102424
I can even encode exceptions.
// #: empty type
type Result(E, A) = ?(E * # ->) A;

The only way to produce a # for the continuation is to break out of the for loop that is acting like the exception handler (in general, the continuation is called with a value passed to "continue", as you might expect).

>>68102726
!A means "immutable A", which allows copying and dropping. !(A *) () means "a number of As followed by ()", which expands to "() or A * () or A * A * () or ...". There's a good reason to reuse the same symbol.

>>68102850
I am using := for assignment, yes.

>>68102853
>>68102873
There's more to functional programming than significant whitespace and currying.

>> No.68102918

>>68102888
Fuck off baby duck.
Python is not the only language that uses whitespace.
>>68102903
another little ducky.
>>68102907
i just meant the general syntax, your language reminds me of Rust which isn't a good thing.

>> No.68102946

>>68102903
semicolons are useless

>> No.68102964

>>68102918
nobody mentioned python though...?
significant whitespace is just objectively bad and end of "line" (allowing for multi-line statements, for readability more than length) demarcation is objectively good

>> No.68103001

Being a mathlet is so fucking tiresome I wanna kms.

>> No.68103005

>>68102907
btw i wrote a linear system f type-checker earlier today, was pretty interesting
i guess you could have a difference between !A and Enumerator<A> where !A is guaranteed to produce equivalent copies while Enum A could produce different values

>> No.68103019

>>68103005
whoops I mean Iterator not Enum

>> No.68103020

Say I want to experiment with neutral networks. Like get a feature vector out of some faces. How should I do it?
I don't have a GPU, or large hard drive space.
Can I just download https://github.com/seetaface/SeetaFaceEngine/tree/master/FaceIdentification, then paste the feature vectors into excel and do a linear regression?

>> No.68103022

>>68102964
>nobody mentioned python though...?
the only people who hate whitespace are either baby duck POO worshipers or people who just associate it with Python, or both.
>significant whitespace is just objectively bad
How is less characters type and on screen "objectively bad"?
How is not bike-shedding over
{

}

vs

... {
}

objectively worse
Whitespace especially scales better with more layers. Whereas brackets only get worse.

>> No.68103034

How do I make it so I can read/write txtfiles from a jar? I looked around and most places said to put any non-read only resources outside the jar, but I don't want to have to use an absolute classpath, I just want to be able to have the file being written/read from to be in the same directory as the jar.
I think I need to use getresourceasstream but I dont really understand it

>> No.68103083

>actually defending significant whitespace
>in the current decade

>> No.68103091

>>68102785
Anime is just a medium, it's about the content. If there is some cute girl programming, why not.

>> No.68103092

>>68103005
>>68103019
>i guess you could have a difference between !A and Enumerator<A> where !A is guaranteed to produce equivalent copies while Enum A could produce different values
You're more or less correct, and Iterator is also lazy.

!A is the regular exponential modality in the symmetric monoidal category of values (from linear logic) and !(A *) is in the monoidal category of endofunctors (it makes free monads). (A *)* would be the proper notation but that's confusing.

>> No.68103101

>>68103083
>no arguments
>in the current nanosecond

>> No.68103109

>>68103092
I guess if we're really talking about proper notation than Iterator(A) should be (A ⊗)* I.

>> No.68103123

>>68103022
anyone with half a brain knows that using formatting features as syntactic features is retarded
stfu with your retard ass assumptions and your retard ass ideas

>> No.68103124

>>68103109
what would that be like with ν / the greatest fix point

>> No.68103127

newly installed debian(new to linux) and trying to learn rust but rustc, rustup, and cargo commands aleturnl rreturn command not found

:~$ rustup doc
bash: rustup: command not found

>> No.68103153

>>68103123
>still no argument

>> No.68103167

>>68103153
>terminally blind

>> No.68103172

>>68103127
you have to install them you absolute weapon.

>> No.68103191

>>68103124
It's actually the least fixpoint.
Iterator(A) = μX. I ⊕ A ⊗ X
Greatest fixpoints come from codata in my language.

>> No.68103192

>>68103167
tell me why it's retarded
Hard mode: Use actual objective arguments and not subjective preferences and bias

>> No.68103213

>>68103191
i would have thought an infinite stream would be codata?

>> No.68103232

>>68103192
newline is different between OSes
can't break a long line
your code will literally break if you forget a tab

>> No.68103257

>>68103213
Iterator(A) is finite. If you wanted an infinite stream, you'd do:
type Stream(A) = A * Stream(A);

>> No.68103258

>>68103172
:~$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

/home/hikikomareep/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

/home/hikikomareep/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

default host triple: x86_64-unknown-linux-gnu
default toolchain: stable
modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: updating existing rustup installation


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done automatically.

To configure your current shell run source $HOME/.cargo/env

after logging out and logging back in, still getting same error
if i need to mess with PATH, what would i need to do with it?

>> No.68103277

>>68103232
>newline is different between OSes
>what is encoding
>can't break a long line
"enter"
>your code will literally break if you forget a tab
your code will literally break if you forget a semi-colon and a pair of brackets.

>> No.68103279

>>68103257
ah i see

>> No.68103290

>>68103258
add source ~/.cargo/env to your bashrc/zshrc

>> No.68103295

>>68103192
you’re trading a single extra character per line (that doesn’t require any thought btw) for the freedom to format your code in a way that makes it more readable. objectively fewer features just so you don’t have to type a single character

>> No.68103306

>>68098439
IRL performance > computability performance. Learn pomodoro and read more books fuckass.

>> No.68103321

>>68103277
>>newline is different between OSes
>>what is encoding
doesn't change the fact that the fucking characters are different
>your code will literally break if you forget a semi-colon and a pair of brackets.
>forgetting an invisible multiple-use character is the same as forgetting a single purpose visible character

>> No.68103340

>>68100852
if d
if f is not none and not d
if e and not encryption_lock
if g is not none
if b is not none
if f is not none

ftfy. also get rid of the parenthesis unless you specifically know that you need something evaluated in a certain order
Jesus. Why are you using python to just run shell commands. Write a bash script instead. sort out your life, kid

>> No.68103345

>>68103295
>freedom to format your code
Which causes bike-shedding which derails discussion which slows down language development. Which is why all languages nowadays have strict formatting guides or even auto-formatters. Gee, imagine if the language only had one way to do something so we didn't have to waste time and effort on meta-tools.

>> No.68103407

Why is opencv 200 megabytes? All I wanted to do was play around with neural networks, but it needs to install gtk and stuff. Why?

>> No.68103446

>>68103321
You're right, it's a lot easier to miss a semicolon than it is to miss a tab, I'll give you that.

>> No.68103481

>>68098439
Here are the only three ways to make things faster. Ready?
- do less
- do it less often
- do it faster
Biggest gains come from 1 and 2, but it’s too tempting to focus on three.

>> No.68103511

>>68103340
>get rid of the parenthesis unless you specifically know that you need something evaluated in a certain order
I hate this mentality
like braces being optional in C for single line if/etc
I add the braces anyhow, wow what a scrub right? I also avoid needless problems

>> No.68103519

>>68103407
How else will you look at the results of your experiments?

>> No.68103541

>>68103511
>me like typing more
>me need to see curvy lines all time
literally the mentality of a caveman/child.

>> No.68103571

I don't give a shit about your shitty api, I just wanna make a qt3.14!!

>> No.68103573

>>68103541
it's a bit more like "me like consistency leading to less cognitive overhead because I don't care for the (((convenience))) of minus two characters in a single specific use case"

>> No.68103607

>>68103573
>to less cognitive overhead
literally whitespace
You're lying to yourself if you think having to read brackets and semi-colons for scope is faster than whitespace.

>> No.68103615

>>68103573
>a single specific use case
which has a very non-zero likelihood of being altered out of that use case, and then breaking if you don't add the curlybois

I just fail to see the point in the slightest.The only thing I can think of is something to feel smug about, "heh, you DO realize you don't NEED braces on a one-liner, right...?"

>> No.68103629

>>68103607
brain-to-eye: Ok eye, look for something
vs
brain-to-eye: Ok eye, look for correct whitespace

>> No.68103638

>>68103629
Alright lad, you completely threw yourself with that post.
I am done.

>> No.68103650

>>68103638
Well good, I'm glad that I won this discussion.

>> No.68103656

why not just make a decent language that's independent of whitespace and semicolons?

>> No.68103673

Do browsers disable JavaScript alerts by default? I'm trying to do some hello work homework but the alert never shows. I copied everything from the book so it must be right. It won't show in IE either. How can I test if my browser is blocking it?

>> No.68103682

>>68103656
it's one or the other, you choose your fate
there is no alternative

>> No.68103684 [DELETED] 
File: 9 KB, 914x26, Screenshot from 2018-10-17 20-56-08.png [View same] [iqdb] [saucenao] [google] [report]
68103684

uh, does anyone who uses emacs/spacemacs know what I did to not be able to open this file?

>> No.68103690

>>68103656
then you eventually have to settle on
end
end
end

>> No.68103691

>>68103682
Actually OCaml works with neither

>> No.68103695

>>68103673
>Do browsers disable JavaScript alerts by default
usually they don't
show your code

>> No.68103702

>>68103690
>>68103682
wrong

>> No.68103710

>>68103656
how else would you mark end of block or statement?

>> No.68103712

>>68103684
>rwwxrwxrwx
wew lad

>> No.68103716

>>68103691
you're literally just replacing semi-colons with end.
>>68103702
show me a language that doesn't depend on end then, if not for important whitespace or some kind of line delimiter.

>> No.68103725

ZeroMQ or nanomsg?

>> No.68103731

>>68103716
>you're literally just replacing semi-colons with end.
Thank you for your ignorant input. ML languages use let in

>> No.68103750

>>68103710
don't use statements

>> No.68103764

>>68103731
ocaml uses let end, whats the fucking difference between type ... ;

>> No.68103791

>>68103764
stfu and kill yourself you ignorant fuck.

>> No.68103814

>>68103791
yes ocaml has some implicit delimiters, but on the surface, it's no different than whitespace. But on the inside implicit delimiting creates more complexity.

>> No.68103816

>>68103695
For some reason the connection fails every time I try to use the code tags. The code is https://pastebin.com/x4QkMNSs

And then there's the script file called myscript.js, that only has the line:

alert("text");

>> No.68103822

Are oracle java certifications worth getting? If so how do they exactly work? Do I just go somewhere and do the test or is it online?

>> No.68103837

>>68103290
i've been trying to look this up since you said it but i'm having no luck. i've figured out that it's bashrc i'd be editing, but otherwise im not sure how to do what you said to do

>> No.68103857

>>68103816
><body onload()>
what is this?
I haven't done js in a very long time, but to me this doesn't mean anything
what you should do is add an event listener on the document load in your js code

>> No.68103865

>>68103837
.bashrc (the . is important) should be in your home folder
edit it and add
source ~/.cargo/env
at the end

>> No.68103888

>>68103857
>what is this?
I don't know. I guess it means to trigger something when the page is loaded.
>add an event listener on the document load in your js code
Sounds like magic. I dindu understand at all. Gomen.

>> No.68103892

>>68098389
What human language are you learning alongside a programming language?

I'm learning korean while writing a compiler in C

>> No.68103923

>>68103888
search for the keywords in google, you'll get thousands of tutorials
check w3schools

>> No.68103924

>>68103892
russian, so I can read kolmogorov and many others in their native text

>> No.68103927

>>68103892
i speak 3 languages and my fourth needs a bit of practice
i still can't talk to humans properly

>> No.68104022

>>68103892
I speak 3 languages, 2 as a native. I'd like to learn moons in a near (or not so far) future.

>> No.68104054

>>68104022
learn it now mah nigga

>> No.68104087

>>68104022
do programming socks also help here?

>> No.68104099

>>68103892
>>68103924
>>68103927
>>68104022
>tfw only know american and c

>> No.68104111

>>68103865
done, but the commands still give the same result.
:~$ rustup doc
bash: rustup: command not found
i'm not totally sure whats up

>> No.68104120

>>68104099
back to your cave cnile

>> No.68104122

>>68104099
learn scheme
it's beautiful

>> No.68104130

>>68104111
>>68103865
could it have to do with the fact that env only contains the text
export PATH="$HOME/.cargo/bin:$PATH"

>> No.68104144

>>68104099
>tfw want to get into american, but only know british english
learning a 2nd lang is hard

>> No.68104175

>>68104130
open a new terminal
or simply type bash in your current terminal

>> No.68104178

>>68103690
>>68103656
scheme exists by the way
it uses brackets

no white space and semicolons

>> No.68104199

>>68104178
oh great, i get to trade curlies and semi-colons for a jungle of ((((((((((((())))))))))))))))))))).

>> No.68104218

>>68104199
someone post the "what a lisp programmer sees" vs "what a low iq neanderthal sees"

>> No.68104219

>>68103924
Wasn't that the guy who theorized that the most efficient possible algorithm for integer multiplication was n^2? Then, as the story goes, one of his grad students heard this and immediately went and invented an O(n^~1.5) algorithm, i.e. Karatsuba multiplication.

>> No.68104257

>>68104144
>>68104178
protip: in american, scheme uses "parentheses", not brackets

>> No.68104260

>>68104175
im sorry if im a brainlet but now im getting
:~$ bash
bash: /home/asdf/.bashrc: line 1: syntax error near unexpected token `('
bash: /home/asdf/.bashrc: line 1: `# ~/.bashrc: executed by bash(1) for non-login shells.'

>> No.68104273

>>68104260
wait why is it reading comments?

>> No.68104280

>>68104219
i can multiply in O(1) using lambdas

>> No.68104286

what's your favorite algorithm, /dpt/?

For me, it's Hashlife.

>> No.68104296

>>68104260
fucking hell lad just install rust with apt and be done

>> No.68104301

>>68104257
I call it parentheses in england too cause of programming. Not sure what all the 'brackets' are actually called here normally

>> No.68104322

Anyone here use VSCode with Go?
Trying to set it up on a USB but even when I override the go.gopath and go.goroot default settings, it complains that it "cannot find "go" binary".

What's wrong here?

>> No.68104324

>>68104301
in regular human world
parentheses -> ()
brackets -> []
curly_brackets -> {}

>> No.68104348

>>68104324
yes, but how about the british world? from 'grade school', I remember () being called brackets

>> No.68104365

>>68104322
Is go in the $PATH?

>> No.68104367

>>68104199
But you don't even pay attention to the parentheses
Your editor pretty much handles them for you

>> No.68104369

>>68104301
>>68104348
I'm not british but maybe "square brackets"?

>> No.68104374

>>68104369
That's how I've heard them named. t. britbong.

>> No.68104385

>>68104296
>debian
rust package is prolly 2yo

>>68104260
why is there a ( in your bashrc?
post it

>> No.68104388

>>68104280
let me explain
three = lambda expression
two = lambda expression
multiply = take two lambda expressions and merge them in a new lambda expression


how is this not O(1)

>> No.68104413

>>68104369
I guess so, I do hear about square brackets

>> No.68104437

>>68104365
I don't think so. Go's installed on the USB so I don't think it has any $PATH setup on the OS itself.
Also it's Windows.

>> No.68104445

>>68104385
too long so heres a link https://file.io/1ZtDy8
it should be identical to the original except for the last line because i replaced it with the copy form skel before editing it
im pretty sure its giving a syntax error from the parentheses in the comments

>> No.68104456

Anyone here into OpenGL? I need some resources or guides with comprehensive brainlet-tier explanations of projection/model/view. Using glm...

>> No.68104473

>>68104456
>OpenGL
>Brainlet
Unfortunately they are mutually exclusive.

>> No.68104487

>>68104456
I might be wrong but I believe that is regular ol' trig. try to find a pdf of a highschool trig book or something

>> No.68104489

>>68104388
yeah but how many beta reductions would it take to observe/discriminate the result?

>> No.68104510

>>68104445
>https://file.io/1ZtDy8
404

>> No.68104521

>>68103892
french english romaji

>> No.68104530

>>68104510
my bad it self deletes https://file.io/OJMMrK

>> No.68104537

>>68104521
sounds a bit difficult learning 3 langs at once

>> No.68104541

>>68104348
() brackets
[] boxes
{} squiggles

>> No.68104549

>>68101749
>he used gdb for the first time

>> No.68104554

How does free know the size of the memory block it needs to free?
Why can free stay in bounds and we as a programmer have to keep the allocated size somewhere around?
I don't fucking get it.

>> No.68104569

>>68104530
404

>> No.68104571

>>68104541
brit here, can confirm this

>> No.68104574

>>68104554
implementation defined

>> No.68104579

>>68104554
malloc and friends squirrel the size away somewhere inside/next to the allocation.

>> No.68104581

>>68104554
Your malloc implementation will store extra data in the chunk, usually just before the value it returns to the user.
Some malloc implementations will expose this information to you - glibc has the malloc_usable_size function, for example.

>> No.68104587

>>68104530
>>68104569
I've had the time to download it
I don't see what's wrong with it
you said you copied the file from skel, try creating a new .bashrc with only the line I told you

>> No.68104594

technically:
>>68104574
but I don't know of an implementation that does other than:
>>68104579
>>68104581

>> No.68104609
File: 380 KB, 1920x1080, od_wallpaper.jpg [View same] [iqdb] [saucenao] [google] [report]
68104609

>>68104489
>to observe
you mean count the evaluations and put that integer in a register and print it to your console

i don't know
>discriminate
well
let's say your discrimination is a comparison
you have a*b < c

if you have division implemented, it can take log(n)
you just divide both a*b by 2 and c by 2 (accounting for oddness by keeping the remainder i guess)
until one becomes 1
there's probably even faster ways, by using modular math or something

honestly i don't know the answer to your question and am just pulling shit from my ass hole


if anyone can explain in plain english why multiplication isn't O(1) in lambda calculus, i'd be happy to read that

>> No.68104616

>>68104473
well... I kinda understand what model/view does and how it works. but the main problem I have is projection. so I guess there is still a chance I can ascend. so please post anything if you have something...

>>68104487
>regular ol' trig
yeah, sounds reasonable. will try remembering/learning trig. anything else?

>> No.68104617

>>68104554
malloc actually allocates more memory than is necessary for the type and free uses those extra bits at the beginning to track how much memory has been allocated.

>> No.68104642

>>68098410
ASIO ?

>> No.68104660

>>68104594
>>68104617
uh, if the size needs to be stored somewhere, why is making it available to the user a requirement of the standard
this is valuable information ffs, and as a result a programmer has to duplicate this information

>> No.68104661

What the fuck is wrong with C++?
error: cannot convert ‘std::__cxx11::basic_string<char>’ to ‘const char*’

Why? This should be very, very easy.

>> No.68104672

>>68104609
What I'm trying to say, obliquely, is that the obvious way to build multiplication on Church numerals ends up being a lazy representation: you have a "thunk" that represents the result of the multiplication. This is a Church numeral, e.g. 2 is represented as the combinator that applies a function twice to an input. But: to actually determine that the value is "2" (that's what I mean by discriminate), we'd have to invoke that function. In LC our notion of "computation step" is beta-reduction; that "number" is going to end-up beta reducing a number of times proportional to its value when we invoke it on whatever term we want to use as our "discriminator".

TLDR: everything looks O(1)-ish under lazy evaluation, until you actually have to evaluate.

>> No.68104682

>>68104661
>What the fuck is wrong with C++?
Someone decided to make an abortion out of C

>> No.68104684

>>68102125
sorry about no gf

>> No.68104692

>>68104661
std::strings are not null terminated

>> No.68104705

>>68104660
I always thought it was a bit of an oversight. You can get a slim advantage by using something like malloc_usable_free.
Of course if you really care you'll use your own allocator.

>>68104661
call the c_str member function

no idea why it doesn't have a char* conversion operator tho

>> No.68104729

>>68104692
they have to be since C+11, though; data() has to return the same pointer as c_str()

>> No.68104734

>>68104682
Bloody hell, I've used it for ten minutes and I hate it already.
>>68104692
It's pointing towards some arbitrary data, not a text string.
>>68104705
Thanks!

>> No.68104738

>>68104672
aah i see
on an unrelated note, how would memory management work
let's say there is a lambda language, all it has is functions, thunks lazily representing "objects"

and you are allowed to bind names to the thunks

let's say
(define my_object <some lambda expression>)

but later i do
(define my_object <some other lambda expression>)

i'd have to enter the real world and free the first defintion right

i mean surely all those functions are on the heap taking some space

>> No.68104748

>>68104587
:~$ bash
bash: source: command not found
this is following your suggestion

>> No.68104773

>>68104388
fucking lol

>>68104489
https://www.di.unito.it/~deligu/CDR60_TCS/Martini.pdf
specifically theorem 1

or more generally http://www.cs.tau.ac.il/~nachumd/papers/TIH.pdf

>> No.68104774

>>68104729
>they have to be since C+11, though; data() has to return the same pointer as c_str()
are you sure?
https://en.cppreference.com/w/cpp/string/basic_string/data

>>68104734
>It's pointing towards some arbitrary data, not a text string.
std::string are expected to hold strings
imagine the shitstorm if this implicit cast operator were called anywhere a c string is expected

>> No.68104775

>>68098505
common.

>> No.68104780

>>68104705
>no idea why it doesn't have a char* conversion operator tho
Stronger type checking. You need to make that explicit by calling c_str.

>> No.68104785

>>68104748
uh maybe I'm the brainlet.. I'm used to zsh which uses "." and "source" the same way
try replacing source by a dot

>> No.68104792

>>68104774
Why can't they just use char* like ordinary people?

>> No.68104796

>>68104780
So make the conversion operator explicit. This problem has been solved since C++11.

>> No.68104805

>>68104774
>are you sure?
>https://en.cppreference.com/w/cpp/string/basic_string/data
sorry I'm an actual brainlet

>>68104792
not caring about memory management is nice

>> No.68104808

>>68104785
:~$ bash
bash: .: command not found
hahaha im sorry man this is frustrating

>> No.68104812

>>68104672
this is eval order dependent, and counting beta reductions isn't good enough as described in >>68104773

>>68104738
what

>> No.68104821

>>68104738
yeaaaah, that's hard to answer because it's kind of mixing levels. LC is an abstraction; we can implement it on a physical machine with memory and so on. When we do that, yes, we have to somehow handle allocation. LC evaluation tends to create a lot of one-off allocations too (think curried function application etc.), which is one of the reasons you don't see functional languages with no GC.

but the direct answer is that in a functional language, you'd really have more like (syntax is ML-ish, but doesn't really matter):

let my_object = ... in let my_object = ... in ...

in other words, you're not overwriting, you're rebinding a name in an inner scope.

remember, "let" in LC is just sugar:

let x = e = in t => (\x . t) e

sorry, I don't think that was very good answer, but it's a pretty open-ended question

>> No.68104847

>>68104808
try taping the command by hand in your terminal...

>> No.68104874

>>68104812
ok, yeah, brain fart on "proportional" and evaluation order is important

>>68104388
the take away is that reduction isn't free, that's the whole notion of computation in LC

>> No.68104881

>>68104847
youre my fucking savior thank you so much ahhahahhaa

>> No.68104894

>>68104881
oh shit but it isnt persistent

>> No.68104909

>>68104821
>sorry, I don't think that was very good answer
i would have preferred scheme syntax for this one
>let my_object = ... in let my_object = ... in ...
i don't quite get what the dots are doing and the "in" word

anyways
if i'm understanding you correctly, it's not feasible to not have to generate garbage if you are keeping track of scopes AND actual pointers in memory to functions
>>68104773
this theorem isn't in plain english and i'm not a pro

>> No.68104919

Brainlet tier question. I am learning about overflows. What number do you get after this operation in C. I would appreciate an explanation as well. Thanks in advance.
char c = 250;
c += 8;

>> No.68104928

>>68104919
3

>> No.68104940

Hey guys, I'm trying to read the instructions of my program in gdb, but it never enters the instructions of the library functions I use(strcpy), yet gdb can disassemble the function. What am I missing?

0x00005555555546b0 <+0>: push rbp
0x00005555555546b1 <+1>: mov rbp,rsp
0x00005555555546b4 <+4>: sub rsp,0x20
0x00005555555546b8 <+8>: lea rax,[rbp-0x20]
0x00005555555546bc <+12>: movabs rdx,0x65776f702d702d70
0x00005555555546c6 <+22>: mov QWORD PTR [rax],rdx
0x00005555555546c9 <+25>: mov DWORD PTR [rax+0x8],0xa212172
0x00005555555546d0 <+32>: mov BYTE PTR [rax+0xc],0x0
0x00005555555546d4 <+36>: lea rax,[rbp-0x20]
0x00005555555546d8 <+40>: mov rdi,rax
0x00005555555546db <+43>: mov eax,0x0
0x00005555555546e0 <+48>: call 0x555555554560 <[email protected]>
0x00005555555546e5 <+53>: mov eax,0x0
0x00005555555546ea <+58>: leave
0x00005555555546eb <+59>: ret

>> No.68104941

>>68104894
yeah, the point of putting it in your .bashrc is to make it persistent
.bashrc is sourced when launching a shell
if the command works (as it should) in interactive mode but not while being sourced it's above my expertise in bash, sorry

>> No.68104945

fuck IPLs and fuck FP, give me one (1) reason why I shouldn't write haskell like write my C
main = do p <- malloc
poke p (0x04030201 :: Int32)
peekArray size (castPtr p :: Ptr Int8) >>= print
free p

>> No.68104948

>>68104919
3
255 is your max number and when adding 8 to 250 you get 258. 258-255 = 3 so thats how many youd step over

>> No.68104957

>>68104919
Possibly undefined behaviour, depending on the signedness of plain char.
Do it with an unsigned type.

>> No.68104973

>>68104945
>i'm such a fucking mong i can only program one way

>> No.68104983

>>68104928
>>68104948
actually you would get 2, provided it's an unsigned char as >>68104957 pointed out

>> No.68104989

>>68104919
It's implementation defined. That means that the result may be different depending on what you what machine you run it on. In fact, if your char is actually signed, it may be undefined behavior - in which case your compiler may generate total nonsense code, because it assumed that an overflow will simply never occur.

In practice, however? You can expect the result to probably be 2.
250 + 8 = 258. But the range of a char is clipped to 0-255, and like a 24 hour clock once you hit 256 it immediately wraps around to 0 again. So 258 gets wrapped around to 2.

>> No.68105011

new thread naooooooo pls

>> No.68105014

>>68104928
>>68104948
>>68104957
>>68104983
>>68104989
I see, I thought numbers would "wrap around" only when the types would be defined as "unsigned". I thought we would get "negative numbers" as results when dealing with "signed types". Thanks a lot for the replies though. 2 seems to be the correct answer.

>> No.68105025

>>68104919
Say you have 4 bits. 0000

1111(15) is the maximum value they can hold.

The next value, 16, requires another bit 10000

If we assigned those 5 bits to our 4 bits of space, the result would be the smallest 4 bits 0000

250 as 8 bits is 11111010

258 requires 9 bits and looks like 100000010

If we assign those 9 bits to an 8 bit space, the biggest bit is lost and the result is 00000010 which equals 2

>> No.68105032

ok so I have a C program
and in my program i have some functions

but i know that some of those functions I'll use exactly once

is there a way i can "remove" those functions after i've used them the once, basically remove them so they don't take space in memory when the program is loaded

>> No.68105047

New thread:
>>68105035
>>68105035
>>68105035

>> No.68105048

>>68104973
>I must invent different ways of writing a program so I can feel special

>> No.68105053

>>68105032
write them inline

>> No.68105060

>>68104909
the dots just mean "any arbitrary bullshit here";

like, we're talking lambda calculus, right? there's no define. there's just lambdas.

we can define a syntactic sugar "let":

(let (x e) t)

but "under the hood" all we mean is ((lambda x t) e)

so the question doesn't really make sense in terms of "overwriting values", the example would really have been

(let (my-object e1) (let (my-object e2) t))

i.e. ((lambda my-object ((lambda my-object t) e2)) e1)

all the asymptotic-time and allocation questions come down to "how would you implement this on a real machine"?

>> No.68105068

>>68105032
No (excluding dynamic linking schenanigans) and it's not something you need to worry about.

>>68105053
If they're static functions, it's likely that the compiler will inline them for him.

>> No.68105114

>>68105025
Woah, thanks a lot for the in depth answer, anon. Definitely writing it down.

>> No.68105115

>>68104909
>this theorem isn't in plain english and i'm not a pro
"for a sane model of measuring performance in lambda calculus for 'call-by-value'-evaluation, turing machines can simulate LCs with running time f in O(f(n)^4) and LC can simulate turing machines with running time f in O(n).", i.e. LC isn't worse than TMs except for a constant difference and TMs are worse than LCs by at most a factor of f(n)^3 and some constant.

the second paper states more generally that for a sane definition (restriction?) of "model of computation" and sane model of measuring performance, you can pick your poison and either suffer a hit of a linear factor n in terms of time complexity or a hit of a linear factor n in terms of space complexity and simulate that model of computation with RAM, i.e. the RAM isn't worse than the model of computation except for a linear factor n.

>> No.68105225

>>68104973
main = do p <- mallocBytes size
fillBuffer p size
free p

How does this code make you feel?

>> No.68105227

>>68104940
strcpy may be inlined and if the passed string is a constant, the computation may be done in the static environment.

>> No.68106973

should collision code go in void update or not?

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action