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

/dpt/ - Daily Programming Thread

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

Thread replies: 321
Thread images: 23

File: yuki_k&r.png (350KB, 500x492px) Image search: [Google]
yuki_k&r.png
350KB, 500x492px
What are you working on, /g/?

Old thread: >>59209636
>>
File: internship.png (91KB, 1105x1009px) Image search: [Google]
internship.png
91KB, 1105x1009px
>>59214040
what is this nonsense?
>>
Reposting because I'm absolute shit at terminal wonkery:

Trying to organize my desktop.

I'm using tags to organize images by their respective qualities. I recently downloaded the "tag" utility for the Mac terminal, and was wondering, how would I move all the files with a certain tag to a folder?

The command
  tag -m gray  

lists all the files with a gray tag. I was wondering, given this list, how could I use the "mv" command to move all these files to a folder?
>>
>>59214061
>using a mac
this is where you went wrong, 30 year old.
>>
>>59214055
They want to underpay you for retard webdev. No surprise there.
>>
Posting in new thread for discussion:

The more I understand libuv the nicer it seems. It's very consistent and functional, as far as it seems. Better than any other C/C++ boost-free netlib. How do you anons do your networking?
>>
>>59214055
To be fair, given the area (both geographic and area of CS), there are a lot of really talented people from nearby universities.
Is it stupid that an internship requires 5 years of experience? Yes, but at the same time, it's a job that probably couldn't be done without the adequate knowledge base.

There are more entry-level jobs out there, though.
>>
>>59214061
man xargs
>>
File: apfel.jpg (41KB, 780x547px) Image search: [Google]
apfel.jpg
41KB, 780x547px
>>59214061
>>
>>59214077
I want to get started in network stuff, but I don't care about using libraries. I want to work with low level stuff and design network protocols bottom-up. But I don't really know how or where to start.
>>
>>59214055
Corporate oligarchy.
>>
File: I may not know much.jpg (190KB, 621x1000px) Image search: [Google]
I may not know much.jpg
190KB, 621x1000px
>>59214089
Alright. I think I'm on the right track:

I do
xargs ls* | tag -m gray 


I'm reading the man page, and it appears that I can use it with another utility... How would I pass in this output to "mv"?
>>
>>59214055
You can apply and still have a good chance of getting it if that's what you want. But they just look like leeches.

Would someone with 5 years experience be looking for an internship? Same for, 4? 2? 1?

That said an internship with leeches is still an internship. Just don't expect to enjoy your time there.
>>
1. Completely outlaw C programming, seize all C books and burn, delete and shred them.
2. Rewrite everything into Rust
3. Kill C, C is communism
>>
>>59214197
mv $(commandthatproducesfilenameyouwishtomove) destination
$() executes the command inside the parenthesis and inputs the output where you used it.
>>
>>59214222
You already posted this and it wasn't clever, interesting, or good this time, either.
>>
>>59214222
You could at least suggest a language suited to replace C.
>>
>>59214234
Oh, okay. I was doing that, but without the $(), so it wasn't reading it properly... Thanks anon!
>>
>>59214246

C#
>>
>>59214246
Rust
>>
>>59214197
mv $(tag -m gray) destination
>>
>>59214061
tag -m gray | xargs -0 mv $1 gray/$1
>>
Should I learn D?
>>
Why don't we have modern Lisp machines?

Why doesn't that faggot Paul Graham fund some?
>>
>>59214334
Because he realized that Lisps are a meme when they couldn't handle HN backend.
>>
>>59214279
Okay, I tried this, and two things came up:
1) I have spaces in my filenames (woops) and mv is delimiting by space, not by line, so it thinks the file "a b c" is actually three files, "a", "b", "c"

2) mv:rename is being run even though I just want to move files (though this might have to do with (1))
>>
>>59214372
god bash is shit
>>
File: 98381231313.jpg (49KB, 1280x720px) Image search: [Google]
98381231313.jpg
49KB, 1280x720px
>>59214040
how do you go above 10k loc without everything become a spaghettio mess?
>>
>>59214327
D is pretty nice. Although it inherits some shittyness from C directly
>>
Repostan, because the C-hating memers need to be put in their place. We need every language, but some languages are more important than some others. C is very important, not because it is an easy language (it is not), but because there is no alternative in how a language tries to capture the essence of most machines.

>>59213527
It's not a C issue, it's an issue of calling conventions between architectures, and even between OSes.

C defines an abstract machine, everything that is well-defined behavior in C is pretty much what all computers have in common. Calling convention is not, and it is not C goal to impose a style. That means that:
- calling convention is implementation-defined
- since you can't know beforehand how the arguments will be passed, passing arguments with side effects is undefined behavior, which is logical, because results of side-effected arguments will be inconsistent across implementations of calling convention

Of course, modern languages like Rust try to solve every undefined behavior of C by imposing a behavior, but this has one big adverse consequences: if your target environment behaves differently from what the language requires, workaround will have to be implemented either in compiler or in runtime, resulting in a less straightforward implementation than in C, with all that implies in terms of complexity and performance.

No wonder why undefined behavior exists in C. Either deal with it or trade some simplicity of implementation for simplicity of use.
>>
>>59214279
how do I post code with that white background
>>
>>59214511
[ code ]your code here[/ code ]
>>
In C++

[ code ]void funtion( char *a )
{
//only reads to *a, no writes to *a
}
int main()
{
char A[] = {0,0,0};
funtion( A );
const char B[] = {1,1,1};
funtion( B );//<----------not working, doesn't accept const
}[/ code ]

how do I make funtion( B ) work without creating too much code?
>>
Apparently we're not allowed to break older versions of mobile apps by updating the security of our modern apps services. Apparently.

How is this a thing? Is it due to google play/apple being cunts?
>>
>>59214530
>>59214560
[ code ]test[/ code ]
I can't believe you have done this to me
>>
>>59214530
>>59214560
this is why, even if you consider them pajeet tier, you must learn markup languages like html
>>
>>59214560
>>59214575
Pajeet please, not only you need to lurk more, but you need at least a couple of neurons to post here.
>>
>>59214571
The whole android thing, being based on java is an abomination. We consumers aren't allowed to have a good OS for a smartphone.
>>
>>59214629
>android dev kit shares syntax and calls with java therefore android OS is javaVM
Go to bed larry.
>>
>>59214656
>implying jvm is the only thing that sucks on the java world (other than the curry odor, of course)
>>
Good morning, anyone got a moment to help with some simple c++ shit?

 
vector<vector<tuple<int, int>>> *graph; // I have this graph.

