/dpt/ - Daily Programming Thread

What emulator are you working on Jow Forums?

Previous:

Attached: 1537937039622.jpg (1125x1200, 226K)

Other urls found in this thread:

drive.google.com/drive/folders/1RjmrSji-APvT3rWe8oLv642wk5krGUMu?usp=sharing
twitter.com/AnonBabble

wrong

fuck opengl

Sorry, no emulators on this one

Attached: g_programming_bingo.png (740x926, 318K)

t. retard who can't into math

if you don't do all of these in your undergrad degree you failed

Attached: 1538079610798.png (740x926, 427K)

Which one of commutative addition, existence of additive inverses, and defined scalar mulltiplication don't have to be fulfilled for vector spaces?

The posts replied to do not fulfil requirements for these operations.

not him
is this a trick question? if not i'm guessing comm add

Vectors of numbers fullfill it, vectors of arbitrary other types do not. Now shut the fuck up and post anime.

Attached: 1426725216354.gif (400x406, 515K)

Very bad OP

Attached: 070313_sperm_whale_hmed_5p.grid-6x2.jpg (474x301, 15K)

Lads, I'm doing my first resume and I see a lot of people put ratings or grades on their skills. Some people say it gets the job done in telling how good you are with something, others say its best to keep out

Shit like, proficient: C++, Java, Python
or maybe C++: - - - - - (5 bars out of 5), Java: - - - - (4 bars out of 5) and so on

What do you lads think

I just list it in order, and don't include anything I wouldn't conduct an interview in.

>Lads
Respect my preferred pronoun you SHITLORD

#include
#include "ignorethefunction.h"
int main(void)
{
for (int i = 1; i < 100; i++) {
printf("%s\n", (i%15) ? (!(i%3) ? "buzz" : (!(i%5) ? "fizz" : ctos(i))) : "fizzbuzz");
}
return 0;
}

bam

Attached: 1538079610798.png (740x926, 452K)

It starts off being wrong because a vector is a geometrical object: it only has a representation with coordinates if you give it some basis. "vectors" in programming are just a sequence of objects.
Also what says
>have a Vector of Booleans
>multiply by 3
oh right, you can't

Anyone else go to painful lengths to make sure their operations/functions/types are nice algebraic objects? I already try to make shit at least monoids, but groups are nice. Affine vector spaces are great though, love it when a set of types end up as that. K-Modules sometimes too.

Rating language proficiency can be very tricky. Do what said instead and try to note project you've done in each language (you do have projects, don't you, user?), and let those projects speak for your skills.

lobotomize yourself

If you treat booleans as elements of the mod2 field it works, you can't multiply by 3 becausese 3 isn't an element of the underlying field, but 3 mod 2 = 1 is and multiply by 3 is just the identity.

Attached: 1538079610798.png (740x926, 214K)

Damn, 10yoe and I still don't have a bingo.

Assuming MapReduce over thousands of machines doesn't count as cluster/supercomputer because it's parallel but not low latency.

Attached: fff.png (740x926, 309K)

no other would actively use (You)'re undergrad code

Attached: 1514696605828.png (712x1150, 519K)

I'm a fag and meant complete board

Why don't CPUs have more programmable caches and instruction retirement? For instance, I can see it being useful for work stealing schedulers to be able to abort the most recent action (by not committing the cache lines affected) when a thread is preempted so that another thread can steal the rest of the work item. Not to mention how much easier it is to implement transactional memory with insight into and control over caching.

Sauce?

King boo from Mario universe

>booleans as elements of the mod2 field
But they're not. They may be isomorphic to F_2, but they're not the same. Even if you feel they are, just imagine I said Car instead of Boolean.
And no, my Car cannot be represented in any field, because it has an unbounded tree of properties and there are no (+) or (*) defined on it.

even a stack of raspberries is called a cluster, so why not tick it off?
and have you seriously done all that and never wrote something with SIMD instructions of something for an FPGA?

You can't make a very tor of cars, or any physical object for that matter.

How do i get the arrays of the yearly counts out of this for each area?

Attached: pandas.png (1035x373, 25K)

I'd fail you for writing hard to read code.

i m a g i n e

