[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: 325
Thread images: 29

File: 1480590811928.png (389KB, 934x1000px) Image search: [Google]
1480590811928.png
389KB, 934x1000px
What are you working on, /g/?

Old thread: >>58228476
>>
>>58232551
Trying to compile Haskell to intermediate C code so I can prove someone on /g/ wrong, but I don't know why it isn't working.
>>
Using higher order functions is not functional programming in the same way that using objects is not object-oriented programming.
>>
>>58232551
Tile based image compositor in OpenGL
>>
>>58232566
If you're compiling via LLVM, make sure you actually have LLVM
>>
About to write a library that reads from a kind of simple file format.

Should I have one Foo_Loader that the user gives a filename and a "callback" object that calls functions the user provides whenever it encounters a certain type
>>
>>58232592
Yes, that's a perfectly fine non-FP way to do it.
>>
>>58232592
Just use Parsec.
>>
>>58232592
>Paradigm-mixing OO and FP
Why is this allowed?
>>
>>58232592
I would return a stream. What if the caller wants to parse contextually? That will be very difficult if you make them provide callbacks.
>>
>>58232652
Because it's the only sane way to program.
>>
>>58232658
This.

>>58232588
Thanks for the tip. Is only LLVM supported?
>>
>>58232674
I think so
https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/code-generators.html

You can compile it to C--
>>
>>58232592
>>58232653
I mean, it's not impossible but what you'd be effectively doing is making the user provide all the base cases and recursive steps corresponding to the data structure you are loading instead of allowing them to do the recursion/iteration themselves.
>>
File: 6565645.jpg (129KB, 924x600px) Image search: [Google]
6565645.jpg
129KB, 924x600px
post your github
>>
>>58232715
https://github.com/enfiskutensykkel
>>
>>58232574
Structs and pointers?
>>
>>58232650
>>58232652
>>58232653

It's binary data by the way. Not text. And it can potentially be gigabytes large.
>>
>>58232715
>At interview
>So anon, we googled your github account and we found someone posting links to it on an archive for that 4chan website. Isn't that that anonymous forums where the pedophiles hang out?
>>
>>58232758
>>So anon, we googled your github account and we found someone posting links to it on an archive for that 4chan website. Isn't that that anonymous forums where the l33t h4xx0rs hang out?
ftfy
>>
>>58232738
If you're implementing objects by using PIMPL and vtables built from the ground up from structs and (function) pointers, then you're still just using objects.

If you orient your program around objects implemented in any manner, that's object-oriented programming.

>>58232740
As long as it's loaded lazily (which is possible with a stream) it's fine.
>>
>>58232758
>IT"S NOT PEDOPHILIA IF THEY ARE ANIME BAE'S
>>
>>58232758
> Isn't that that anonymous forums where the pedophiles hang out?
>...yes?
>Congratulations, welcome to Apple.
>>
>>58232777
>structs are objects
herewego.jpg
>>
>>58232738
>>58232777
And by "orient your program around objects" I mean "model systems as objects sending messages to (calling methods on) each other".

>>58232795
Who are you quoting?
>>
>>58232803
your mom
>>
>>58232777
>>58232803
But he's just using callbacks.
Those aren't objects.
>>
>>58232729
why are Scandinavian people the best programmers?
>>
>>58232820
DID ANYONE SAY CALLBACKS?
fs.readdir(source, function (err, files) {
if (err) {
console.log('Error finding files: ' + err)
} else {
files.forEach(function (filename, fileIndex) {
console.log(filename)
gm(source + filename).size(function (err, values) {
if (err) {
console.log('Error identifying file size: ' + err)
} else {
console.log(filename + ' : ' + values)
aspect = (values.width / values.height)
widths.forEach(function (width, widthIndex) {
height = Math.round(width / aspect)
console.log('resizing ' + filename + 'to ' + height + 'x' + height)
this.resize(width, height).write(dest + 'w' + width + '_' + filename, function(err) {
if (err) {
console.log('Error writing file: ' + err)
}
})
}.bind(this))
}
})
})
}
})
>>
>>58232821
Sharia law instills discipline and mindless obedience.
>>
>>58232820
I mean something like this. Which is essentially passing it an inherited object(using a class rather than a struct, with overloaded virtuals).

https://github.com/syoyo/tinyobjloader/blob/master/tiny_obj_loader.h#L222
>>
>>58232821
I don't think I'm any better than other people desu. My github is essentially a bunch of unfinished projects and some badly written tools I wanted to keep available for myself.
>>
>>58232795

You can't disprove this. In fact, most C literature refers to any allocation of memory as referring to an 'object'
>>
>>58232849
i was talking about Norway and Finland mostly, not Sweden
>>
>>58232877
Similar semantics and terminology doesn't make it similar concepts.

Just because a programming language has functions, doesn't make it functional.
>>
>>58232885
>Norway and Finland
It's cold and dark in the winter with not much to do besides wrapping a blanket around you, pile up on warm coffee and cocoa and start hacking away.
>>
>>58232877
yeah but.... sh.. shut up!!...
>>
>>58232906
what about girls
>>
>>58232914
If I was attractive enough to be with girls, I wouldn't spend my time on /g/ 20 minutes to 1 AM on a thursday.
>>
>>58232885
Whatever it is, it must be something common with Russians
>>
>>58232927
are you virgin?
>>
File: thinking-face.png (53KB, 256x256px) Image search: [Google]
thinking-face.png
53KB, 256x256px
>The similarity between the operating systems disappears when running in 64-bit mode because the function calling conventions are different. 64-bit Windows allows only four function parameters to be transferred in registers, whereas 64-bit Linux, BSD and Mac allow up to fourteen parameters to be transferred in registers (6 integer and 8 floating point). There are also other details that make function calling more efficient in 64-bit Linux than in 64-bit Windows... An application with many function calls may run slightly faster in 64-bit Linux than in 64-bit Windows. The disadvantage of 64-bit Windows may be mitigated by making critical functions inline or static or by using a compiler that can do whole program optimization.

Why does Windows do this?
>>
>>58232956
No.
>>
>>58232948
See >>58232906
>>
>>58232988
IDK, their version must be

Drink away depression with vodka and shoot krokodil with frend
>>
>>58233035
lol'd
>>
>>58232967
Because the people who program for Windows have no fucking idea what they're doing.
>>
>>58232885
You need to make more Scandy-threads, bra. I enjoyed the one we had recently.
>>
File: success.jpg (188KB, 1000x700px) Image search: [Google]
success.jpg
188KB, 1000x700px
>>58233065
>>
File: st george's cross.png (5KB, 1280x768px) Image search: [Google]
st george's cross.png
5KB, 1280x768px
>>58233126
>forgetting the best scandy flag
>>
>>58233167
>st. george
No. The Faroese flag, yes.
>>
>>58233179
looks like success really does breed jealousy, achmed :^)
>>
>>58233184
what
>>
>>58233126
I would totally live in Scandy-land if I spoke a Scandy-lang.