void Graph::addEdge(int from, int to, int weight) {
for (int i = 0; i < this->graph[from].size(); i++) {
tuple<int, int> edge = this->graph[from][i]; // This line is giving an error " Class vector<vector<tuple<int int>> is not compatible with class tuple<int, int>
}
}


[\code]
>>
>>59214697
I mean it's that and forced objects.
Really don't see what else would affect the OS level other than shit like "wahh I dont like the way the syntax is for creating a new thread" which is a nonfactor by the time you get to implementation
>>
>>59214560
change
void funtion( char *a )
to
void funtion(const char *a )
>>
>>59214717
try casting it yet?
>>
>>59214717
Not sure what your problem is but for fuck's sake use some typedefs or whatever.

using Edge = std::tuple<int, int>;
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;

void Graph::addEdge(int from, int to, int weight)
{
int size = graph->at(from).size();
for (int i = 0; i < size; ++i) {
Edge edge = graph->at(from).at(i);
}
}
>>
>>59214781
Sorry senpai, new to C++ so I haven't even considered that yet. Will do right away.

>tfw c++ has something similar to Haskell's type.

>>59214767
Will try it out, thanks for the suggestion.
>>
>>59214717
>>59214781
Oh also if your graph is actually a pointer are you sure you can do graph[from]? Wouldn't that just access the memory address of graph with an offset of from? So try:
(*graph)[from][i]


or:
graph->at(from)[i]
>>
>>59214717
also since [] is actually an operator try to define the order of operations with (graph[from])[i]. Dont think it'd change anything but
>>
>>59214824
My fucking hero, many thanks man. I don't have much experience with C++ or C in general so I'm making lots of rookie mistakes.

>>59214826
Will do, thanks!
>>
>>59214463
Modularization.
>>
>>59214560

For your "funtion", you should have the argument be a const char*, rather than just a char*. Furthermore, it is best practice to ALWAYS use const for pointer/reference arguments whenever it can be guaranteed that the argument will never be written to. You will note that the C and C++ standard libraries are replete with examples of this behavior.
>>
>>59214629
But why is this a thing? A service and a client should be in updated at the same time, and require eachother to be on the same version if you want to guarantee functionality and security. Forcing someone to upgrade to continue using a service is the only way you can ensure security.
>>
Whoever thought that limiting all work with lists to one [Head|Tail] decomposer in Prolog is a great idea is a dick. Big, big dick.
I spend most of my time on reinventing predicates to work with lists like cut out the sublist from the list, checking if all values are unique and such.
>>
>>59214984
"it's like im really working on a database!"
>>
>>59215005
Who are you quoting?
>>
>>59215017
you, making a script to do all that.
>>
void function(int *a)
{
a[0] = 0;
}
soo here the parameter "int *a" should be "const int *a"?
>>
test
>>
>>59214984

Yeah, welcome to Prolog. It's not intended to actually be used for anything. Just enjoy the novelty of logic programming being... different.
>>
>>59215101
No.
>>
#include <cstdarg>

template <typename T>
T f(T counter, ...)
{
T arg;
int i = 1;
va_list p;
va_start(p, counter);
T min = va_arg(p, T);

counter--;
while (i < counter){
counter--;
arg = va_arg(p, T);
min = min < arg ? min : arg;
}

va_end(p);
return min;
}


As far as I am concerned, cstdarg macros' couldn't use template correctly. If I call f(3, 1, 2,3), it shows 1 as a result, which is correct. However, if I call things like f(3, 1.1, 2, 3), considering first argument as a double, it is not working. Is there a way to work with all types of arguments?
>>
>>59215101
const int * a; // pointer whose contents cannot be changed.
int * const a; // pointer that cannot be changed
>>
>>59215207
Dumb sepplesfag.
You should actually learn how varargs work.
>>
>>59215101

Clearly not, since you are mutating the contents of the buffer pointed to.
>>
>>59215431
I don't understand.
>>
File: durrr2.jpg (24KB, 640x480px) Image search: [Google]
durrr2.jpg
24KB, 640x480px
>>59215462
Could you please explain the difference between

argv[][] and *argv[] ?

Why would a 2d array be the same as a pointer to a 1d array, very confusing

(speaking about the command line arguments in the main parameter in C)
>>
>>59215670
An array is just a pointer to a space in memory.
>>
>>59215670
You have to think about it in terms of memory. A 2d array is just many 1d arrays stacked ontop of eachother. So memory offsets 0-arrayWidth corresponds to arr[0][offset]. After that there's another array, arr[1][n] and so on.

I think the mixing of pointers and array notation is a mistake in C. You should be allowed array notation for simple 1D arrays and use pointer arithmetic for everything else.
>>
>>59215670
Learn about C arrays first, starting with 1d arrays, because these are a specific beast with a non-obvious relationship to pointers. (If you remember to think low-level and about where memory resides it becomes intuitive at the end tho)
>>
File: FxmmZ.gif (2KB, 354x189px) Image search: [Google]
FxmmZ.gif
2KB, 354x189px
>>59215670
>argv[][] and *argv[]
argv[][] == *argv[] == **argv
It's all just pointers. There's no "real" dimensional arrays in the language. The multiple brackets or pointer declarations is just ways of telling you how many steps of indirection you have.
>>
>>59215700
>>59215702
>>59215715
>>59215742
Ohh right that was painfully obvious my bad lol
>>
>>59215670
>argv[][]
This is not valid in C. The inner (right) array needs a dimension.
>same as a pointer to a 1d array
This is not relevant to argv though.
*argv[] is NOT a pointer to a 1D array. It's a 1D array of pointers.
>>
>>59215742
>argv[][]
As I said in >>59215753: not valid.
An "array" passed into a function will decay into a pointer, but that does not work recursively.
You can't have a pointer to an array of unspecified size.
>>
>>59215762
>will decay
no such thing
>>
File: 1378828243726.jpg (24KB, 800x600px) Image search: [Google]
1378828243726.jpg
24KB, 800x600px
When am I supposed to graduate from Python to a real language?