Attached: DaFfdD7U0AAVD_V.jpg (645x773, 28K)

.values? .items()? .to_xarray()?

I pasted some shit on a FPGA in college but I would have no idea how to even start anything even semi-useful today

dumb animeposters

it's too ugly. i'm just going to use iteration

anime website

Attached: 1536206681455.jpg (900x1200, 1009K)

>have neat idea for extension of
>look at compiler source
>give up
this
(good post btw)

Attached: 1475432842909.jpg (515x698, 76K)

>Vectors of numbers
>what are natural numbers

...

naturals don't have inverses

I've done all of these except for actively used by others

Lists could be mathematical vectors if you treat them as being infinite length with a tail of all zeroes (i.e. the vector space of infinite polynomials over some ring).

Spot on Einstein

Assuming you're being lenient enough that an R-module is "close enough" to a vector space to call it that. Or you could just stick with fields.

Where would I go find people who want to work on an HPC framework (think FEniCS) from scratch?

Attached: dpt.png (740x926, 130K)

Can C allow me to initialize an array of different data types like Python?

My sword is hatred. My shield is disgust. My armor is contempt. In the Emperor's name, let none survive.

Attached: EXTREMELY_ANGRY_LAMPREY.jpg (220x136, 28K)

Only through unions and void*s

Actually I just mention the skills related to the position I'm applying to without giving any specifics.

Python wins again.

In C if I have a 2D array say
2Darray[2][2] = { {1,1}, {2,2} };


and a function that takes one dimensional array. How do I go about only sending 1 set of the 2D array?
I tried something like
function(*2Darray[0]); to send {1,1} but it didn't seem to work

>2Darray
Can't have an identifier begin with a digit. Also why are you dereferencing your array?

(reposted from old thread)
>
I didn't know wether to ask here or in /sqt/ but does anyone here have any experience with uWSGI? I am running a django app that encodes media on the fly, it works great, but I have the OS running off an SD card and after smoking through 2 I decided to enable readonly-root, the problem is that I get constant write errors when writing to the response pipe/socket, as if the client had closed the connection. I seems to happen at random. It also seems to happen way more often when the connection is started from outside of the local network, like 1/10 times it fails from local and 9/10 from outside. This does not happen at all with readonly-root disabled. What the app does is basically download a file from the internet via http and pump the response through a pipe before writing to the response socket. I have confirmed that it works all the way just before writing to the response. Any ideas?

iono. You can do exactly the same thing with the same level of generality in C (though more verbosely).

However, you can not do things with less generality but better performance in Python. It always railroads you onto the most braindead implementation.

>dereferencing
I'll have to look up what that means first.
>Can't have an identifier begin with a digit
forgot about that when I was making this example

>what that means first
You using the * operator on 2Darray[0]

What I mean is basically 2Darray[0] will look at 2Darray as a contiguous array {1, 1, 2, 2} (which is what it is in memory), so you only need to provide 2Darray[0] and then treat is as a int[2] or whatever your type is inside your function.

Yeah ok, thanks. Sending 2Darray[0] worked.

Is there ever a point in dereferencing an array or is that always a mistake?

If you are using an array of pointers and what to access the pointer value.

In general your element type won't be a ring or even a magma.
A specific Vector may be a valid representation of a (physical) vector in Z_4billion^n space, but Vector in general won't be.

Does performance actually matter in most cases?

I am halfway done with a project I am working on. I'm not that good at programming tho so don't expect much.
drive.google.com/drive/folders/1RjmrSji-APvT3rWe8oLv642wk5krGUMu?usp=sharing

depends what you're programming