>Icelandic one has slitty eyes
It's funny because it's true.
>>
>>58233216
>icelandic
>>
>>58233167
>>58233184
>>58233211

English people are trying to redefine themselves as Scandinavians because of Brexit now and fear of being alone outside EU without any alliances.
>>
>>58233216
>>58233216
Icelandic girls will break your heart
>>
>>58233230
https://en.wikipedia.org/wiki/Danelaw
>>
>>58233216
>Icelandic
It's clearly the finno-ugric one.

>>58233232
Would totally hatefuck Björk
>>
>>58233243
We are taught this in high school, anon. You clearly don't remember that the vikings were driven away after losing the battle of Stamford bridge.
>>
>>58233271
I live in a village with a -by suffix
>>
>>58232566
I wouldn't bother. Haskell won't beat Java
Java is faster than Haskell.

http://benchmarksgame.alioth.debian.org/u64q/haskell.html
>>
File: portrait.jpg (40KB, 500x335px) Image search: [Google]
portrait.jpg
40KB, 500x335px
How many compilers have you written in Assembly language?
>>
>>58233375
It's easier to write idiomatic, safe, fast code in Haskell than it is in Java.
>>
>>58233375
worth pointing out that a lot of those are out of date for a lot of languages
>>
>>58233375
Explain to me what you think I'm trying to accomplish anon?

Protip: Running fast isn't the correct answer.
>>
how the FUCK do I move a file safely to a folder in C with linux
>>
>>58233392
In assembly? None.

In Java: one.
In C: two.
>>
>>58233415
>In assembly? None.
lmao
>>
So there are effect systems for determining what has to be done at run time vs. what can be done at compile time. Is there anything similar for ensuring certain things are done only at compile time?
>>
>>58233434
...what? Anything you need done at compile time hard-code or use something like template metaprogramming if you language supports it.
>>
>>58233456
It's not about what I want to be done at compile time, it's about separating out what MUST be done at compile time through inlining, constant folding, etc. This is in the context of language design, not using an existing one.
>>
>>58233422
lmao
>>
>>58233491
>>58233422
ayyy
>>
>>58233477
idris has type providers
>>
File: 1482586276695.png (3MB, 2048x1714px) Image search: [Google]
1482586276695.png
3MB, 2048x1714px
>tfw to smart for OOP
>tfw have to use Haskell
>tfw my iQ can't be measured on a human scale
>>
>>58233507
he's floating away on his head because he's an airhead, and really dumb, and all the anons below him are unimpressed with his ego
>>
>>58233507
Man, these >to smart memes have become strange.
>>
>>58233409
You copy the original file to the new folder, then delete the original file. If you're asking about implementation, you should read up on the C docs.
>>
>>58233507
Why is there a tennis ball pooping into a see of pee, poop and wojaks with microcephaly and anencephaly ?
>>
>>58233590
I haven't actually read any docs yet because all of the implementations I've been looking at somebody goes "oh that way isn't safe, because the system can potentially overwrite it and you can't use stat() here because" etc
>>
File: lenastddev.png (248KB, 512x512px) Image search: [Google]
lenastddev.png
248KB, 512x512px
Lena, except every R/G/B value is within 1 standard deviation of the average.
>>
>>58233721
I take it this wasn't written in C then
>>
When should I use A, B, or C?

/* Option A (stack) */
DataStructure foo;
init_data_structure(&foo);
/* ... */
destroy_data_structure(&foo);

/* Option A (heap) - allocate and free manually */
DataStructure *foo = malloc(sizeof(DataStructure));
init_data_structure(foo);
/* ... */
destroy_data_structure(foo);
free(foo);

/* Option B - pass pointer to pointer, allocate and deallocate in init/destroy functions */
DataStructure *foo;
malloc_and_init_data_structure(&foo);
/* ... */
destroy_and_free_data_structure(foo);

/* Option C - return pointer, allocate and deallocate in init/destroy functions */
DataStructure *foo = malloc_and_init_data_structure();
/* ... */
destroy_and_free_data_structure(foo);
>>
>>58233747

Because averaging in C is impossible?

Yes, you're right.
>>
>>58233503
That's not really what I'm looking for.

For example, something that MUST happen at run time is I/O. Something that MUST happen at compile time is using something that doesn't have a run time representation at all.

You can make a run time representation of anything, of course, but I'd rather be able to say that something must be done at compile time so that you know it will be 100%.
>>
>>58233760
>using CuckSharp

lel
>>
>>58233610
I understand your concern for safeness, but if you were truly that concerned you wouldn't be using C. You also have to keep in mind your use case and exactly what your code does that might be considered unsafe. If your code doesn't use threads then you don't have to worry too much about race conditions and building protections against that would be meaningless. Just write the code first and worry about safety later or - as many C programmers are wont to do - even never.
>>
>>58233770
Oh I personally am not overly worried, it's a very simple application, I just don't understand enough about this kind of thing to get a sort of metric sense for how safe my program should and should not be.
>>
Whats a good IDE for beginners with language C on Linux?
>>
>>58233786
Genuinely in the most non-meme sense, none. Get a good text editor and learn bash and Makefile, and all your compiler flags. Then once you're very comfortable but feel the need for an IDE, it'll make so much more sense and you'll be able to unlock the true power of IDEs.
>>
>>58233786
Genuinely in the most non-meme sense, none. Get a good text editor and learn bash and Makefile, and all your compiler flags. Then once you're very comfortable but feel the need for an IDE, it'll make so much more sense and you'll be able to unlock the true power of IDEs.
>>
>>58233786
Genuinely in the most non-meme sense, none. Get a good text editor and learn bash and Makefile, and all your compiler flags. Then once you're very comfortable but feel the need for an IDE, it'll make so much more sense and you'll be able to unlock the true power of IDEs.
>>
>>58233754
A for simple reusable data structures which you will manipulate directly.

B for complex objects which you will only pass to their own public interface functions. Return integer error codes or 0 for success.

C never.
>>
File: l.png (474KB, 512x512px) Image search: [Google]
l.png
474KB, 512x512px
>>58233721
What would you guess this was
>>
>>58233786
Linux basically is an IDE. Windows would be too if it wasn't so shitty that you need 3rd-party programs to get similar functionality with the terminal, file system, etc.
>>
>>58233786
Its called gedit and a terminal
>>
>>58233754
A whenever possible, B if not but you should allow the caller to specify the allocation/deallocation routines instead of forcing malloc/free on them. Naively using B can be quite detrimental to performance.
>>
>>58233786
>>58233854
Perhaps I should say that most Linux distros are IDEs, not Linux itself.
>>
>>58233851

Looks like it had something to do with fixed size regions.

Do the arrows point to the highest intensity in a given region?
>>
>>58233871
Why is B so widely used?

It's by far the most common approach I see going through other people's code.
>>
>>58233851
A vector field. Possibly the output of some filters/transforms marked.