Or should I just become webdev.
>>
>>59215812
Yes there is.
>>
>>59214134
https://beej.us/guide/
>>
>>59214055
I think it does make sense. Imagine being an overeducated web dev dreaming about doing something more meaningful now. That's your entry ticket.
>>
>>59214222
>1. Completely outlaw C programming, seize all C books and burn, delete and shred them.
Who's this guy?
>>
The Linux kernel disables interrupts sometimes.
How the fuck does it do that without missing important hardware interrupts?
>>
>>59215951
There are uninterruptible hardware interrupts. Look up for NMI.
>>
>>59215988
>uninterruptible
*unmaskable
>>
>>59215837

webdev is for pseudo-intellectuals who wear glasses without lenses
>>
>>59215947
CIA nigger
>>
I remember programming in BASIC.
It was fun and simple.
Why it's not fun to program anymore?
>>
>>59216093
programming is only fun as a hobby
>>
>tfw fell into the c++ trap
>>
>>59216117
C++ traps are gay
>>
>>59215861
no, there isn't
>>
>>59216148
Just saying it isn't going to make it true.
The word "decay" even appears in the standard.
>>
Does anyone here write Prolog? It's such a weird language.
>>
>>59216183
>C has classes
>the word "class" even appears in the standard

What kind of webshit logic is this?
>>
>>59216183
the standard says nothing decays
BTFO
T
F
O
>>
Would

C++
>mat4::perspective(float fov, float apr) {}

be the same as

Java
>mat4.perspective(float fov, float apr) {}

If not, what does the :: mean/do?
>>
Senpaitachi, I'm learning C++, and as recommended I'm trying to use the shell to compile the stuff, since it would teach you more about what you're doing.

But I'm doing some stuff wrong, I think.
Do I really need to link every library and every cpp file manually every time I compile, or is there an easier way for this?

And how would one go to debug the code? I'm using vim, but I assume I can't debug with vim (albeit not sure).
>>
How do I add elements in two lists together? I need this to output [2, 6] instead of [1, 2, 1, 4]. I need to do it at the lowest level without using sum or zip.
def add_vectors(u, v):
for i in u and v:
result = u[:] + v[:]
return result
print(add_vectors([1, 2], [1, 4]))
>>
>>59216253
:: is scoping, it's for when you want to refer to the function itself

>>59216287
haskell
zipWith (+)
>>
>>59216253
:: is for static members of a class or anything inside a namespace
>>
>>59216195
Not that I write everyday in Prolog, but I learned it right where it was invented (Marseille, France).

It's a very ingenuous language, conceived at first to build AIs which would talk in natural tongues. But there are too many dialects of it, the first implementation failed its commercialization and unfortunately failed to be the reference that it should have been.

I guess you could write very nice parsers in it, but it fares quite badly with low-level programming, so it pretty much has to be associated with such a fitting language for low-level tasks.
>>
>>59216333
I have heard that some people actually use embedded Prolog for type inference in compilers.
>>
>>59216291
Without zip. I need to do this at the lowest level.
>>
>>59216371
Yeah, as I said, Prolog is really fit for that kind of work, very elegant implementation and acceptable performance penalty.
>>
>>59216372
What's wrong with zip?
It's intended for this sort of thing
>>
>>59216102
I think I will learn Lua soon, the language seems to be easy and light.
>>
>>59216404
Because I need to do this at the lowest level.
>>
>>59216412
What do you mean "at the lowest level"?
>>
>>59216333
>>59216371
>>59216389
One of the Rust core team members considers using Prolog for the type trait system: http://smallcultfollowing.com/babysteps/blog/2017/01/26/lowering-rust-traits-to-logic/
>>
>>59216286
Use a build system. If you are not using Windows, start with Make. Debugger is a last resort, if you really need one check out GDB, but you should use tracing and asserts most of the time.
>>
>>59216438
The basement
>>
>>59215988
>>59216012
What's that got to do with my question?
Timer, hard disk, network card, gpu etc interrupts are not NMI's. if one comes in while linux has IF=0, how the hell does it not lose it?
I did a test in my own kernel by spinning for about 4 seconds with interrupts disabled, and I lost about 4 seconds worth of timer interrupts.

One of the reason behind why I'm asking is disabling interrupts is sometimes the ONLY way to serialize access to resources from interrupt handlers.
Now you might say use a workqueue, but the fucking workqueue itself needs to be atomic when inserting jobs into the queue. How do you do that? can't use a fucking mutex/spinlock lol. Need to disable interrupts, but then you run the risk of missing interrupts which is absolutely unacceptable.
>>
>>59214040
Working with an internal web based IDE written in Silverlight to create a web app. It's not bad once you figure out how they've thought.
>>
>>59216412
your code does not at all what you want it to do
 u[:] + v[:] 
will concatenate u and v
(also you dont need to [:] here)

there is no point in iterating as you return inside the for loop and you dont even use i.
also even if you were to use i, its the same as as
 for i in v 

(as (u and v) returns the last element)

what you want to (if you dont want to zip)) is add by index.
>>
>>59214957
Yes, that's how it works on the Java stack.
Android is not-actually-java, so it's like Java, but worse.
>>
>>59216509
>(as (u and v) returns the last element)
meant to say
as (u and v) returns the last list .

Technically and will return the either the first falsey argument , if there is no falsey argument it will return the last truthey element.
So if u = [1,2] and v = [3,4]
( u and v) == [3,4]
so
 
u = [1,2]
v = [3,4]
for i in u and v:
print(i)

results in
3
4


if u = [] and v = [3,4]
(u and v) == []
so iterating and printing as above will result in nothing being printed.
>>
>>59214984
I'm fairly certain you can
:- import(some_of_those_functions).


>>59215162
It's an academical language like say, Haskell. It's meant to be used for academic stuff. Which is is eminently useful for. A lot of linguistic stuff is written in Prolog for example.

And Swi does come with an industrial grade Semantic Web Server, so now you aren't forced to use Java (Apache Jena/Fuseki) or Common Lisp (Allegro Graph) for your Semantic Web applications.

Anyway, it's not that hard to get a sublist.
sublist(0, List)  :- !, List.
sublist(X, [_|T]) :-
is(X1, -(X,1)),
sublist(X1, T).


> Uniqueness
http://www.swi-prolog.org/pldoc/man?predicate=setof/3

And so on.
Alternatively just use sort/2 and check head| [head2|tail] downards on the sorted list.

The stuff you're doing is easymode, and if you can't do it, you haven't really understood prolog yet. After that point it all becomes easy.
>>
>>59216568
This is the closest I've gotten. But it's only adding the 1 position in both the lists. It results [6, 6]. I need it to add the 0 positions too. I need it to be [2, 6]