while (fscanf(inputFile, "%d", &number) != EOF) {

Why is this giving me a segmentation fault? It is specifically this line, I've tested absolutely everything else and it works fine. I'm just trying to print out a series of integers (separated by spaces) from a text file. I'm a javabab who just got pretty much thrown into C sink-or-swim and I have no idea what the fuck I'm doing.

>Doxing yourself on Jow Forums
More seriously I suggest you put it on some code sharer instead such as Gist.

Convince me not to enable -fconcepts

Literally no reason not to. Every new program I've written since Sutton merged his patch uses C++2a.

Oh, GCC has support for the new concepts TS now? Because I was talking about the older concepts.
What version is it in?

There is an implementation of concepts-lite in the version I'm using
arnaud@persil:~$ g++ --version
g++ (Debian 8.2.0-7) 8.2.0

I have that version too.
-fconcepts says it enables the older 2015 concepts. Does it enable the newer concepts if c++2a is enabled or something? Otherwise I'm not exactly sure what you meant by "Suttons new patch". What new patch, when was it merged and what did it introduce?

Attached: 1526774950102.png (654x123, 16K)

C++2a concepts are from the latest concept TS. C++0x concepts were dropped a long time ago (the ones with axioms/etc).

Compliance with standardese mostly. Sutton's the guy who wrote the wording.

What if functional languages could work as well with general (directed) graphs as they can with trees?

So if I enable -fconcepts with c++2a, I'll get the current WIP c++20 concepts instead of the ISO 19217 concepts?
Is that what you're saying?

WHY

Attached: 1536343666129.png (534x28, 4K)

Why do people using C++ insist on using the most ugly features possible? Like damn nigga what the fuck is the point of stuff like

I don't get what you call "new concepts". Concept TS are the new concept. There is no more WIP since it was voted in and they are fully implemented in GCC. Old concepts are the eldritch abomination that featured things such as maps and axioms.

char* build_str_from_argv(char** ar)
{
char* str = (char*)malloc(STRMAX);
size_t s = 0;

for(char* ch = *ar; *ar != 0; ch = *(++ar))
{
while( *ch != 0 && s < STRMAX )
*(str+(s++)) = *ch++;
if( s < STRMAX ) *(str+(s++)) = ' ';
}
*(str+(--s)) = 0;

return str;
}

Why is this acceptable when literally any other language does it infinitely more eloquently?

I don't think that's true.
The concepts that -fconcepts enables requires the bool keyword in it's syntax. the C++20 concepts don't. Hence it's a bit different.

But seriously though, what the fuck is the point of requiring the user to write the type when it always has to be a type anyway. Just fucking omit it christ.

Attached: 1538039576839.png (774x82, 20K)

>when it always has to be a type anyway
bool*

LISP-2s are better than LISP-1s
All objects except NIL should be able to be used as true. (Notice how T and NIL can still be booleans in case your autism requires the types exist)

Well that's just fucking great.

Attached: 1519107455984.png (951x157, 35K)

Anyone help me with C++ :(

How do I lambda a one-method abstract class, like Java's runnable interface?

I want something similar to this:
Thread a = new Thread(()->System.out.println());

What's the process for a simple emulator? Allocate memory for registers and system memory and write a switch to handle each instruction?

>having a different namespace for functions

Attached: laughing.jpg (1280x720, 113K)

On the simplest level yes.
It really depends on what you want to support and how far you want to go.
You can write a really simple emulator in a few lines.

>defending this
(define (function lst)
...

>lst
hahahhaahhahahahaahaha faggot

Where can I collect my 300k starting for learning Haskell? I'm confused now

Why is the former assignment illegal?
>>> arr=[None]*3
>>> [arr]*=3
SyntaxError: illegal expression for augmented assignment
>>> arr= [arr]*3
>>> arr
[[None, None, None], [None, None, None], [None, None, None]]
>>>

This line of code is fine, I've used it plenty. The problem is elsewhere

haven't touched git yet. its on my todo though.

For accuracy, yes, although you'd accelerate it with techniques that are akin to JIT compilation as opposed to pure interpretation. There's also something called HLE (high level emulation) which simulates large swathes of game code as hard coded segments, often rendering code. For instance, most N64 games share most or all of the code for a particular processor, so N64 emulators typically hard code the semantics of that code. Unfortunately, this can lead to incompatibilities with games that make changes to that code that are unaccounted for.

Gist requires no knowledge of git at all
It's basically pastebin with some more features

holy shit does everyone have to do six fucking slow changing captchas for each fucking post?

Is there a Scheme out there that uses every object as true/false values and uses keyword and optional arguments for functions?

Should I just use str.format() if I have statements with lots of conjugation? Is there any downside to doing so?