Maybe color gradients and how much it changes?
>>
>>58233889
Because lots of people who use C have no idea why they are using it.
>>
>>58233889
because it's pretend-OOP
>>
>>58232715
https://github.com/torvalds
>>
>>58233754
A is best for code re-use and easiest to allocate many at a time.
>>
>>58233957
It's no more OO than the other options.
>>
>>58233803
>>58233854
>>58233865
>>58233877
Thanks, I'll go with vim then as I'm already comfortable with it
>>
>>58233865
>gedit
>not emacs
>not vim
Spotted the noob
>>
File: l.png (2MB, 769x769px) Image search: [Google]
l.png
2MB, 769x769px
>>58233898
>color gradients
Something like that.

Under "Neat Examples"
http://reference.wolfram.com/language/ref/GradientOrientationFilter.html

Super extra challenge mode: what about this one
>>
>>58232715
https://github.com/Charlotteis
>>
>>58233987
It's not, but it tries harder to look like C++ style OOP by pretending to have a "real" constructor and destructor.
>>
File: 1473892243386.jpg (203KB, 1500x844px) Image search: [Google]
1473892243386.jpg
203KB, 1500x844px
>Back in the old days, a device file was a special file created by running a crufty old shell script named MAKEDEV which called the mknod command to create every possible file in /dev, regardless of whether the associated device driver would ever run on that system. The next iteration, devfs, created /dev files when they were first accessed, which led to many interesting locking problems and wasteful attempts to open device files to see if the associated device existed. The current version of /dev support is called udev, since it creates /dev links with a userspace program. When kernel modules register devices, they appear in the sysfs file system, mounted on /sys. A userspace program, udev, notices changes in /sys and dynamically creates /dev entries according to a set of rules usually located in /etc/udev/.

Wow, what a pile of over-complicated shit. It's literally a billion times more complicated than it should be.
What the fuck was wrong with
>Driver creates new device file
>Kernel puts new entry in devfs
They did it with sysfs and procfs, so why not devfs? I'm developing a unix-like (pronounced: not unix compatible) kernel and I refuse to imitate this monstrosity.
>>
>>58234062
It's not trying to look OO. It might turn out that way but that's not the intent. I guess that does explain why it might get overused.
>>
>>58234034

Hmm, interdasting.
>>
>>58234080
What's the true intent then? Looks like encapsulation or data hiding to me though I guess that's not necessarily OOP-specific.
>>
>>58232715
>>58232758
I think I radiate a sort of cleanliness and charisma that sets me apart from the rest of /g/, so I'll be fine.
https://github.com/Dako300
>>
>>58234108
>data hiding
*information hiding
>>
>>58234108
Code reuse with allocation that can't be done beforehand for some reason. Now, the latter part is involved when doing encapsulation with an opaque pointer (PIMPL) and so that's a circumstance where Option A doesn't work.
>>
>>58234034
Honestly I have no idea.

The resulting image is larger than the original.
It seems like it works with concave shapes.

It seems like some kind of blur is used which goes from inside the image to the outside and being "restarted" on intensity changes forming concave shapes.
Maybe it's just some approximation using concave shapes. Maybe multiple shapes on each other.

Fuck if I know, I don't remember much from my image processing class.
>>
>tfw bought a new phone and can't open the damn case
>>
>>58234148
It's the output of a neural network trained to output RGB values based on coordinates.

http://www.wolfram.com/language/11/neural-networks/model-an-image-as-a-function.html