def add_vectors(u, v):
for i in u and v:
result = [u[i] + v[i], u[i] + v[i]]
return result
>>
>>59216660
You don't understand how for loops work in Python
>>
File: windowmaker.png (325KB, 1920x1080px) Image search: [Google]
windowmaker.png
325KB, 1920x1080px
Windowmaker is really nice.
>>
>>59216660
>>59216673
It should be something like this:

def add_vectors(u, v):
result = []
for l, r in zip(u, v):
result += [l + r]

return result
>>
does SQL support boolean queries?
like checking if a row with some given values exists or not
>>
>>59216717
I can't use zip or sum, or any inbuilt functions or libraries.
>>
>>59216735
Not even len()?
>>
>>59216727
You could use a CASE statement.
>>
>>59216449
Thanks anon, I'll check it out.
>>
>>59216735
3 words
for
range
len


also, like >>59216673 said do you understand what for loops do in python

>not use any inbuilt functions or libraries
thats very vague. + is an inbuilt function.
>>
>>59216735
>>59216745
Alright, a version without using builtin functions, not even len and range:
def add_vectors(u, v):
i = 0
result = []
try:
while True:
result += [u[i] + v[i]]
i += 1
except:
return result
>>
>>59216727
Which DBMS?

Some of them have a built-in function for IF.

IF(1 = 1, 'it be true', 'it be false') as 'DoItBeTrue'
>>
>>59216491
It's simpler than that on Linux. It disable interrupts only for fast interrupt handlers, such as timer interrupt handler. In all other cases, interrupts are still enabled, so events like timer interrupts still occur within slower handlers.
>>
>>59216884
or you could do it recursively
def add_vectors(u, v, result = None):
result = result or []
if u and v:
return result + [u[0] + v[0]] + add_vectors(u[1:], v[1:], result)
return result
>>
>>59216695
>using namespace std;

>std::string
>std::unique_ptr