Pretty much that except in "In[8]",
{h, v} = Range[-1, 1, ...

got changed to
{h, v} = Range[-1.5, 1.5, ...


So essentially it's extrapolating beyond the boundaries of the image, not very well of course but it's a neat visual effect.
>>
>>58234342

Pretty neat, senpai.
>>
>>58234134
Thanks, that makes sense.
>>
>>58234342
Woah, thanks. That's looks really cool.
I was thinking in way more conventional terms. I'll add it to my cool stuff list.
>>
File: scrot.png (125KB, 883x500px) Image search: [Google]
scrot.png
125KB, 883x500px
>>58234342
should one invest in Mathematica?

its not like you can get real jobs with it, but for fun?
>>
>>58234554
You can do real jobs with it.

It helped Amy Adams decode that weird alien calligraphy after all.
>>
>>58233786
Emacs
>>
>>58234781
>Emacs reversed is Scam

no thanks.
>>
>>58234874
>Scam
>Macs
Macs are a scam, Emacs isn't
>>
>>58234975
>PC reversed is CP
Huh...really makes you think
>>
>>58235011
>>58234975
>implying Macs aren't a scam in their own right
>>
>>58235011
Computer Programs?
>>
File: peacekeeper.png (910KB, 789x508px) Image search: [Google]
peacekeeper.png
910KB, 789x508px
I hate brown people so much (anybody not white or east asian). Makes me want to do this.
>>
How does /fpt/ have 20 more posters than /dpt/.
>>
>>58234781
>>58233786
or vim
>>
>>58235264
I use emacs with evil mode personally.
>>
>>58235277
Evil mode is just wonderful
>>
>>58235314
Yes it is .
>>
How do I get motivated to spend time on my own projects after finishing work?
>>
>>58235358
Make projects worth doing
>>
>>58235358
Motivation:

Open source contributions look great on CVs because employers can easily verify your code quality.
>>
File: output.webm (1MB, 526x310px) Image search: [Google]
output.webm
1MB, 526x310px
Working on my terminal emulator and sixel machinery, done a pretty big optimization round on sixel parsing, it was using 50% of the time on just that before.

The downside is now the API for C1 control codes that deal with strings is a little more complex, but meh.
>>
>>58235771
Nice work, anon.
>>
>>58235771
looks pretty sexy
>>
typedef struct {
uint8_t low:4;
uint8_t high:4;
} still8;

int main()
{
still8 x = {.low = 12, .high = 4};
printf("%lu\n", sizeof(still8));
printf("%d %d\n", x.low, x.high);
printf("%d\n", *((uint8_t *)&x));
return 0;
}


1
12 4
76


Why am I just now learning about this
>>
FUCK
>>
test
testtest
testtest
testtest
>>
File: 1437497521042.jpg (60KB, 1280x720px) Image search: [Google]
1437497521042.jpg
60KB, 1280x720px
/g/ cool kids club checklist

[x] hate OOP
[x] hate IDEs
[x] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)
>>
>>58236145
[ ] hate OOP
[x] hate IDEs
[ ] use only Haskell
[x] never produce actually useful software (this is important)
[ ] wear knee socks
[ ] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (because too intelligent for them)

Do I make it in?
>>
what's the safest way to hash a pair of coordinates (x1,y1, x2,y2)? hash also needs to be same if input swapped like (x2,y2 x1,y1)
im thinking
concat((x1*x2) * (x1+x2), (y1*y2) * (y1 + y2))
>>
>>58236291
You could do it a little neater with an XOR
>>
>>58236337
like this?
long key = 0;
key = key + (x1 ^ x2) * 1000000000L;
key = key + (y1 ^ y2);

assuming coordinates are up to integer size only. actually the 1000000000Lis a bit overkill as I know that the coordinates won't go over 1000.
>>
>>58236424
use a faster bit shift instead of multiplication
key = key + (x1 ^ x2) << 16
>>
File: 132168911222.jpg (16KB, 512x288px) Image search: [Google]
132168911222.jpg
16KB, 512x288px
I would really like to learn more about C++
sure i could buy a book or just blindly google, but the best links & resources will come from you guys
for example, should i just use microsoft visual C++? because that shit is now nagging me for a key & i feel like theres probably a better program to use

is C++ a mistake?, should i go with something like delphi? if so does anyone have a link to borland for me to pirate? that shit is too expensive ill buy it if thats just the only option
for what i want to do i need a very flexible, powerful programming language, not babbies for training wheels shit
any recommendations or links would be appreciated
no bully pls
>>
How do you progress as a programmer? I feel like I've hit a brick wall. I know all the basics, OOP, a good amount of data structure and algorithms, and am pretty good at doing challenges like on CodeWars, but I'm having trouble organizing larger projects and putting everything together. I'm good at solving smaller problems in scope, but don't know how to break things down and organize them for a large project.
>>
>>58236564
Read source code of large, successful projects
Try to make small improvements
>>
>>58236564
>OOP
Did you mean "creating lots of busywork for yourself so as to perpetuate the fragile illusion of having actually structured your code"?
>>
What if I hate 4chan users but still come here because my soul is lost?
>>
>>58236626

kys
>>
>>58236547
You can use gcc or clang.
>>
>>58236628
well at the very least you can focus & become addicted to the USEFUL threads & information
that way you're learning while your soul catches a bus back to you
>>
How do I get as good as Terry Davis?
>>
>>58236634
>Stupid racemixer microcuck tripfag defending OOP
What a suprise
>>
>>58236547
Do you actually know how to program? If yes, the Bjarne's book is great, if not learn C instead. If you're on a windows machine you can use mingw which includes gcc.
>>58236564
Start small projects on your own, just things that you might find useful.
>>
File: 1479844810071.jpg (94KB, 1280x720px) Image search: [Google]
1479844810071.jpg
94KB, 1280x720px
>>58236145
>>
>>58236714
Watch his ASMR videos
>>
programming newfag, sitting down to learn C from "The C Programming Language" recommended on the wiki. It's second edition.

wrote the hello world from the first chapter, spent ages trying to figure out how to compile like a fucking retard, and got an error when I finally got it going.

The book says to write the hello world as follows:

#include <stdio.h>

main()
{
printf("hello world\n");
}


That gives an error indicating that it should actually look like:

#include <stdio.h>

int main()
{
printf("hello world\n");
}



Is my book just out of date, is there a mistake in the book, or am I doing something else wrong? I really would be down if my brand new (not particularly cheap) book is no good and out of date.
>>
>>58236756
It is 'slightly' out of date, but most of the stuff in there is still relevant.
It's just using something referred to as "implicit int", which means that when you don't specify a type for something, it defaults to int.
That isn't valid for newer code.
>>
>>58236787

That makes sense, thanks. So I should be mostly fine if I continue using the book?
>>
>>58236802
Yes. Programming hasn't really changed since the early 80s. C is still the best language.
>>
>>58236802
Yes. That is by far the most obvious thing in the book that is different. There are a few other smaller differences here and there, but nothing that massive.
You can just read
https://en.wikipedia.org/wiki/C99
and
https://en.wikipedia.org/wiki/C11_(C_standard_revision)
and that will tell you about most of the newer shit that changed.
>>
>>58236291
>hash also needs to be same if input swapped
awful idea, don't do this unless it is a school assignment >_>

check out https://en.wikipedia.org/wiki/List_of_hash_functions
for some ideas
>>
>>58236818
>>58236814

Awesome, thanks. I'm sure you can imagine, I was a little alarmed when the very first thing I tried to do from the book threw an error.

I'll keep at it.
>>
>>58236714
"If you aren't using it, there is a good chance you should get rid of it."
"Don't be a simple peasant."
"The difference between a master programmer and a bad programmer is one is lazy and the other is not."
- Terry Davis

I don't understand why he isn't more popular
>>
im having trouble visualizing how a computer works. Explain it to me like i'm an 8 year old please. So when its turned on, an electrical current flows through the machine and does what? pls no bully
>>
>>58236564
There are many ways to progress. It depends on your profile / level. How many years of experience do you have and what field?

For organizing your projects, there are industry best practices and software patterns to make your software modular/scalable. Knowledge of systems architecture is also a good thing (decoupling of tasks/systems at a higher level) for this purpose. If you just need raw speed then you have to learn data-driven programming and stuff like that.

If you are talking about code architecture, then "enterprise" patterns are always a good start, or just come up with your own ideas... art meet science type of thing...
>>
>>58236731
i can always dual boot a linux flavor if thats what you're getting at
if its better suited for programming
but what i make needs to run on windows, thats what all my customers are using
>>
>>58236858
>I don't understand why he isn't more popular
It's a conspiracy by the SJW zionist libcuck atheist illuminati to "reverse oppress" him for being white. They decided it at one of their weekly meetings
>>
>>58236877

magic, anon.

it's all just magic. the powers that be don't want us to know magic exists, so the invent all this "electronics" mumbo jumbo, shove a bunch of fancy looking stuff in a box, and tell you it's "science" and "physics" and whatnot.

When in reality, Bill Gates is a fucking actual wizard.
>>
I'm no fan of lawyers or litigation, but it's high time that someone defined "buffer overflow" as being equal to "gross criminal negligence".

Unlike many other software problems, this problem has had a known cure since at least PL/I in the 1960's, where it was called an "array bounds exception". In my early programming days, I spent quite a number of unpaid overtime nights debugging "array bounds exceptions" from "core dumps" to avoid the even worse problems which would result from not checking the array bounds.

I then spent several years of my life inventing "real-time garbage collection", so that no software -- including embedded systems software -- would ever again have to be without such basic software error checks.

During the subsequent 25 years I have seen the incredible havoc wreaked upon the world by "buffer overflows" and their cousins, and continue to be amazed by the complete idiots who run the world's largest software organizations, and who hire the bulk of the computer science Ph.D.'s. These people _know_ better, but they don't care!

I asked the CEO of a high-tech company whose products are used by a large fraction of you about this issue and why no one was willing to spend any money or effort to fix these problems, and his response was that "the records of our customer service department show very few complaints about software crashes due to buffer overflows and the like". Of course not, you idiot! The software developers turned off all the checks so they wouldn't be bugged by the customer service department!
>>
>>58236945
The C language (invented by Bell Labs -- the people who were supposed to be building products with five 9's of reliability -- 99.999%) then taught two entire generations of programmers to ignore buffer overflows, and nearly every other exceptional condition, as well. A famous paper in the Communications of the ACM found that nearly every Unix command (all written in C) could be made to fail (sometimes in spectacular ways) if given random characters ("line noise") as input. And this after Unix became the de facto standard for workstations and had been in extensive commercial use for at least 10 years. The lauded "Microsoft programming tests" of the 1980's were designed to weed out anyone who was careful enough to check for buffer overflows, because they obviously didn't understand and appreciate the intricacies of the C language.

If I remove a stop sign and someone is killed in a car accident at that intersection, I can be sued and perhaps go to jail for contributing to that accident. If I lock an exit door in a crowded theater or restaurant that subsequently burns, I face lawsuits and jail time. If I remove or disable the fire extinguishers in a public building, I again face lawsuits and jail time. If I remove the shrouding from a gear train or a belt in a factory, I (and my company) face huge OSHA fines and lawsuits. If I remove array bounds checks from my software, I will get a raise and additional stock options due to the improved "performance" and decreased number of calls from customer service. I will also be promoted, so I can then make sure that none of my reports will check array bounds, either.

The most basic safeguards found in "professional engineering" are cavalierly and routinely ignored in the software field. Software people would never drive to the office if building engineers and automotive engineers were as cavalier about buildings and autos as the software "engineer" is about his software.
>>
>>58236939

so bill gates is actually inside the pooter?
>>
>>58236877
There are trillions of circuits inside a computer and each one does something different, like printing out a document or clicking the mouse. It stands to reason that one of them creates the virtual worlds where everything inside your computer actually happens. These are real pocket universes where the documents on your hard drive are physical things. The circuits in your computer just let you manipulate them.
>>
>>58236960
I have been told that one of the reasons for the longevity of the Roman bridges is that their designers had to stand under them when they were first used. It may be time to put a similar discipline into the software field.

If buffer overflows are ever controlled, it won't be due to mere crashes, but due to their making systems vulnerable to hackers. Software crashes due to mere incompetence apparently don't raise any eyebrows, because no one wants to fault the incompetent programmer (and his incompetent boss). So we have to conjure up "bad guys" as "boogie men" in (hopefully) far-distant lands who "hack our systems", rather than noticing that in pointing one finger at the hacker, we still have three fingers pointed at ourselves.

I know that it is my fate to be killed in a (real) crash due to a buffer overflow software bug. I feel like some of the NASA engineers before the Challenger disaster. I'm tired of being right. Let's stop the madness and fix the problem -- it's far worse, and caused far more damage than any Y2K bug, and yet the solution is far easier.
>>
>>58236291
no, im doing something like getting the shortest path from A to B (which I already cached)
so I need it to return the same path for B to A
>>
>>58236945
>>58236960
>>58236978
>>>/r/rust
safety is a meme
>>
>>58237008
meant for >>58236833
>>
>>58236978
This won't happen with quantum mechanics since nerds won't understand it. Just be patient.
>>
>>58237008
>>58237021
you should change that logic outside of the hash function :/
also, make sure you're handling collisions
>>
>>58237023
I mean quantum computers
>>
>>58236971
Well, not exactly.

See, your computer is really a containment vessel for minor demons. These demons have access to the infinite knowledge of hell, and can slip between the worlds to quickly transport information from one demon to another. Programs are really just teaching your demon new spells.

Bill gates, jobs, etc are really powerful warlocks and wizards who bind great and powerful demons, and force them to grant the use of the myriad lesser demons under their control.

Get the picture?

Also, what do you think is really going on in those huge "super computer" complexes the NSA has? They're trying to bind the big guy himself.
>>
>>58237047
not really a hash function. just the hashcode method of the object for Set/Map purposes
>>
>>58236977

why do the circuits need a cpu, ram, etc. And how does each one of them do different things? is there a code stored in each one?
>>
>>58237081
still a hash function, you're thinking of a crypto hash function :P
if you're using a class like java.util.HashMap/HashSet etc it should handle collisions itself so you're fine then
python will handle them too with dicts/sets
>>
File: agentexplosion.jpg (31KB, 355x257px) Image search: [Google]
agentexplosion.jpg
31KB, 355x257px
>>58237085
Yes. The code is a secret number. Knowing the code gives you power over reality, but knowing multiple codes is very dangerous so we have circuits to know them for us. If you ever learned two by accident, you could explode.
>>
>>58237104

tell me. TELL ME ANON. whats inside these circuits or i'll blow your fuckin brains out
>>
>>58237018
The email was written Henry Baker in 2001, nine years before Rust was even concieved.
>>
>>58237150
YOU DON'T WANNA KNOW dude
>>
>>58237151
i wish rust had been aborted
>>
Trying to implement linked lists in Go but I'm having a hard time wrapping my head around it since I'm pretty new to the language.

https://hastebin.com/aqeruduxut.go

I keep getting:
.\linkedlisttest.go:33: cannot use list.myLast.myNext (type *Node) as type Node in assignment
.\linkedlisttest.go:35: invalid indirect of temp (type Node)
.\linkedlisttest.go:42: cannot use list.myLast.myNext (type *Node) as type Node in assignment
>>
>>58237150
Fine. FINE! Just one. But it's not my fault if anything happens to you.

Ready? It's e^(i*pi). But it ONLY works if you know it in hexadecimal. Okay? So just don't learn that and you'll be okay.
>>
>>58232967
>>58233053
It's probably a left over from the 64-bit Alpha (Processor arch) version of Windows.
>>
>>58237018
Literally what's wrong with safety? There isn't any proof that it's impossible to achieve. Rust is shit because it was made by Mozilla, not because of its core ideas.
>>
>>58237202
I wish you had been aborted.
>>
>>58233767
In my Forth compiler I have effectively two symbol tables for this.
The 'macro' dictionary is always searched first when compiling, and anything found there will execute at compile time, so things like 'if', 'for', ';', etc are in the macro dict (in fact only in the macro dict, so interpreted use is not possible).
If not found in the macro dict, it's looked up in the normal symbol table and code for compiling a call or variable to it is emitted.
Words can be in both tables for doing things like optimization and instrumentation.
>>
>>58233767
C++ has a "constexpr" keyword that forces a function to be computable at compile time, and then if you pass data into template arguments, or into an enum{} declaration, it will be garuanteed to be computed at compile time. Of course this is kind of a hack so you're probably looking for something better.

You could have two styles of application, one for compile time arguments (usually types) and one for runtime arguments.
e.g. maybe {} is used for static application
id : {a : Type} -> a -> a
id {int} : int -> int
id {int} 4 : int
id {} 4 : int

twice : int -> int
twice x = x * 2

compute : {int} -> int -> int
compute {x} y = x + y

compute {twice 4} 5 = 8 + 5 // 8 is computed at compile time because it must be guaranteed to be able to be
>>
is there a thread pool library/util in java that will auto-self-destruct threads that goes on longer than a specified duration?
>>
What's a good (potentially meme) language for parsing a couple of gigs of JSON?
>>
>>58236145
Tiling windows managers are really nice though tbqh.
i3 gives you undeniably better workflow
If you're not using it you're wasting time
>>
>>58237047
>>58236833
> >_>
> :/
We don't use these on 4chan just letting you know
>>
>>58237435
Use
ExecutorService.newCachedThreadPool()


Or create an instance of
ThreadPoolExecutor
with the timeouts you want.
>>
>>58236291

Interleave their bits into Morton index.

Lossless and simple: You can store coordinates directly and generate intermediate keys, or you can store keys and recover the coordinates.
>>
>>58237557
will it immediately terminate threads if it runs longer than the time i specified?
so for
public void run() {
while (true) {
// processing
}
}

it will throw an exception to terminate it or something? how does it do that if that's the case?
>>
Any tips for getting over perfectionism? I always worry that if I don't use the best design/algorithm/data structure/solution for a particular application, it's a failure.
>>
>>58237603
not having a working program fails more
>>
>>58237602
I misunderstood what you wanted.
No it won't, but you should probably implement that in the thread's code.
>>
>>58237622
i see. got it, thanks m80
>>
>>58237603
I use to have this problem bad but I don't anymore.
I don't know.
>>
>>58237603
Get it running, call it a prototype.
Eventually realize that its "Good Enough (tm)" and don't bother rewriting it.
>>
>>58237603
have a deadline. set a period for refactoring and optimizations (if necessary)
>>
File: CRUISECONTROL.png (2MB, 1920x1080px) Image search: [Google]
CRUISECONTROL.png
2MB, 1920x1080px
>>58237615
it's always best to fail fast and hard.
>>
>>58237603
I structure my code so that I can go back and change things easily.
>>
>>58237548
>We
:O)
>>
>>58237548
>X doesn't do Y this so you shouldn't
That's a meme anon.
>>
>>58237202
Why?
>>58237523
Go, unless your JSON is very variadically typed. Then you're screwed in pretty much any language aside from JS itself.
>>
>>58237523
Racket
>>
>>58237801
>Go, unless your JSON is very variadically typed. Then you're screwed in pretty much any language aside from JS itself.
what do you mean by this?
>>
>>58237818
Can your JSON be easily mapped to statically typed structs and arrays? If the field value types aren't consistent in the JSON any statically typed language will have a hard time parsing it. Absent fields are fine.
>>
>>58237523
Lex and YACC. Nothing beats a parser generator for parsing.
>>
>>58237865
>field value types aren't consistent in the JSON
how does using JS itself solve this, though?

couldn't c++ etc. be able to do this with reasonable efficiency using templates?
>>
>>58237909
>couldn't c++ etc. be able to do this with reasonable efficiency using templates?
Yes, any statically typed language could, but it could be quite a huge pain to write the parser, depending on what you need to parse.

>how does using JS itself solve this, though?
JSON is native to JS, so no need for a parser, but you get a gigantic dynamically typed chunk of unknown structure in a slow language. That could make whatever you wanted to do with the data a pain.
>>
>>58236145
>[x] hate OOP
>[-] hate IDEs
(Mixed feelings)
>[ ] use only Haskell
>[x] never produce actually useful software (this is important)
>[ ] wear knee socks
>[-] tiling window manager
(I dabbled for a while, liked it, and will probably reinstall one)
>[x] dark-like-my-soul customized colors
>[x] hate popular Linux distributions (because too intelligent for them)

Can I join the kool kids klub?
>>
>>58237957
>pain to write the parser
i would say it's actually not that hard, it's just a basic recursive-descent parser; json is not that complicated: all keys are strings and all values are dicts/lists/strings/numerics

>no need for a parser
gotcha, so JS just makes it easy :P, at the cost of using a relatively slow language
>>
>>58237801
safety is the new agile
>>
>>58237865
Algebraic data types in statically typed languages make this kind of thing a breeze.
>>
>>58237886
Except parser combinators.
>>
>>58237865
JSON is dynamically typed and has arrays and tables
What's wrong with something variadic?
>>
>>58237986
>>58238005
Well that depends on what you have to parse. I've seen horrors like arrays with different lengths and types, enum-like numbers, some objects with dynamic structure thrown in too and no documented schema in sight.

>>58238019
Generally bad for performance. Known structure is easy to optimise against.
>>
>>58238049
>horrors like arrays with different lengths
what is a dynamically sized array

>enum-like numbers
?

>objects with dynamic structure
???

i think you're confusing parsing JSON with actually utilizing the parsed JSON
>>
>>58238049
>Generally bad for performance. Known structure is easy to optimise against.
This isn't true at all.
The whole point of JSON is that the entire thing is dynamic.
>>
>>58237737
I guess I should beat my wife then.
>>
[x] hate OOP
[x] hate [non-emacs] IDEs
[ ] use only Haskell
[xxx] never produce actually useful software (this is important)
[x] wear knee socks
[ ] tiling window manager
[x] dark-like-my-soul customized colors
[ ] hate popular Linux distributions (because too intelligent for them)

I'm working my way to the top.

On another note, my parents think I'm wasting my time writing a compiler during break before spring semester, should I just give up?
>>
>>58237957
t. doesn't know shit.

JSON isn't native to JS, it's just similar looking. JS handles JSON very well because it's a dynamically typed language, just like how lisp handles s-expressions well.
Any statically typed language has a dynamic dispatch system, so encoding JSON is not very difficult. In Java, you'd use inheritance; in C, you'd use tagged unions; in Haskell or ML you'd use algebraic data types.
No matter what, the JSON data is going to be dynamic in nature, and efficiencies are only going to be gained when the JSON data is evaluated and stored in a more efficient static way. Raw JSON data might actually be more efficient in JS than in e.g. Java, because V8 does a lot of interesting optimizations on JS dictionaries.
>>
>>58238312
Any valid JSON is also valid JS. JS is native in JS.
Encoding is not the problem. Problems can arise when parsing dynamic JSON into static structures.

>>58238075
Explain how a dynamic structures that promotes boxing of unknown types are faster than known structures with known size and layout.

>>58238071
I might have worded that wrong. Meant parsing dynamic JSON with wildly varying types into static structures.
>>
>>58238403
>Explain how a dynamic structures that promotes boxing of unknown types are faster than known structures with known size and layout.
I didn't say that, I said it's not true that dynamic structure is "generally bad for performance".
JSON is a dynamic format.
The entire question was about dynamic structure.
>>
>>58238403
>>58238418
*in the case of parsing JSON
>>
>by the end of 2017 /g/ programmers will be 90% /fp/
how true is this statement?
>>
Anybody know of a good json serializer for c++? I'm new to learning the language and don't quite know how libraries work.
>>
>>58238436
0
>>58238437
Can you post a sample of the JSON you need to decode?
>>
>>58238437
Look for a "header-only" library, they're the easiest to include into your project.
>>
>>58238403
>parsing dynamic JSON with wildly varying types into static structures.
ok...i think you're a little confused about static and dynamic
it's okay, there are plenty of resources you can learn from :^)
>>
>>58238505
Fair enough.
>>
Just how bad are linked lists anyways?
>>
>>58238732
they're pretty awesome desu
>>
>>58238732
they aren't bad. they're more efficient than an array if you have to do frequent insertions and removals. just dont use them when an array is more suitable
>>
>>58238732
they're neat, dude
>>
>>58238732
i wouldn't say they're bad but for any situation there's probably a better data structure to use than a plain old faggot ass linked list
>>
>>58234077
come and see
>>
I'm working on my poker face so my coworkers think I'm fixing the bug I promised to fix while I'm actually browsing interwebs and waiting for the last day of work of the year to end.
>>
>>58234781
We did this at my university.
>>
So my impressions from reading the Tensorflow API is thatit has its own little MATLABand OpenCV built in.
How far off am I?
>>
>>58238905
For multithreaded systems, queue based locksare internally linked lists.
Intuitively, when you look at the program it doesn't seem that way. But at a high level, they're just linked lists.
>>
>>58238436
According to Prolog, this statement does not unify, or
'No.'
>>
>>58238732
Nearly always worse than array lists. The only time they're better is if you're inserting and removing from neither end way more than you're traversing.
>>
>>58236929
Those people don't have weekly meetings.
They just try to out-virtue one another, and thus it has gone from affirmative action to fuck whitey.

It's not more complicated than that.
>>
>>58238732
They're almost useless. Linked lists optimise for a situation that rarely occurs and they're really only useful for when a linked structure is convenient for you but you don't want to implement something (comparatively) complicated.
Why you're working in an environment where there aren't data structures implemented for you I don't know.

The situations where you would want a linked list is where you recognise that:
-this part of the code isn't performance critical in any way (memory, execution time or programmer facing complexity considerations)
-you're gonna iterate the entire list in order or a set of elements always starting from the head or the tail
-you want to spare yourself the slight (very slight) inconvenience of doing insertion/removal in a flat array

So for an example a linked list would be OK in a situation where you've discovered a set of output/input devices and you're expecting to have to remove or add devices during your program execution. You could do it using a flat array. But it's not like its gonna get you anything. You don't have thousands even. You're likely gonna handle each of them separately (or just have a single one selected) so there's no reason your main thread can't just walk through them and pass them onto the job queue or whatever parallelism scheme you have.
You have very few reasons to have preference in datastructures here. So if you feel the linked list is more convenient than a dynamic array with a dynamic array of bools indicating if an index is occupied or not (which to me would be the second simplest alternative). It's a good choice.
>>58238783
This is what CS students are taught. Because it's true in their specific niche of non-programming.
If insertions and deletions are a major concern somehow a partnered occupancy array is almost always gonna win out in both memory and cpu time.
Linked lists only really win on that front in situations where it didn't matter in the first place.

Overrated structure.
>>
>>58233786
DDD's a good GDB frontend on Linux.
Editor is preference.
Cmake is good enough but for beginners it makes more sense to just use a build script imo.
Adding in cmake early doesn't make sense as you're just mucking about. And it's good to get to know your compiler a little. It's probably easier to get some pre-post build steps in there without having to learn too much. As you're already on Linux and need to know how to use a terminal a little learning how to do things in cmake is extra effort that wasn't needed. In your build script you just do exactly what you wanted before the build and after. No fuss.
>>
File: 1480757461356.png (66KB, 382x395px) Image search: [Google]
1480757461356.png
66KB, 382x395px
Am I a bad programmer if I simply can't into some programming language?

Doing a project in Pharo for uni and I just can't anymore, I want it to be done for whatever passing grade and never touch this shit again in my entire life. I also made a vow to punch any of the frog-eating assholes who are responsible for this abomination if I ever meet them.
>>
>>58239331
>pure oop language
Not made for sane people anon. It's not your fault. Arguably a great programmer wouldn't have major issues because they can manage the adversity. But if this is where you started it wouldn't surprise me if the large majority of your class is failing. Moreso than normal intro to programming courses.

Just try to write some python and forget the oop. Don't let a bad paradigm get you down.
>>
>>58236291
Maybe sort the coordinates before hashing.
>>
>>58239331
What's Pharo?
>>
>>58236858
>"The difference between a master programmer and a bad programmer is one is lazy and the other is not."
Which one is the lazy one? I really need to know. :D
>>
>>58239390
This was good advice until you recommended Python
>>
>>58236945
>"real-time garbage collection"
> embedded systems
Come back when you know what you're talking about. Thanks.
>>
>>58239418
I just took python because:
-procedural
-very low setup time and auxiliary information needed (interpreted, often comes installed on Linux distributions)
-popular

It's a very loose recommendation anon.
>>
>>58239281
>partnered occupancy array
wtf is this? google search returns nothing
>>
>>58237049
It's piss easy and if less people understand it that's actually good, because you can actually bullshit more and get away with it.
Welcome to the world, kid.
>>
>>58239463
I don't really do a lot of terminology well.
But basically
int* arr;//my values
bool* occupancyarray;//if a bool is set to true for a particular index it means the array value is valid/occupied


It's a fairly common pattern. Some like to store it within the structure of your array in some way. The entire idea behind an occupancy array is to allow 'holes' in your array. If you iterate the entire array and do a process for all of them. You just check if the element is occupied (occupancyarray[i]==true) and skip processing it if it wasn't.

Also the post I wrote is a bit of a mess as I'm tired and sedated. Don't worry too much about the details.
>>
File: 1473068569478.jpg (10KB, 164x160px) Image search: [Google]
1473068569478.jpg
10KB, 164x160px
>This is valid C code
const const const const const const int a;

You learn something interesting every day.
>>
The Rust subreddit just went full meme: https://www.reddit.com/r/rust/
>>
>>58239519
No it's not.
>>
>>58239529
wtf is going on
https://www.reddit.com/r/rust/comments/5l08o5/rust_is_literally_haskell/
>>
>>58239390
>Not made for sane people anon.
>what is Smalltalk
>>
>>58239390
But I already know how to code in quite a few languages, I coded in C since highschool and I know a bunch of OOP oriented and have a job programming in Python, I can even code in fucking Haskell and like it but Pharo is a whole different level of retardation to me, I can't even.

>>58239402
It's hell. It's an implementation of smalltalk coupled with the worst IDE to ever see the light of day. And it was all made by a bunch of dirty fucking frenchmen.
>>
>>58239500
that doesn't really address the problems a linked list solves, constant insert/deletion/enumeration time, maybe in the best case or a small collection size it's faster but when you're dealing with a large set of objects that are frequently being removed and inserted a linked list is going to be more useful (even though 90% of the cases people use linked lists they'd probably be better off with an array)
>>
>>58239537
It is though.
http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
>Section 6.7.3
>If the same qualifier appears more than once in the same specifier-qualifier-list, either directly or via one or more typedefs, the behavior is the same as if it appeared only once.
I think it's justs so
typedef const int myint;

const myint a;

is valid.
I ran that my original example through a C++ compiler and it complained, so that's another difference between C and C++ I have found out.
>>
Thank god for Synergy

And fuck AMD for not having more HDMI ports
>>
File: kys.jpg (40KB, 290x290px) Image search: [Google]
kys.jpg
40KB, 290x290px
>>58239552
>smalltalk
AHAHAHAHAHAHA
The IDE looks like a raped IntelliJ.
>>
>>58239542
You like smalltalk. OK. Good programmers don't.
>>58239552
>I can't even
OK. You're venting. I'm cool with that. I just read your post as someone that was in deep distress.
>>58239561
Anon I'm not gonna discuss linked lists again. Read about it online.
And re read my post because the point was never to compete on a performance standpoint. It was to keep a similar programmer facing complexity to a linked list. And I said I preferred the linked list in this case. We've explicitly excluded any performance concerns as i established. Linked lists aren't to be considered in those situations. If you're already yielding to the allocator for your linked list you've lost the constant insert time. If that was critical because you're a terrible programmer and have race conditions or something. Well you really should look more deeply than a linked list if that were the case.

If there's to be a sensible critique of the array vs linked list approach in this case it would be that the growing of the array would be better since it doesn't fragment memory as much as the linked list. But that's obviously very pitifully as a complaint. The memory usage is very similar.
>>
>>58238267
you forgot about one
[x] never had and will have a job
>>
>>58232782
>implying that any of us would be stupid enough to work for apple
>>
>>58238312
>JSON isn't native to JS, it's just similar looking.
hahahahha, and you claim that the other guy doesn't know shit
JSON stands for "JavaScript Object Notation". It is literally the way you declare objects inside JavaScript, retard.
>>
>>58239633
Is it just me who finds the way people are obsessed with json to be rather perverse?
I don't get it at all. Why are they so fascinated with it? It's very difficult to find a generic way of categorising information that's stored in json.
With any relative detail anyway.
>>
>>58239633
JSON is a subset of Javascipt syntax.
Sure, it can be used as Javascript, but it's not limited to that.
You can get JSON implementations for basically any language.
>>
>>58239281
>their specific niche of non-programming.
wew
>>
https://www.youtube.com/watch?v=-MFk7PIKYsg
>>
>>58239603
>And re read my post because the point was never to compete on a performance standpoint
>a partnered occupancy array is almost always gonna win out in both memory and cpu time
???
I can barely understand what the rest of your post says cause it doesn't seem to be written in coherent english, I agree linked lists are a niche, but it still has a niche where it does better than arrays even if it is using dynamic memory
>>
>>58239646
The fascination with JSON historically stems from strong aversion to XML.
>>
>>58239738
That anon get it right.
>>
File: 1415995482008.jpg (27KB, 640x477px) Image search: [Google]
1415995482008.jpg
27KB, 640x477px
What niche of programming can i make the most money from whilst putting in the least amount of effort?
>>
>>58239831
Do you have a PhD in mathematics?
>>
>>58239161
>array lists
>>
>>58239831
>most money per unit effort
Difficult to define a unit effort.