Why
>>
>>59217063
>>59217031
>>59217086
spam?
>>
>>59217068
Oh, so just it's fast that somehow makes it acceptable to turn off interrupts?
>Turn of interrupts for short time
>Very important IRQ just happens to come in at that point (of course it's possible)
>System is fucked.
Sounds like complete bullshit to me. I don't believe it.

I don't see how disabling interrupts is a valid solution to anything.
>>
>>59217091
Because LLVM tutorial, and it's better than using raw pointers.
>>
>>59217096
no i just made an error in the first, then messed up the tags in the second.
i want to sudoku.
>>
>>59217106
Once interrupts are re-enabled, the interrupt is serviced, and the IRQ line is held high by the PIC, which makes sure the interrupts aren't lost.
>>
>>59217129
And what if an IRQ line is raised twice while interrupts were disabled? Don't say it can't happen because the "short amount of time" taken up by "fast interrupts" sounds completely arbitrary to me, so I think it's entirely possible for two interrupts to arrive while interrupts are disabled.
And when that happens, you've obviously lost the first interrupt. The PIC does not keep a backlog of IRQ's which was proven when I spun my kernel for 4 seconds with interrupts disabled, and as expected, I lost 4 seconds worth of timer interrupts.
Losing just 1 timer interrupt is unacceptable.
>>
>>59216717
When a function becomes one simple line, what's the case in it still being its own function instead of just having the one line of code where it's needed
[i + j for i, j in zip(u, v)]
>>
>>59217190
he can't use zip
>>
>>59217182
Interrupts usually block the device sending them AFAIK (or should). (also I'm not previous anon)
>>
>>59217218
Then he is a moron, or his teacher is. The power of Python comes from the batteries included. If you are not gonna use them then it just becomes a slow as fuck C.

And of it's for learning, then better just learn C.
>>
>>59217225
Well it doesn't for the PIT.
Well actually, I'm not entirely sure on that myself.

When I tested it in QEMU, it appears that either the PIT or the PIC kept a backlog of IRQ's, and sent them all at once when interrupts were enabled again. However when I went to test the kernel on my thinkpad laptop, there was no such backlog and I lost all the timer interrupts that were raised while interrupts were off, losing 4 seconds of time.

Whatever that means, it means that it seems to be non standard or undefined behavior, which means it's not to be relied upon. Therefore I'm going to assume that interrupts do not block the device and no backlog of IRQ's are kept by hardware.

Anyway, the PIT definitely does not block as proven by thinkpad hardware, so disabling IRQ's means possible missed timer interrupts which is unacceptable.
>>
>>59217295
You might want to try the HPET timer.
>>
Anyone here know of something that can do this.
>write function to draw line
>tell it to draw line
>other window updates to show drawn line
>tell it to color certain pixels
>window updates to show colored pixels
Basically "live coding" graphics. I don't mind what language as long as it's a real language and not Processing or that Turtle drawing language.
>>
>>59217318
QBasic
>>
>>59217310
What does it offer? is the HPET timer really the only way to get out of this shitty mess?
What if the system does not have a HPET? I know that Linux supports systems without a HPET, and it seems to handle this stuff somehow.. by disabling interrupts which I don't fucking understand how they're not missing interrupts.
>>
>>59217327
I don't know, I'm pretty clueless on this too.
Apparently the HPET is a more modern version of the PIC timer, but I don't think that stops the interrupt hell.
>>
>>59217318
Python with ipython and qt
JavaScript in the browser

Basically anything that implements eval/repl
>>
Why the FUCK do some retards use spaces for indentation?
>>
>>59217318
>or that turtle drawing language
Are you dissing logo?
>>
>>59217409
Semicolon indent master-race.
#include<stdio.h>
main()
{
;;;;printf("Hello World");
}
>>
>>59217190
>>59217218
Implemented zip for this:
def addvectors(u, v):
def smallestListLen(*l):
n = len(l[0])
for i in l[1:]:
if len(i) < n:
n = len(i)
return n

def zip(*l):
for i in range(smallestListLen(*l)):
yield [n[i] for n in l]

return [i + j for i, j in zip(u, v)]
>>
>>59217409
Because they hate you and want you to run your replace all instances of " " with "\t" script.
>>
>>59217318
Racket, Allegro CL.
>>
>>59217409
because >muh universal rendering
>>
>>59217318
https://www.youtube.com/watch?v=6pMyhrDcMzw
>>
>>59216695
so is her ass
>>
Ok, so if I'm understanding this correctly, the solution to not missing interrupts is just simply being fast enough, and this is how Linux has been handling it all along. This is what I'm understanding from reading some Linux docs.
That is just... I don't know what to say. The x86 is a joke of a platform.
>>
File: Breaking-News.jpg (37KB, 640x360px) Image search: [Google]
Breaking-News.jpg
37KB, 640x360px
>>59217506
>The x86 is a joke of a platform.
>>
>>59217506

if you're cranky enough to think the intel architecture ignores about 100 years of electrical engineering and information theory you'd also happen to be correct
>>
>>59217506
Who cares about missing one or two timer interrupts from time to time when what you only do on x86 machines is running office software and vidya? :^)
>>
>>59217419
no, just that I was imagining something a bit more advanced than drawing lines. I wrote some basic stuff in C to read a png, mess with it and save it out. But it's tedious to play with.

>>59217484
Maybe I do have to use OpenGl for this. At least I know what I'll be doing this weekend.
>>
anyone use Visual Studio Code? how is it?
>>
>>59217506
So..
Does it work?
>>
>>59217790
>Visual Studio Code
It's an editor based on electron.
Why do you care about others opinions on this?
>>
>>59217862
read in a book that people are choosing it instead of sublime and atom, wondering if it's really better or the author is a shill
>>
>>59217318
For a decent tutorial on this
https://hero.handmade.network/episodes
Episode 21 and up deals with dynamic code reloading.
It goes through everything but dynamic memory layouts, which I'd say is more hassle than it's worth.

And of course this can be generalized to any language that supports loading DLLs manually or similar functionality.
>>
anyone remember when rust, meme language of the week, died?
>>
>>59217915
>people are choosing it instead of sublime and atom
They're all about the same. I don't think it matters too much.
>>
>>59214267
Rust must rust!
>>
>>59217670
Uh, missing a timer interrupt creates an inconsistency in your timing. What should return in a certain amount of time could return a little bit later. This could be problematic in say media players, and other things that need precise timing requirements.

And it's not just timer interrupts, what if you miss a network card interrupt? That would be very bad.

>>59217835
Well, Linux does it, so it must.
But it's such a hacky and disgusting thing. There's absolutely no guarantee that something bad can't happen.
>>
>>59217506
And yet it still works
>>
>>59217998
It still works, but you have to make your software more complex to handle all the rough edges of your hardware bedrock. If you don't care about complexity, it's fine.
>>
>>59217790
I've switched to VSC from Sublime about a month ago, it's great.
Much more alive and maintained extension ecosystem than Sublime, actively developed, decent out of the box features.
It also blows Atom out of the water if you want to use either when it comes to performance, kinda weird considering that Atom is Electron's flagship app.
>>
>>59217992
>But it's such a hacky and disgusting thing.
I don't think that's the right perspective really.
I'm not that low level but from my experience with parallel programming you shouldn't actually 'defeat' the situation objectively for every situation. That generally ruins performance by contrast to the 99.99% of user will never have an issue-solution.

Common example would be to allow your application to overflow a work queue, because the feed rate isn't high enough that it will ever happen but the implications of ensuring that it won't happen is costly.

Maybe the design in this architecture is similar in that it gains from this far more than it would gain from playing it safer.
>>
>>59218025
It just happens to work well. There's no guarantee at all that you won't lose an IRQ.
You could certainly lose a network IRQ since those require you to handle them quickly or else it's gone.
>>
>>59215670
int a[3]; // array
int* b = a; // pointer
if ((sizeof(a) == sizeof(int) * 3))
{ puts("oh, pointers & array are actually different things!"); }
if ((sizeof(a) != sizeof(b)))
{ puts("maybe you should read some propper book and then C's or C++'s standard?"); }
>>
>>59218044
>It also blows Atom out of the water if you want to use either when it comes to performance
Not that guy but I'd just like to point out that we live in a sick and twisted world where you could even say this.
We're talking about text editors here. They've existed since forever pretty much, just a few years after man hammered silicon to copper and made a computer. They didn't have multiple orders of magnitude more resources than they have today.

Yet somehow you can sill perceive the difference.
>>
>>59218052
You have a good point I guess. The amount of time spent having interrupts disabled just so you can atomically insert a job into a queue is reasonably small enough that you don't have to worry about it.

It just really hurts my autism. I don't like it when behavior isn't guaranteed, it feels like relying on undefined behavior, which it basically is exactly like that.
>>
File: mmu.png (26KB, 387x272px) Image search: [Google]
mmu.png
26KB, 387x272px
How do you design an mmu?
>>
>>59214040
Nothing because I only know how to read and understand/ memorise java programs , given at least 30 minutes and lack the creativity or knowledge to use online apis to write or debug code and thus wasting my CS degree by working in utterly irrelevant non technical jobs back to back for 3 years. ... when will the Light find me ? :(
>>
Ok, so I have to implement the Go-back-N protocol(https://en.wikipedia.org/wiki/Go-Back-N_ARQ) for one of my school assignments. Basically, there is a sender and a receiver.
The sender application has two thread, one for sending data packets and one for receiving ACK packets. The receiver, when it receives a correct in-order data packet, sends back an ACK packet.

Now, the problem comes when there is a network error and either the data packet or the corresponding ACK packet gets dropped (simulated on the receiver side artificially). So, I have to implement a timeout for each data packet such that if the ACK packet hasn't arrived, then it sends the same data packet again.

I have no idea how to implement this. I'm using Java btw (had the option to use both Java and C++, figured Java would be easier). The thing is, there should be a timeout for every packet sent. Also, if some ACK arrives, I have to cancel the timers(?) for all the previous data packets. Can anyone give me some pointers or a starting point? I haven't done multithreaded programming before, so I'm also not sure how to handle the synchronisation issues.
>>
>>59218208
Kind of like that, but with virtual addressing.
>>
>>59218277
that's the part i'm wondering about, and i'm also wondering which MMUs are the least braindead.
>>
>>59218332
>1.5gbs of audio
what the fuck
>>
>>59218296
Well for starters, for the sake of your own sanity, you might want to consider enforcing a certain alignment of addresses to save you from having to handle edge cases where the address spans two pages.
For example, forcing words to be word aligned should solve that problem.

The actual virtual to physical address translation is just a matter of maintaining a table of virtual to physical mappings and looking up the virtual address in the table to get the correct physical address.

It would be a good idea to take a look at http://wiki.osdev.org/Paging for inspiration.
>>
File: ayyy.jpg (169KB, 1838x428px) Image search: [Google]
ayyy.jpg
169KB, 1838x428px
>>
>>59218360
I'm a fan of keeping things simple, but (at least) on sparc, SIGBUS drives me up a fucking wall.
>>
what's the best coding keyboard?
>>
>>59218361
link?
>>
>>59218400
keyboard shouldn't be an issue
>>
>>59218400
>MacBook Pro
>>
>>59218361
Flawless.
>>
>>59218435
n-gate.com
>>
File: 1482612995504.png (18KB, 220x213px) Image search: [Google]
1482612995504.png
18KB, 220x213px
>>59214040
Implementing a ring buffer in a microcontroller to have it read and process samples from an ADC; and a system to report buffer overruns.

Ring buffers are beautiful but it's difficult to balance the delay of the system with the likelihood of having lost samples.
>>
>>59218446
I think there is a whole general that would disagree with you, famalam
>>
>sees a rust project with a very naive implementation
>want to contribute
>downloads git repo, tries to compile
error[E0106]: missing lifetime specifiers
--> /home/milo/.cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.85/src/unused_label.rs:49:6
|
49 | impl LateLintPass for UnusedLabel {
| ^^^^^^^^^^^^ expected 2 lifetime parameters

error[E0106]: missing lifetime specifiers
--> /home/milo/.cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.85/src/vec.rs:35:6
|
35 | impl LateLintPass for Pass {
| ^^^^^^^^^^^^ expected 2 lifetime parameters

error[E0106]: missing lifetime specifiers
--> /home/milo/.cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.85/src/zero_div_zero.rs:30:6
|
30 | impl LateLintPass for Pass {
| ^^^^^^^^^^^^ expected 2 lifetime parameters

error: aborting due to 93 previous errors

error: Could not compile `clippy_lints`.


Wow, Absolutely Excellent
>>
>>59218598
Wait 5-10 years before you consider using Rust at all.
>>
>>59217967
Why was this deleted?
>>
Is there only one implementation of Rust?
>>
Why do some people call arrays "buffers" honestly whats up with retarded terminology, just call it by the fucking data structure??
>>
>>59218934
really depends on the language you are using, famalam. there is big difference for example in java.
>>
>>59218934
Do you call your int variables integer1?
No, you name it based on it's purpose. If it's a buffer then it would be correct to name it so.
>>
>>59218934
>buffers
It's a more specific thing than an array.
It's often the case that they don't use it right though.
>>
>>59218981
>there is a big difference for example in java
Can you explain? Don't know Java very well other than it being an object oriented nightmare

>>59218998
Ok I can understand if you talk about stacks and queues and shit, thats reasonable, but come on what the fuck is a buffer its just a regular array if not a stack
>>
>>59219011
arrays: managed and garbage collected
buffer*: direct, unmanaged and thus faster. you can even go off heap for extra speed.

*there is a on heap bytebuffer but no one uses that because slow as fugg
>>
>>59218934
Buffers don't have to be arrays.
>>
>>59219093
Example?
>>
>>59219111
malloc(632)
>>
>>59219073
>arrays ...
>buffers ...
I don't agree on this.
>>
>>59219011
A buffer is used to store parts of larger data. For instance if you read from a file you often have a buffer that stores part of the file in memory for your processing convenience.
>>
>>59219220
ok
>>
File: IMG_0349.jpg (2MB, 3948x5000px) Image search: [Google]
IMG_0349.jpg
2MB, 3948x5000px
Still building a remote for my eos700d.
remote trigger and focus do work. Now gotta make up a cool and fancy menu with a nice timer to make nice timelapses or shit
>>
rewriting the linux kernel in lisp
>>
mitigating ddos attacks
>>
Who has the most raw autism and why is it C89 fanboys?
>>
>>59219793
The meme is rewriting things in rust, please pay attention next time.
>>
>>59219864
it's an alright place to start learning C if you are using the meme book
>>
File: 1356205471573.gif (3MB, 256x195px) Image search: [Google]
1356205471573.gif
3MB, 256x195px
>try to install Visual Studio because I want to compile a Windows library
>it eats all of my C: space even though I told it to install somewhere else
>8 fucking GB
>can't finish installing
>can't begin uninstalling because it can't create a system restore point
Microsoft is the epitome of shit. How do I fix this mess?
>>
>>59219867
the original meme is "rewriting the linux kernel in haskell", reddit.
>>
>>59218561
>Ring buffers are beautiful but it's difficult to balance the delay of the system with the likelihood of having lost samples.
If it's a simple mcu (i.e in-order, little pipelining) it's pretty easy since you can realiably calculate the exact clock cycles the ad reading/interrupt and your data processing code takes and always hit correct timings.
I've done this for most atmega cpus we use and I generally use the same clocks and prescalers everywhere (I work on industrial air flow controllers) so I have code templates setup for reading 1-5 ADs (most I've ever needed so far) every N ms with various buffer sizes.
>>
File: viz.webm (769KB, 1024x768px) Image search: [Google]
viz.webm
769KB, 1024x768px
I wrote a OpenGL based music visualizer.
pls r8
>>
>>59219925
2/10 don't have the music with it. please reupload.
>>
>>59219925
Looks a bit curved there.
>>
>>59219925
does not fit my to my music :(
>>
>>59219910
What the fuck, it actually installed a bunch of useless SDKs that I explicitly didn't ask to be installed.
>>
>>59219970
I can crank up the fft size.
It will probably look better then.
>>
>>59219984
why not ?
>>
Starting on revision 3 of my flash card game written in Rust. Hopefully I'm able to finish it before midnight. Any suggestions for a name?
>>
>>59220021
Memory Safe
>>
>>59220021
rust is shit
>>
>>59219910
Disable system restore and delete all restore points. It is a completely useless piece of shit.
>>
>>59219910
it sucks and there's nothing that can be done about it
>>
>>59220053
kek
>>
>>59219945
http://i.4cdn.org/wsg/1488564009012.webm
>>
>>59220019
my music does sound good
>>
>>59220130
shit taste in music
>>
>>59220130
Ok cool man i give 9/10 so you have room for improvement
>>
>>59220152
link me some "good" music
>>
>>59220130
ID?
>>
>>59220057
I never said Rust is shit, but I don't mind using it for toys programs. I could also go the Python route.
>>
>>59220169
https://www.youtube.com/watch?v=U4kN7SQZ-as
>>
>>59220191
>>59220224
https://youtu.be/63ISWzg_fh8
>>
>>59220224
>not posting superior german music
https://www.youtube.com/watch?v=jG7IGiBJU4c
>>
>>59220021
fn play<Cards>
>>
>>59220169
https://www.youtube.com/watch?v=WrsfJHLx5YA

https://www.youtube.com/watch?v=CMThz7eQ6K0
>>
>>59220021
Fuck it, I'm gonna use Python.
>>
                        memcpy(&r[(baseaddr[pc+1] & 0xe0) >> 5],(baseaddr.get_base() + stackptr - 3),4);

How do I implement this using a for loop that iterates over references to unsigned chars?
>>
File: 1468899863437.jpg (95KB, 394x404px) Image search: [Google]
1468899863437.jpg
95KB, 394x404px
do you agree with
"those who can't do, teach" quote?

i mean my professors teach, but some of them can code.
>>
>>59220678
>"those who can't do, teach"
This mostly applies to physical activity.
>>
Going to use my Arduino to make an RGB mood lamp with a microphone so it can change colour in response to pitch.
>>
>>59220817
Cool keep us posted
>>
>>59220678

>"those who can't do, teach"
In grade school? Maybe. In university? No. Universities expect a bit more from their professors aside from just teaching. They must also be regularly putting out research papers, and they are strongly encouraged to serve on some sort of committee to serve the department, college, or university.

Computer science professors typically concern themselves a lot with the theoretical side of the field, and may end up passing the buck of programming onto undergraduate and graduate assistants due to a sheer lack of time in their schedule. Without consciously putting effort into the act of programming, their skills may deteriorate.

You don't get into the position of professor without a PhD, which requires doing original research.
>>
>>59220855
top researches go into industry
people working at cern arent teaching
>>
kilo - 2^10
mega - 2^20
giga - 2^30
tera - 2^40
>>
>>59220855
>may end up passing the buck of programming onto undergraduate and graduate assistants due to a sheer lack of time in their schedule.
So much this. I fucking hate my guide.
>>
Can any of you bright fellows that have implemented a Finite Deterministic Automaton point me in the right direction?

I've chosen to use an adjacency matrix, but I don't understand how the matrix helps or is related at all. All I seem to gather is that the matrix helps the implementation of the automaton be general and re-usable for any type of automaton, instead of me "hard-coding" a clusterfuck of if statements that only work with the specific automaton I'm making, but I don't know why or how.
>>
>>59221005
A DFA has a transition function from a symbol and a state to a state. I.e. f : Sym * State -> State. This can be implemented as a lookup table from a Sym and a State to a State. If your symbols and states are just integers from 0 to some constant, it's very quick to do this with a matrix.
>>
>>59214222
4. Rewrite everything in Forth
5. Burn mozilla
6. Make thinking forth the bible for all age 14 and up
>>
>>59220952
constexpr std::uint64_t operator""  _B(std::uint64_t n) { return n << 00; }
constexpr std::uint64_t operator"" _KB(std::uint64_t n) { return n << 10; }
constexpr std::uint64_t operator"" _MB(std::uint64_t n) { return n << 20; }
constexpr std::uint64_t operator"" _GB(std::uint64_t n) { return n << 30; }
constexpr std::uint64_t operator"" _TB(std::uint64_t n) { return n << 40; }
>>
>>59221050
What I don't get is, once the matrix is completed, how do I use it to determine if the string ends in a proper Success State?
>>
>>59221115
You still need to have a set of success states that the current state is compared to. The matrix just implements the transitions.
>>
>>59221115
You need to review the basics of DFAs. Basically, the matrix stores the map from (States, Symbols) -> State

So, at each step, you will consume one symbol and find out the next state, i.e.
state_{i+1} = M[state_i][symbol_i]

state_1 = start state
state_n will be your final state. Just check whether that is an accepting state or not.
>>
File: gang_signs1.jpg (19KB, 400x310px) Image search: [Google]
gang_signs1.jpg
19KB, 400x310px
I was polishing off a project for class, but then our professor extended the deadline by a week since half the code uploaded so far didn't even compile. Now I'm back to procrastinating.

>>59221055
>6. Make thinking forth the bible for all age 14 and up
My school could have replaced two semesters of intro/general engineering with the lessons in that book. It's godly.
>>
>>59220678
No. Those who can't do, should not teach either.
>>
>>59220896
Top mathematicians are usually teaching, as far as I know.
>>
>>59221055
I like this plan.
>>
>>59216093
Because you know what good code looks like and can only imagine the pain you're creating for yourself.
>>
Forgive me if this is stupid, but I'm trying to learn C and I've come across something I don't understand and is difficult to explain.

Basically, I want this program to print "Test" only once within an infinite loop. I'm wondering why this program doesn't work, it doesn't make sense to me. I'm not asking for a solution or workaround, I just want to know why my program behaves in this way, because as it stands it doesn't print anything at all unless I alter it in some weird ways which I've described in comments.

#include <stdio.h>
#include <stdbool.h>

bool x = true;

int main()
{
for(;;) /* "Test" will be printed only if this is a non-infinite loop or the loop is broken from within */
{
if (x)
{
printf("Test");
x = false; /* Commenting this will allow "Test" to be printed even in an infinite, non-breaking loop */
}
}
}


I'm probably just retarded but I've been messing with this for an hour and I still don't get it.
>>
>>59221336
You didn't tell us what it was doing wrong.
>>
>>59221364
It doesn't print anything.
>>
>>59221364
Yes, she literally did.
>>
>>59221336
>>
>>59221336
Typically your terminal is buffered. I guess if you print a lot without any breaks, the buffer isn't flushed.
>>
>>59221336
you forgot to flush the buffer
add fflusf (stdout) after printf
>>
>>59221387
>if you print a lot without any breaks
It should only print once, though.
>>
>>59221420
Yeah, I read that wrong, makes more sense. If you print enough, the buffer gets flushed to clear it so you don't use infinite memory.
>>
>>59221396
This works, but I don't really understand why, I didn't think it would make a difference. Thank you.
>>
>>59221456
By the way. Don't use "stdbool.h" it's useless.
>>
>>59221456
Because I/O is not real-time but buffered. You basically put shit in the output file buffer with your function and it usually only flushes if you use an end of file or new line character, or if you explicitly tell it to.
>>
>>59221336
Try printing "Test\n". printf buffers the output until it gets a full line, and then actually prints it to the terminal. Alternatively, you could flush the buffer manually.
>>
>>59221500
I understand now, thank you for explaining.
>>
guys I'm trying to inherit std::iostream and its's throwing an "undefined reference to vtable for (my class)". The line numbers point to the constructor and destructor.
wat do?
>>
>>59221371
Please quote the section where she explains what it's doing instead of the expected behavior. Oh wait, you can't! Because she only said "hur dur, it's not working xD".
>>
>>59221543
>std::iostream
Did you define a destructor?
Also I think inheriting from standard library is not supported, but I don't remember exactly.
>>
>>59221573
>I want this program to print "Test" only once within an infinite loop
>as it stands it doesn't print anything at all

Dumbfuck.
>>
>>59221589
yes, all virtual functions I'm overriding have a definition. constructor and destructor too.
It's all in one header file though. maybe I need to move it to a .cpp file?

and I'm quite sure std::iostream is designed to be inherited from, why else would it have virtual and protected functions?
>>
>>59221637
Then sorry, I'm not expert on that topic but I had this issue once because I only declared but didn't define my destructor. Good luck.
>>
I'm trying to use an array of 2d arrays in C#, but I can't get the fucking thing instantiated without it bitching about unexpected symbols somewhere.

This should fucking do it right? I'm not being retarded?
string[][,] ascii = new string[27][H,L]

Where H and L are passed in arguments
>>
I stopped working on personal projects when I got a job.

I want to work on something which will make me feel Zen. What is a good, highly technical programming project in C
>>
>>59221682
thanks anyway. moving the virtual functions to a cpp file fixed it.
kinda makes sense when you think about it; virtual functions are called through a pointer which can only point to a single definition.
>>
>>59221820
Linux kernel
>>
>>59221336
It will print if you add a newline to the printf statement, i.e.

printf("Test\n");
>>
>>59221712
Technically, each of those arrays could have different dimensions, so you can't declare them all at once quite like that.

string[][,] ascii = new string[27][,];
ascii[0] = new string[2, 2] { { "ayy", "lmao" }, { "foo", "bar" } };
ascii[0] = new string[2, 3] { { "ayy", "lmao", "cuck" }, { "foo", "bar", "baz" } };


What exactly are you doing? This is likely not the best approach; it smells of "I'm used to another language so I'll just use arrays."
>>
Can a program that is multi-threaded run worse on a single core than if the same code was in a single thread ? (and I am not talking about the small overhead from job assignment and processing). Like if I divided up a single thread into 6 threads could it end up being 100-600% worse than if it was a single thread ?
>>
>>59221852
Trying to store ASCII letters of given height and width. So my 2d arrays are all going to be consistently sized, and I'll have a set length of characters (a-z and ?) so I know how many 2d arrays I need
>>
>>59221853
Yes. If your threads use different parts of the hard drive they could disturb each other.
>>
>>59221853
Yes.

Context switching is fairly expensive, and with multiple threads there are additional ways to shoot yourself in the foot like with what >>59221891 says and with false sharing which upsets the cache.
>>
>>59216042
something I've noticed in /dpt/:
- if you are a webdev, you are shit
- if you write in java, you are shit
- python is shit
- rust is shit
- C is shit
- ruby is shit
- C++ is shit
pretty much I stopped being offended long ago
>>
>>59221883
Why not set each ASCII letter as a string?

In any case, you'll be initializing the 2D array for each character you add, and the dimensions will be set at that time.

const int charRows = 2;
const int charCols = 2;

var muhLetters = new List<string[,]>();

var someLetter = new string[charRows, charCols]
{
{"ayy", "lmao" },
{"foo", "bar" }
};

muhLetters.Add(someLetter);

muhLetters.Add(new string[charRows, charCols] /* you could manually init here */);
muhLetters.Add(new string[charRows, charCols]);
>>
>>59215837
whenever you want
>>
>writing a program in C that has to do to do a lot with strings
>implement my own type so I dont have to use char*
>start adding utility functions so its not so clunky
>get to about 200 lines, stop and delete everything
>import java.lang.String;
>>
>>59221883
>>59222004
Even better, you could use a dictionary so you can retrieve the ASCII block letters with their character counterpart:

var muhLetters = new Dictionary<char, string[,]>();

var asciiCapitalA = new string[charRows, charCols] // pretend this forms an ascii 'A'
{
{"ayy", "lmao" },
{"foo", "bar" }
};

muhLetters.Add('A', asciiCapitalA);


I personally wouldn't do it quite like this, though.
>>
>>59222085
#include <string.h>

There you go
>>
>>59222085
Use strcpy_s
>>
>>59222003
That's because /dpt/ views everything through shit-tinted glasses.
>>
>>59222004
>>59222096
I was unsure of how to actually init the arrays at the time I wanted to assign them
Turns out I was massively overthinking it anyways, I only need a 2D array and some substring bullshit
>>
>>59222003
It's true, though.
Everything IS shit. Especially if it is popular.

A perfect language has yet to be made.
A problem that will outlive another problem: humanity.
>>
Anyone have that github page with all the programming exercise ideas? the one that auto generates for you?
>>
>>59222124
Yep. If I were you, I'd use a
Dictionary<char, string>
.

This would allow you to do some cheeky string-to-ascii-block things.
>>
const std::size_t size = 10;
std::array<byte, size> a { };

>msvc: ERROR: size must be a constant value.
any way to ignore this? gcc compiles it just fine but I hate seeing red squiggly lines in my code.
>>
>>59222200
Use
#define SIZE 10
>>
New thread:

>>59222231
>>59222231
>>59222231
>>
New thread:

>>59222230
>>59222230
>>59222230
>>
>>59222244
>>59222233
kek
>>
>>59222233
>>59222244
Amazing
>>
>>59222233
>>59222244
>230
>231

>both dubs

GOD DAMN IT, /dpt/
>>
>>59222226
I like some sanity in my code thank you
>>
>>59222233
>>59222244
Checked and kek'd
>>
Is there a website where I can find projects to contribute to for fun?
>>
>>59222285
github
>>
>>59222310
Okay thanks man :)
Thread posts: 321
Thread images: 23


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