But I'd say being the 'performance expert' in a company with bad programmers is very low effort and you're considered valuable so you can probably get paid well.
Performance in general isn't particularly hard because standards are so low now. Profile any piece of shit code and you can probably get very far with very little effort. So then you just pretend to work for a long time and promise the exact result you've already achieved in secret.

I dunno. Seems rather lame though. Software developers are overpayed as is. It's more important to find something you like doing.
>>
File: 1.png (263KB, 1920x1080px) Image search: [Google]
1.png
263KB, 1920x1080px
FUCKING visual studio

time to restart once again
>>
>>58239903
>not using WPF
>>
File: Untitled.png (2MB, 1920x1080px) Image search: [Google]
Untitled.png
2MB, 1920x1080px
>>
What's the deal with functional programming?
Why it's widely memed?
>>
>>58239937
shit
>>
File: Untitled.png (256KB, 245x1040px) Image search: [Google]
Untitled.png
256KB, 245x1040px
>>58239962
>>
File: airline food.jpg (10KB, 185x200px) Image search: [Google]
airline food.jpg
10KB, 185x200px
>>58239950
>What's the deal with functional programming?
>>
>>58239976
gay
>>
>>58239831
security "research"
>>
New thread:

>>58240012
>>58240012
>>58240012
>>
>>58239937
Like the feature with the post numbers. Really makes it easier to read and gives more context.
>>
>>58239901
How hard is it to get started in that? I'm not a genius, but I know things like the difference between NUMA vs UMA architectures, how to profile the entire system (not just stack probing) and a basic understanding of them, cache coherency, lock-free algorithms, etc. I mostly know tools on linux though. How do I turn that into a career?
>>
>>58240107
I have no clue. I don't have a job.
I'm just hypothesising that there's tons of shit performing software and fixing it can't be that hard. So there's tons of room for lazy.

I'd imagine you get into it by merit. You work at a normal incompetent workplace and take on the performance task. Eventually it's known you're the performance dude. You look for better work where there's better return on your efforts.

Maybe you can actually just claim you know that stuff on your resume. I bet you're better than most just for knowing there's a cpu cache.
>>
>>58240145
>You work at a normal incompetent workplace and take on the performance task. Eventually it's known you're the performance dude. You look for better work where there's better return on your efforts.

Oh, so just like every other job you have to know people already. Guess I'll be a unemployable weeb faggot forever.

>I bet you're better than most just for knowing there's a cpu cache.

Nah, I'd say even the hipster javascript kids know a little bit about cache. They have no idea how it actually WORKS in different architectures but they know it's there.
>>
>>58239622
That's basically the same as "never produce actually useful software"
>>
>>58240532
>you need a job to produce useful software
No that's dumb. Look at RMS
>>
>>58237285
That LinkedList Struct seems like a bad idea. You should just have myLast as a component of Node. Then your LinkedList is just a Node.

If you're keeping it the same, then this:
type LinkedList struct {
myList Node
myLast Node
}

Should be this:
type LinkedList struct {
myList Node
myLast * Node
}

>language designed in the 21st century
>still has pointers
>>
>>58238732
They're a lot better if you put a pointer to the last element in them.

Of course, then they aren't singly linked lists.
>>
>>58240934
>every node should store a pointer to the tail
Why? And why would the last node be significant?
Just move the last node to the second position then. Or head position if appropriate.
>>
File: 2016-12-30-1647-53.webm (428KB, 396x380px) Image search: [Google]
2016-12-30-1647-53.webm
428KB, 396x380px
finally done

would you invite my to your startup
>>
>>58241556
In a heartbeat.
Thread posts: 325
Thread images: 29


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