[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: 348
Thread images: 47

File: w.jpg (41KB, 584x763px) Image search: [Google]
w.jpg
41KB, 584x763px
What are you working on, /g/?

Old thread: >>58806467
>>
post more cats programming please
>>
>>58811703
Hello /r/eddit please use an anime image next time.
>>
Which utility library to use for files+directory handling, allocators, data structures and threads when there's so many of them like qlibc, tbox, pjlib, glib?
>>
>>58811703
looks like my cat but with blue eyes
>>
File: thinking_hotaru.png (372KB, 954x768px) Image search: [Google]
thinking_hotaru.png
372KB, 954x768px
>>58811670
>doing the same thing
Excuse me?
>>
File: 1361734873016.gif (3MB, 278x296px) Image search: [Google]
1361734873016.gif
3MB, 278x296px
>>
File: linux_cat.jpg (188KB, 1280x853px) Image search: [Google]
linux_cat.jpg
188KB, 1280x853px
I wanna program something but I don't know what, give me some ideas
>>
>>58811740
waifuAI
>>
>>58811740
something that will make money!
>>
File: 1486169649166.jpg (62KB, 645x513px) Image search: [Google]
1486169649166.jpg
62KB, 645x513px
>>58811740
A complex AI
>>
>>58811740

Program me a program that does all the "classic" first year UNI programming problems for me.
>>
>>58811740
Make an application that takes every frame in an anime episode and apply waifu2x to it.
>>
>>58811770
what would be the purpose of such a thing?
>>
>>58811740
learn Java
>>
>>58811778
to upscale anime duh
>>
Still looking for help, since my code throws me an out of range error.

Console.WriteLine("Enter a string: ");
string kodString = Console.ReadLine();
string pos = "";
string nums = "";
string comString = "";

for (i = 0; i < kodString.Length; i++)
{
if(Char.IsNumber(kodString[i]))
{
nums= nums+ kodString[i] + " ";
pos= pos+ i + " ";

}
else
comString = comString + kodString.Substring(i, 1);
}


This is for getting numbers and their positions from the string.

for (i = 0; i < pos.Length; i++)
{
if(Char.IsNumber(pos[i]))
{
comString = comString.Insert(pos[i], Convert.ToString(nums[i]));
}

}


This is supposedly to put numbers back in their correct location. It's giving me an out of range exception on pos[i] in the .Insert part and I don't know why. Can someone help?
>>
>>58811778
Remaster episodes of old anime like Aria. The BD upscales are fucking shit and I've found that applying waifu2x to every frame of the show actually unironically makes it more watchable.
>>
>>58811703
>cat
Neko wa kawaii desu
>>
How often do you guys write things down on paper?
>>
-Update/rewrite my old scripts
-Add logging to my old scripts
-Making a custom logging module for fun

It's been a comfy weekend
>>
File: 1455954055666.jpg (49KB, 600x900px) Image search: [Google]
1455954055666.jpg
49KB, 600x900px
Anon:
"
Be honest, /dpt/
Programming is almost all about knowing your libraries.
For the 90% of the time, you are not required to implement a brand new algorithm, there are tons of libraries that does the job better than your algorithm.

Instead of teaching sorting algorithm the books should introduce people to some known libraries. This is much more productive. Of course, there can always be a new innovation but that's only for research.
"

/g/ in 2017:
>le fuk off pajeet XD
>>
Learning cmake/make
Unproductive weekend
>>
>>58811848
a lot
>>
>>58811848
Pretty often.
>>
>>58811848
Almost never
>>
>>58811848
>>58811873
>>58811877
>>
>>58811848
When I'm not behind a computer.
>>
File: homu_off.png (460KB, 800x600px) Image search: [Google]
homu_off.png
460KB, 800x600px
>>58811867
>learning make
Iktfb
>>
>>58811852
If libraries are so important, can you write a library that selects the library function that fulfills your need the best?

Oh wait, that's a framework... Good luck!
>>
>>58811852
Your argument is like claiming architecture is the science of swinging hammers.

It's insulting.
>>
How do I learn a new thing in programming?
>>
>>58811867
>learning something you can just man
>>
>>58811852
>>le fuk off pajeet XD
Just because you point it out, it doesn't mean that you're not a filthy pajeet code monkey.
>>
>>58811941
my name is Singh get it right
>>
merge sort first attempt
    public static void merge(int[] A, int[] B, int[] iArray) {
int a = A.length;
int b = B.length;

int i = 0; int j = 0; int k = 0;

while(i < a && j < b) {
if(A[i] <= B[j]) {
iArray[k++] = A[i++];
}
else {
iArray[k++] = B[j++];
}
}
while(i < a){
iArray[k++] = A[i++];
}
while(j < b){
iArray[k++] = B[j++];
}
}

public static int[] mergeSort(int[] iArray) {
if (iArray.length < 2)
return iArray;

int mid = (iArray.length / 2);
int[] A = new int[mid];
int[] B = new int[iArray.length - mid];

// printArray(A);
// printArray(B);

int j = 0;
for(int i = 0; i < mid; i++){
A[j++] = iArray[i];
//printArray(A);
}

j= 0;
for(int i = mid; i < iArray.length; i++){
B[j++] = iArray[i];
//printArray(B);
}

mergeSort(A);
mergeSort(B);
merge(A, B, iArray);

return iArray;
}

>>
>>58811931
Tackle new problems.
>>
>>58811852
You must be a pretty shit programmer if you believe that.
Programming isn't only about knowing your tools.
>>
>>58811950
>2016
>Not using the standard Java built in mergesort library
>>
>>58811968
fuck off pajeet
>>
>>58811852
>I'm unable to understand anything about computer science
>therefore everyone does
What kind of reasoning is this? Your lack of creativity is obvious.
>>
>>58811941
>Just because you point it out, it doesn't mean that you're not a filthy pajeet code monkey.
Just because you point it out, it doesn't mean that you're not a filthy pajeet code monkey.
>>
>>58811852
Yes and No.

True that when you get out of school the first thing they do is tell you to learn frameworks and tools like RabbitMQ, Postegres and libraries like React for almost any job. Even if you are doing kernel development there will be an in house gigantic library for handing almost all of the development, in fact I've never worked anywhere that didn't have it's own internal libraries and you just string them together but it's important to still know how said libraries work because you need to optimize them from time to time or know what sorting algorithm is best for the task.
>>
>use only the libraries you were told to use
>wonder why your program is so inefficient because you never learned the nuances of certain algorithms
>>
>>58812010
Wow, great comeback.
Are you fucking 4 years old?
>>
File: what_did_he_mean_by_this.png (179KB, 359x769px) Image search: [Google]
what_did_he_mean_by_this.png
179KB, 359x769px
>>58811852
Could you answer my question here >>58811737
please? Can you tell me why "combining two libraries" means "the libraries do the same thing" somehow to you?
>>
>>58811791
Please help.
>>
>>58812029
Well technically your first post doesn't have any value since it discredits its own argument. I'm not the original pajeet though.

/g/ is too edgy to do anything else than memeing. What a waste.
>>
File: 1407905937240.jpg (23KB, 500x375px) Image search: [Google]
1407905937240.jpg
23KB, 500x375px
>Be filthy pajeet
>Need to sort 30GB of data in a file
>Use built-in quicksort
>Performance is absolutely terrible on the Java® Virtual Machine™
Why is this, my friend?
I thought quicksort was the perfect sorting algorithm that should always be used, and there is no point in understanding anything about the algorithms I use, because they just werk.
>>
does anyone here actually post their progress or work on their projects or just meme endlessly?

What happened to the old /dpt/ where everyone would post their cool projects and what new cool features they added that day
>>
>>58812147
Simple my friend Quicksort is not good for large amounts of data
>>
>>58812149
>What happened to the old /dpt/ where everyone would post their cool projects and what new cool features they added that day
/dpt/ was never like that.
I don't want to shit up this thread with pointless blogposting about the most minor shit I did today.
>>
File: Capture.png (17KB, 749x511px) Image search: [Google]
Capture.png
17KB, 749x511px
I'm a beginner. Why is the class name not valid?
>>
>>58812181
Not allowed to start with a number, probably
>>
>>58812149
OOP killed programming. Most learning resources and universities teach you every memes that kill every bit of creativity in your brain. The adult world was a big fucking mistake.
>>
>>58812213
I tried writing different names and found that exact pattern. Is there some obvious reason I can't start a class name with a number?
>>
Anybody interested in programming language theory there's an undergrad seminar posted here: https://www.cs.uoregon.edu/research/summerschool/summer16/curriculum.php (or on jewtube here: https://www.youtube.com/playlist?list=PLiHLLF-foEez5Dis-VqoGcg3WepdMh4XT ) which uses this book, also avail for free as a draft http://www.cs.cmu.edu/~rwh/pfpl.html

If you know any elementary set theory you can figure all the above out http://www.people.vcu.edu/~rhammack/BookOfProof/

Thing about learning language theory is that once you learn abstract syntax trees and their graph abstractions plus other theory you can essentially pick up any other language by just looking over the spec, and immediately know what future problems you will likely come across if using it for some project. You can also then contribute to language spec development in whatever language you like, like say C standards or Rust or Haskell and know what you're talking about.
>>
>>58812232
Simplifies parsing for the compiler
>>
>>58812232
Hard to understand for humans and for parsers
>>
>>58812169
But how is my non-CS pajeet brain supposed to know that?
According to >>58811852, all I need to know are libraries.

>>58812232
Allowing names with numbers at the start introduce ambiguity for the parser, and are just inconsistent overall.
Just name it ex_1_04 or something.
>>
I made a tictactoe

can gib job
>>
>>58812331
in what language?
>>
>>58812274
>>58812281
>>58812283
Alright, thanks
>>
>>58812181
In java, numbers (or maybe only ints, idk) can have underscores in them, so 1_04 is a valid literal. You can imagine it would be hard for java to differentiate the identifier (class, in your case) named 1_04 and a literal with the value 1_04
>>
>>58812149
I'm trying to find the cause of dropped/uncommitted messages in a network stream. Nothing interesting.
>>
>>58812343
c# lmao

first time I'm enjoying programming
>>
>>58812331
I actually got one showing a tic tac game I made with an enterprise database and networking version of tic tac toe connecting to a server which the large software development firm boss was impressed I wrote it all by myself
>>
>>58812169
>Quicksort is not good for large amounts of data
Explain.
>>
>>58812375
https://en.wikipedia.org/wiki/Quicksort
>>
>>58812375
As the anon who originally posted the "question", I'll give an explanation.
I know the answer, I was just trying to poke fun at the stupid "only learn libraries" idiot.

Quicksort has a lot of random data movement. E.g., in the step where you move the data below and above the pivot.
With large amounts of data, you won't be able to fit all of it into memory at once, so your operating system is going to have to page that shit, and when you're randomly swapping shit, your OS is going to constantly pull pages into RAM and push other pages out to RAM.
This is absolutely terrible for performance, and even with an efficient (average case O(n log n)) sorting algorithm, it's going to take forever.

When writing sorting algorithms for large amounts of data, you need to keep this page swapping and random access in mind.
There are a class of sorting algorithms called "external sorting", where you use other files to sort large files, keeping the amount of memory needed to sort a large file low, and not thrashing the pages.
>>
>>58811950
>>58812065
Please, this is really annoying me for the last day or so.
>>
can you guys help me out? i'm trying to rewrite a program i wrote in c# in c++ for performance reasons. for some reason however, it appears as though the program i wrote in c++ is only using 600kb of memory whereas the c# version uses 17mb.

how can i tell my c++ program to use more memory?
>>
>>58812480
>push other pages out to RAM
out to disk*
>>
>>58812483
You didn't even say what the issue is
>>
>>58812491
wat
>>
>>58812483
what are you replying to me for
>>
>>58812491
void * useMoreMemory = malloc(1024*1024*1024);

should make it use 1GB
>>
>>58812149
Sure. Use some alias and Ill make real posts, if you really want to hear about real development.

I'm trying to make a CRM and workflow manager in PHP. Haven't dug into PHP in awhile and Im having a hard time conceptualizing how the workflow manager would do a Post to MySQL, then reassign the top task in the workflow without fucking the table ID's or without doing a mass rework of all scored entries in the MySQL table.
Going to dig into other peoples projects. My apprentice made the base HTML as a good first project so just working the back end code today.
>>
>>58812503
I'm having an issue with adding the numbers back into the correct position in the string, how do I do that with the replace method?

>>58812509
Sorry, quoted the wrong code.
>>
>>58812491
(void *) malloc(17408)
>>
How do I write a program that stops this snowstorm outside?
>>
>>58812572
>Casting to (void *)
>Casting at all.
>>
File: our-history-cheers.png (26KB, 450x408px) Image search: [Google]
our-history-cheers.png
26KB, 450x408px
>>58812365
Glad to hear someone is enjoying programming today. Never dug into C# but saw it had some leverage with Sharepoint servers. Have you found it fairly easy to pickup?

An aside, does anyone have python or C++ source code that can analyze an image's metadata? I feel like with the recent injects into pictures and chrome side channel attacks merit viewing pictures metadata before passing it into chrome or local machine programs.
>>
>>58812572
>>58812521
>>58812507
nvm that's totally not why it's so slow. i actually have no idea how c++ works. any ideas why a pretty straight forward algorithm would be 18 times slower in c++ than in c#?
>>
>>58812591
why the fuck do you want the snow to go away? snow is the greatest thing to happen to this planet, it makes everything so comfy

I want to move to a place that gets a lot of snow after I graduate just because I love it so much
>>
>>58812623
You wrote it poorly.
You didn't compile with optimisations turned on.
You didn't write it in C instead.
>>
>>58812623
Maybe you used std::list where you used List in C#. std::list is linked, List is array-based.
>>
>>58812623
you are probably running in debug mode
>>
>>58812591
idk ask bill gates, weather manipulation is being worked on by those whacky futurists
>>
>>58812661
that seems to be it, now it's ~40% faster. thanks friend.
>>
>>58812705
what are you even measuring?
>>
>>58812740
Compile times.
>>
(ns dijkstra.core
(:gen-class)
(:require [clojure.string :as str]))

(defn parse-graph-file [filename]
(with-open [rdr (clojure.java.io/reader filename)]
(->> (line-seq rdr)
(reduce (fn [g line]
(let [[u & vs] (str/split line #"\s+")
u' (Integer/parseInt u)
vs' (->> vs
(map #(str/split % #","))
(map (fn [[e l]] [(Integer/parseInt e) (Integer/parseInt l)])))]
(assoc g u' vs')))
{}))))

(defn dijkstra [graph start]
(letfn [(inner [visited edgelist]
(letfn [(update-edges [u edgelist]
(->> (into edgelist (map (fn [[v l]] [u v l]) (graph u)))
(filter (fn [[u* v* _]] (not (contains? visited v*))))))
(compfn [[_ minscore :as old] [v* w* nextlen]]
(let [d* (+ (visited v*) nextlen)]
(if (< d* minscore)
[w* d*]
old)))]
(if (= (count visited) (count graph))
visited
(let [[newnode newdijk] (reduce compfn
[nil Integer/MAX_VALUE]
edgelist)]
(println (str "Added " newnode ", distance: " newdijk))
(recur (assoc visited newnode newdijk) (update-edges newnode edgelist))))))]
(inner {start 0} (map (fn [[v l]] [start v l]) (graph start)))))


(defn dijkstra-file [filename start]
(dijkstra (parse-graph-file filename) start))

(defn solution []
(let [results (dijkstra-file "input.txt" 1)
ends [7 37 59 82 99 115 133 165 188 197]]
(map #(results %) ends)))



Coursera programming exercises
>>
File: test (2).png (716KB, 811x599px) Image search: [Google]
test (2).png
716KB, 811x599px
>>58812690
Quantum computation will be able to accomplish total weather control
>>
File: 1442435716008.gif (1MB, 300x300px) Image search: [Google]
1442435716008.gif
1MB, 300x300px
Best resources for learning node.js?
>>
>>58812841
The first weather machine will run on python
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>58812865
>node.js
>>
File: really_implores_you_to_ponder.png (147KB, 231x361px) Image search: [Google]
really_implores_you_to_ponder.png
147KB, 231x361px
>>58812870
By Pythons are coldblooded
>>
>>58812503
So, can you help me with it?
>>
>have a file main.c
>have another file
tfuncs.c
and
tfuncs.h

>have a function in tfuncs.c that returns void and isn't defined in tfuncs.h
>I can still call that undefined function from main.c but it returns int instead of void
Why is this allowed? Why doesn't the compiler stop me from doing this shittery?
>>
>>58811929
take it easy drama queen
>>
>>58812879
You got any better suggestions
inb4 kys
>>
File: 001.jpg (608KB, 1280x1852px) Image search: [Google]
001.jpg
608KB, 1280x1852px
>>58812882
That's why they need the weather machine
>>
>>58812893
Stop compiling in C89 mode.
They stopped that shit from being valid in C99, and every function you call needs a prototype.
>>
>>58812913
Go || kys
>>
>>58812913
kys
>>
>>58812917
>that doujin
>>
>>58812930
Still compiles, just gives me a warning
>>
>>58812865
Bought this book the other day and was decent.
Learning Node.js: A Hands-On Guide to Building Web Applications in JavaScript (2nd Edition)
by Marc Wandschneider (Author)
>>
>>58812975
>just gives me a warning
Right. What else do you want? A warning is already a huge red-flag that you should fix your shit.
Otherwise, you can be one of those fags who compiles with -Werror.
>>
File: 1462565199381.jpg (40KB, 657x527px) Image search: [Google]
1462565199381.jpg
40KB, 657x527px
>>58812999
>>58812975
>>58812930
>implicit functions declarations are valid in C
Why does /g/ praise this shitlang so much again?
>>
>>58813062
If you could read, you'd notice one of the posters saying it's not allowed in C99
>>
to be considered a 'good' programmer should I be able to create all the popular sorting algorithms from memory?
>>
>>58813062
>are
WAS.
I agree they are shit. C89 has a lot of weird legacy shit that people used to think was a good idea.
In C99, they removed those things, and "modernised" the language a lot.
Modern compilers are still going to accept those things, as they still want to be able to compiler legacy code, and help the transition from any codebase coming from C89 to C99/C11, and they will emit a warning.
>>
>>58812950
Vanilla is the strongest

>>58813090
The results you produce matter more than the method
>>
>>58812572

>casting void* to void*
>allocating only 17 KiB when 17 MiB was requested
>not using operator new in C++
>>
>>58812917

Holy shit thanks for this. Was amazing.
>>
Planning to write a program that organizes photos of /soc/ anons based on every image query.
>>
>>58813090
Might pop up in an interview, but I'd say it'd be more important to understand things like algorithmic complexity so that you know in what situations it would be more appropriate to use a certain algorithm over another.
Throwing libraries that you don't understand at a problem like the other poster suggested is dumb.
>>
File: 1480648410711.jpg (95KB, 729x1250px) Image search: [Google]
1480648410711.jpg
95KB, 729x1250px
>>58813110
You're amazing
>>
>>58812623
>i actually have no idea how c++ works
no one has any idea

c++ is a joke
>>
in c++, how do i make it so my array can hold millions of ints without vs crying about a stack overflow

i really need these ints
>>
>>58813237
Stop using C++.
>>
>>58813237

>millions of ints
Allocate on heap, not stack. Use std::vector if possible.
>>
>>58813237
use vector, or allocate space on the heap yourself
>>
>>58813237
>my array can hold millions of ints
stop trying to bruteforce your problem, theres a better way
>>
>>58813263
does #include array use the stack?
>>
>>58813276

There are plenty of legitimate reasons to store millions of integers.
>>
Am I a computer programmer now?

#include <stdio.h>

int main(void){

int counter, i;
unsigned long long int fact;

printf("\n\n\n");
printf("n n!\n");
printf("--- ---\n");

counter = 1;
while (counter <= 20){
fact = 1;
for (i = 1; i <= counter; ++i){
fact = fact * i;
}
printf("%i %llu\n", counter, fact);
++counter;

}
return 0;
}
>>
>>58813296
What?
>>
Everyone state the /dpt/ poster they find most aggravating. I'll go first:

>'I want to program something but I don't know what'
>>
>>58813312
I have too much shit I want to program.
>>
>>58813237
"millions" is just a couple megabytes

strange that the stack can't handle it
>>
>>58813311
> array a;
>>
File: 1477859803400.jpg (201KB, 600x600px) Image search: [Google]
1477859803400.jpg
201KB, 600x600px
>he unironically uses hash tables
>>
>>58813350
I'm more of a fan of tries, myself.
>>
>>58813296

std::array is implementation defined as to where it stores it memory. It could very well use the stack, serving as a wrapper around the regular array type.

You should use std::vector, which will pretty much guaranteed use the heap. It is also resizable if need be.
>>
>>58813350
You can hash my table qt
>>
File: for_what_purpose.png (63KB, 272x488px) Image search: [Google]
for_what_purpose.png
63KB, 272x488px
>>58813237
>millions of ints
>>
>>58813305
>
unsigned long long int fact;

C is abhorrent
>>
>>58813263
it works, thank you
>>
>>58813373
>implying your compute can store something else than numbers
>>
File: Capture.png (17KB, 673x383px) Image search: [Google]
Capture.png
17KB, 673x383px
Any reason why I should not be allowed to run this? I opened it in Netbeans by doubleclicking the .java file provided in the teaching material. I have opened .java files for earlier files and run them without issues
>>
>>58813350
You should be using hash tables for everything.
>>
>>58813418
>run program
>read error
>fix error
>werks
>>
How do you compile C++ code?

I saw people use -Wall but also other crap.
>>
>>58813433
I'm not allowed to run it. The Run button is greyed out.
>>
>>58813418
fond rendering rapes my eyes

if you like that look just use IntelliJ it's a billion times better imo
>>
>>58813451
I haven't got a clue, just installed Netbeans and sat down with a textbook. I can look into changing it if it's easy enough.
>>
>>58813441
>The Run button is greyed out.
you forgot to exit out
>>
>>58813319

Linux default stack size: 8 MiB, or 2,097,152 32-bit integers.
Windows default stack size: 1 MiB, or 262,144 32-bit integers.

"Millions" implies at least 2 million, but less than a billion. Anon could want to store perhaps 5 or 10 million. Without using system calls to increase the stack size, it is clearly a case for using the heap.
>>
>>58813473
Exit out of what? I already tried to restart the application a couple of times, as per some stackoverflow discussion
>>
>>58813350

Supposing I have a custom struct, what do you propose would be the best data structure to use for fast lookup of elements of this type while using strings as keys?
>>
>>58813494
>Linux default stack size: 8 MiB, or 2,097,152 32-bit integers.
>Windows default stack size: 1 MiB, or 262,144 32-bit integers.

I feel like in 2017 it should be more, especially on Windows desktop machines.
>>
File: 0221e4325da96e3e0aee8348fc40ff49.png (161KB, 1280x720px) Image search: [Google]
0221e4325da96e3e0aee8348fc40ff49.png
161KB, 1280x720px
>>58813434
Depends on what libraries you're using in the programs you're compiling
>>
>>58813434

I would recommend you run g++ --help or clang++ --help if you want to get a sense of the flags passed to your c++ compiler.
>>
File: 1465788977028.webm (61KB, 720x960px) Image search: [Google]
1465788977028.webm
61KB, 720x960px
>>58813350
>he unironically uses trees
>>
thank god this thread isn't like the last one screaming about "leftists" and pajeets. i'm convinced it was a raid by /pol/acks who don't even come here usually
>>
>>58813768
t. leftist pajeet
>>
>>58813768
you have to go back
>>
>>58813540

Applications can be configured to have a higher stack size, but there is no reason why they need to be higher by default. Anything that needs to be particularly large belongs on the heap anyways.
>>
>>58813768
It was because I was asking about where '''''''these quotes''''''' come from, and silly enough to suggest it might be /pol/. The thread then suddenly disintegrated into what threads are apparently like on /pol/.
>>
>>58813862
>where '''''''these quotes''''''' come from
its a gimmick from /int/ that people probably mix up with the (((jew))) echoes
>>
>>58813768
t. pajeet lelftist
>>
i love that in c++, bools are integers
>>
>>58813430
What's everyone's favorite hash table? I just modify K&R's because I'm lazy.
>>
>>58813911
not quite true
>>
File: mpv-shot0004.jpg (59KB, 853x480px) Image search: [Google]
mpv-shot0004.jpg
59KB, 853x480px
tfw to brainlet for sicp

These exercises are hard.
>>
>>58813768
>>58813804
>>58813849
>>58813862
Is this 4chan's version of Godwin's law?
>/pol/ is literally Hitler
>>
>>58813768
hello my friend good to see more of us here
>>
File: test (5).png (416KB, 612x892px) Image search: [Google]
test (5).png
416KB, 612x892px
>>58813922
Keep it up anon I believe in you
>>
>>58813911
any language but probably hakell, bools can be implicitly ints
>>
>>58813397
He could have just written
unsigned long long fact;

or even
uintmax_t fact;


"long long" has some history to it, and while it is kind of weird, it was the least-shit solution to a problem.
>>
>>58813089
it's still allowed in gcc unless you -Werror
>>
>>58814051
>it was the least-shit solution to a problem
No it's not.

There should be fixed width types and efficient types based on machine word/address/etc. size, nothing in between.
>>
>>58811703

Do compilers always generate completely optimal assembly when the function is 8 bit in and 8 bit out?

they could just make a look up table mapping inputs to outputs
>>
>>58814051
meanwhile in a sane language thats just
ulong fact;


but yeah I know
>>
>>58814089
That's not necessarily optimal.
>>
>>58814082
rust did this and now you need to cast ints out the ass because there isn't a generic word sized int type
>>
>>58814103
>now you need to cast ints out the ass because there isn't a generic word sized int type
M E M E
E
M
E

L A N G U A G E
A
N
G
U
A
G
E
>>
>>58813768
bye bye pajeet, you must leave
>>
>>58814103
>and
>AND
Also, what are isize, usize.
>>
>>58814082
>fixed width types
<stdint.h>.
However, using fixed width types without a good reason is stupid and hinders portability.
>efficient types based on machine word
Typically just the plain int.
>address
(u)intptr_t, ptrdiff_t, size_t or whatever.
>nothing in between
Why?

>>58814098
They didn't want to add a new keyword to the language, as that has the potential to break existing code, and they didn't want to have _Verylong or something. Re-using the long keyword has the 'best' solution.
>>
>>58811791
Super late, but I think you must use kodString.Length - 1 in your for loop to avoid out of range error.
>>
>>58814138
>as that has the potential to break existing code
this shit really needs to stop.
>>
bet i'm whiter than all of you fatass amerilards combined
>>
>>58814161
We don't want some Python 2 vs Python 3 shit going on.
>>
>>58814138
>Why?
Because there's no point for there to be anything in between like "long" or "long long" which are sort of fixed width but also not really. Have you ever used "long long" to mean anything but uint64_t/int64_t? That's not what it means, of course, you're relying on implementation defined behaviour to do so.
>>
>>58814138
>>58814181
At the very least, these types that are AT LEAST some fixed width should have descriptive names. Like uint32fast_t. Oh, that exists, why isn't that ever fucking used?
>>
>>58814181
You're not considering the fact that CHAR_BIT != 8 architectures exist, and that implementations are free to have long long be greater than 64 bits.
>you're relying on implementation defined behaviour
Sure, but there are still plenty of valid assumptions you can make.
CHAR_BIT >= 8
sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long)
sizeof(short) * CHAR_BIT >= 16
sizeof(int) * CHAR_BIT >= 16
sizeof(long) * CHAR_BIT >= 32
sizeof(long long) * CHAR_BIT >= 64
>>
why are professors so bad at teaching how to programming?
>>
>>58814245
So why do people use "long long unsigned" instead of "uint64fast_t", for instance? And so many people use "int" as "int32_t" when there's zero guarantee that it's even that big.

Fixed width and fast minimum width types are all that should be used.
>>
>>58814269
Because people are dumb.
>>
>>58814268
>why is uni a joke for most things
(((who))) xnows
>>
>>58814225
>uint32fast_t
I think you mean uint_least32_t. It has the added restriction that it's the smallest type that meets the requirements, so if long and long long are 64 bits, int_least64_t will be long.
>why isn't that ever fucking used?
They're cumbersome to write and that sort of guarantee isn't needed often.
They seem like they would be more appropriate behind a typedef.
>>
>>58814268
Because no one in academia needs to do any extensive programming to publish. They either specialize in theory or leave for the private sector.
>>
>>58814308
I guess you could argue that you want the least types as well.

But still the nondescript "int" "long" "long long" nonsense should go, they're too widely abused.
>>
>>58814324
They're not going to make such a fundamental change to the language, you idiot.
>abused
How? Most of the time, people just use int, which is a "natural size", "I don't care what size it is" type.
If you're doing something that is conceivably going to go over 32,000, and you're trying to have maximum portability, use a larger type.
>>
>>58814375
Java solves this problem by having a BigInteger class it is the optimal solution

Numbers are objects btw
>>
>>58814405
Nobody cares about your slownums.
We're talking about fixed width integers.
>>
>>58812622
An injection into the image will change the hash of the file.

Here is a good read to fully understand stenography: http://www.garykessler.net/library/fsc_stego.html

You will probably need a forensics software like Encase or AccessData FTK.
>>
File: 1486090494291.jpg (78KB, 504x425px) Image search: [Google]
1486090494291.jpg
78KB, 504x425px
>>58814405
>Numbers are objects btw
>>
>>58814405
>Numbers are objects btw
>>
>>58814452
>>58814441
same person
>>
how is long long int nondescript? its a very long integer
>>
>>58814462
>>58814441
>>58814452
All me
>>
>>58814462
>>58814471
This is me: >>58814441
>>
>>58814471
>>58814480
>>58814462
this is me >>58814452
>>
>>58814471
>>58814480

k || y || s
>>
install java
>>
>>58811703
that is it, I wont check these shitty threads anymore it is just not worth it
>>
File: Fib2sWc.png (78KB, 282x300px) Image search: [Google]
Fib2sWc.png
78KB, 282x300px
is /dpt/ the new cringe thread?
>>
>>58814529
Now that you're here yes
>>
Error C4996 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.


is this important?
>>
>>58814726
no
>>
>>58814726
How is fopen unsafe?
>>
Error C6666 'C': This language may be unsafe. Consider using Rust instead. To disable deprecation, use _C_PLUS_PLUS. See online help for details.
>>
>rust
nice meme
>>
>>58814245
You're more likely to run into a system where you incorrectly assume that `long long' is 64 bits, than you are to use a system where bytes aren't 8 bits.
>>
>>58811703
figured I'd make a bruteforce calculator today but hit a hurdle instantly because I don't understand the fundamental math
so if I have a charset of 26 and a password length of 6 how do I calculate how many possible combinations there are? dumb it down as much as possible
>>
@58814786
>rust
>>
>sepples
>>
File: 1475373542497.png (215KB, 600x600px) Image search: [Google]
1475373542497.png
215KB, 600x600px
>his shitlang doesn't have implicit function declaration
>>
>>58814828
If you have a charset of 26 and a password length of 1 how many combinations are there?
If you have one string with X combinations, and another string with Y combinations, then how many combinations is the two strings appended to eachother?
>>
File: test (10).png (2MB, 1484x1120px) Image search: [Google]
test (10).png
2MB, 1484x1120px
>>58814828
>look at how many choices you have for the first letter
>look at how many choices you have for the second letter
>???
>profit
>>
>>58814776
It's not, all fopen_s does more is check that the arguments aren't NULL. It's completely useless.
>>
>>58814861
>If you have a charset of 26 and a password length of 1 how many combinations are there?
26? so it's just charset x password length? if so I think I'm a retard, if not I think I'm still a retard
>>
>>58814885
Jesus Christ, how old are you
>>
File: helppls.jpg (26KB, 402x290px) Image search: [Google]
helppls.jpg
26KB, 402x290px
can somebody help me out? i'm learning how the file system works in c++. i'm trying to create a copy of a jpeg but for some reason, the copy ends up being corrupt. it's 1kb bigger than the original.

what am i doing wrong?
>>
>>58814885
Let's think about if we have a set with A, B and C, and then another set with X, Y and Z.
If we want to create a set with exactly one of each, how many ways can we do this?
AX
AY
AZ
BX
BY
BZ
CX
CY
CZ
That's 9 things.
Think about this as we have a length of 2 and a charset of 3. How do we turn 2 and 3 into 9?

What if we add another set, T, S and U. How many combinations of all three sets?
TAX
TAY
TAZ
TBX
...
SAX
SAY
SAZ
SBX
...
UAX
UAY
UAZ
UBX
...

Counting these all out would be tiring, but the pattern is fairly clear.
>>
>>58814919
>he fell for the fopen_s gimmick
>>
>>58814919
What the fuck why are you using the C IO library and the C++ IO library at the same time?
Why not just use ifstream and ofstream? Why use FILE* at all?
>>
>>58814940
i googled how to disable the warning. it was more work than just using fopen_s so i went with fopen_s
>>
>>58814947
just ignore it and use fopen you dimwit
>>
>>58814946
will that fix the corrupt image?
>>58814957
it wouldn't let me run the program without changing it
>>
>>58814917
19 just really fucking dense
>>58814933
so if I had 26 characters and 5 length it'd be 26^5 or 26x26x26x26x26?
>>
Stop me if I'm a retard, but

Can I make an #include <includes.h>,
and inside includes.h, I have...
#include <1.h>
#include <2.h>
#include <3.h>
#include <4.h>

And will it include all the files into the main.c?

As I said, shoot me the fuck down if I have retardation, please.
>>
>>58814979
>wouldn't let me run the program without changing it
#define _CRT_SECURE_NO_WARNINGS

consider also switching to an operating system or compiler that doesn't suck shit
>>
>>58814997
Ye that's usually how including code snippets work
>>
>>58814982
yes

>>58814979
dunno maybe not.
it's probably either:
size = SwanFile.tellg();

not correctly telling the right amount. Find out how many bytes this is exactly

another possibility is that because you're on windows, it's doing some fuckery with \r\n's and you need to tell it that it's a binary file. Maybe put that in fopen() along with the 'w'. Or use ofstream where it will look analogous to your ifstream and you pass the same ios::binary flag to the constructor.
>>
File: 1457371857115.jpg (25KB, 390x376px) Image search: [Google]
1457371857115.jpg
25KB, 390x376px
>wanna use clion because everything else is shit
>they want you to pay $200 a month to use it
how do they get away with this?
>>
>>58815025
just use emacs you cuck
>>
>>58814997
you typically only want to include what you need. Otherwise you run into circular dependancies
>>
>>58815025
Just use vim you mong.
>>
File: 1.png (8KB, 525x124px) Image search: [Google]
1.png
8KB, 525x124px
>>58811852
>even /pol/ knows better
>>
>>58815019
i had to pass "wb" to fopen because i'm reading binary, now it works.
>>58815008
ty
>>
File: yoshikawa_smug1.png (306KB, 352x512px) Image search: [Google]
yoshikawa_smug1.png
306KB, 352x512px
>>58815025
You know what you must do anon
[spoiler]pirate it [/spoiler]
>>
>>58815035
The main.c will be what I want to include, and main requires 1, 2, 3, 4 h files.


Basically, I need to include a heck ton of includes in my main file and I don't want the clutter at the top it. Instead, I'd prefer to make a file that sends the includes to the main.c, and have one include at the top of the main.c file, so I don't have to scroll down that little bit.

And if I had other files branching off, making shit like "includes_[file]" i.e.
"includes_alloc.h"
"includes_main.h"
"includes_ring.h"

Which gives includes to each of those files and in those said files link the includes via those files...


tl;dr I want to categorize my includes and not make it so visually aggressive, and split it up.

Will this hurt the compile/runtime of my code in any way that matters?
>>
>>58815033
>>58815048
I've used both notepad clones for many months at a time and they're both shit
>>
File: 7nTnr.png (67KB, 308x300px) Image search: [Google]
7nTnr.png
67KB, 308x300px
>>58815072
Wait, are you calling vim a notepad clone
>>
>>58815072
>both notepad clones
(you)
>>
Say I have a string of numbers that are a position of certain characters in a different string.
How would I check when the position goes from one digit to two digit?
Example: string a ="1511121320"
Contains occurences for character x on the 1, 5, 11, 12, 13 and 20 position.
I know you can do it with an array, but is it possible to do without?
>>
File: img_130.png (149KB, 372x454px) Image search: [Google]
img_130.png
149KB, 372x454px
>>58815072
Damn this bait goes hard
>>
>>58815072
>emacs is a notepad clone
either spend some time configuring company and flycheck or try spacemacs

notepad doesn't have buffers or any scripting capability whatsoever
>>
I'm just trying to learn python
>>
>>58815125
Wrong
>>
>>58815099
You can't tell and you should just put commas or spaces in the string between the numbers so that this isn't an issue.

>>58815114
i installed spacemacs once and it seemed like a giant clusterfuck and more difficult to learn than just installing emacs and learning some M-x commands. Are there any particular parts of spacemacs that are great and I can just install into emacs to improve my experience without diving completely into someone elses gigantic config
>>
>>58815135
yeah, evil, company, helm and flycheck
>>
>>58815130
>not an argument
>>
>>58814828
26 * 26 * 26 * 26 * 26 * 26
>>
>>58815135
If I put spaces, how do I get the position out if it's 2 integers?
>>
>>58815125
stop before it's too late
>>
What's the difference between linking a static library and linking a dynamic library?
>>
>>58815264
one has the whole program as a single executable, the other has secondary files (e.g. DLLs) as runtime libraries
>>
>>58815264
static linking copies all the symbols you use into your executable

dynamic linking introduces a dependency on the entire library but it's contained in a file
>>
>>58815264
always statically link if you can.
>>
>>58815264
>>58815285
and with dynamic libraries you could update the dynamic library (assuming you didn't change the interface), and then use the new dynamic library without altering the old compiled executable that uses it
>>
File: 1460582833330.jpg (42KB, 480x670px) Image search: [Google]
1460582833330.jpg
42KB, 480x670px
>>58815285
>>58815290
>>58815300
>>58815301
When attempting to link a static or dynamic library in my preferred ide, is it the same process for both types?
>>
>>58815321
should be

underneath, not really
>>
>>58815321
>is it the same process for both types?
depends on the library
you may have to drop dlls in your bin or src folders
>>
is there a really good crypto library everyone uses for c++?
>>
>>58815352
don't assume windows
>>
>>58815388
meh, for beginners i will
>>
>>58815362
yeah, openssl, gnutls, libgcrypt

if u want c++ maybe boost has some shitty crypto blob LOL
>>
>>58815428
dumb question time

can i use those on windows
>>
>>58815463
>openssl
yeah
>gnutls/gcrypt
maybe with mingw

google schannel maybe, it's windows' native tls impl
>>
>>58815215
int parse_int (const std::string& s) {
return std::atoi(s.c_str());
}
std::vector<int> positions (std::string a) {
std::vector<int> result;
while (true) {
auto pos = a.find(' ');
auto elem = a.substr(0, pos);
result.push_back(parse_int(elem));
if (pos == std::string::npos)
break;
else
a = a.substr(pos + 1);
}
return result;
}
>>
>>58813927
I mean, /pol/ literally praises Hitler so it was only due time till it happened
>>
File: 1483595409846.png (10KB, 216x233px) Image search: [Google]
1483595409846.png
10KB, 216x233px
>tfw too much of a brainlet to write your own hash table from scratch
>>
Hey guys I got a question about Java.
I'm working on a school project regarding health issues.
The idea is simple, Everytime the user clicks, it adds to a counter. When it reaches approx 500 clicks, it will display a health tip.
So is there no way to implement this without clicking on the jPanels? As in it records mouse events outside of my GUI? Some say just create a transparent overlay. Will it be able to click through the jPanel? Another suggestion was to use mouse POS(x,y). Does it register outside of the GUI?
Help is appreciated. Thank you.
>>
>>58815553
>/pol/ literally praises Hitler
no they praise what he did for Germany.
>technology
>>
>>58815566
HAS to be a pasta
>>
File: (you).jpg (191KB, 1600x1000px) Image search: [Google]
(you).jpg
191KB, 1600x1000px
>>58815072
>I've used both notepad clones for many months at a time and they're both shit
>>
>>58815574
Nah. Sounds exactly the kind of useless thing schools make students do with Java.
>>
File: 1483721177622.png (94KB, 396x395px) Image search: [Google]
1483721177622.png
94KB, 396x395px
Is there a language which is "by whites for whites"?
>>
File: light_kek.png (160KB, 253x424px) Image search: [Google]
light_kek.png
160KB, 253x424px
>>58815566
lol
>>
>>58815604
no
>>
>>58815604
haskell
>>
>>58815604
English
>>
>>58815571
I'm not hating on /pol/ or Hitler. I'm pretty indifferent to them(even though I agree with them a lot).
I'm just saying they like him a lot.
>>58815463
Yeah. If you want it to be portable, install MSYS2 and then use
>pacman -Syu ,package. to install shit
Otherwise use Cygwin and look for apt-cyg on github.
>>
>>58815613
but the two posters below you disagree. care to disprove them?
>>58815617
>>58815627
already know those.
>>
>>58815627
English is absolutely not a white language anymore. something like Slovak or Icelandic would be much whiter as a percentage
>>
>>58815604
C
By white unix hackers with beards, for white unix hackers with beards
>>
>>58815653
no such thing
>>
>>58815571
>what he did for Germany.
you mean cuck his nation for centuries to come? yeah, that's a pretty great achievement.
>>
>>58815604
Rust, but only if you're trans.
>>
>>58815604
C
>>
somechar &= ~(1 << 7);


does this make the last bit 0?
>>
>>58816017
depends what CHAR_BIT is
>>
>>58816027
random, i just want the last bit to always be 0
>>
Alright, /dpt/, write a program to compute the Patriots' chances of victory this superbowl:

int main(int argc, char *argv[])
{
return 0;
}
>>
>>58816041
module Main where

-- when it terminates, the value will be the percentage chance that the Patriots win the superb owl
result :: Int
result = result

main :: IO ()
main = print result
>>
XAML on the WPF. It's fucking amazing. You will hate your fucking life to learn the basics, you will want to kill yourself to learn the intermediates but then you will find enlightnement.

To be honest, the world needed that language. The programming world was too easy. We were too much into the PHPs and the Perls and the Pythons and the HTMLs.

Bring back the languages that burn your brain to learn them for the first time. C pointers, Assembler code, fucking XAML.
>>
>>58816041
print "american football is the most boring shit imaginable"
>>
>>58816041
void main()
{
import std.stdio;
writeln(">being a normie");
}
>>
>>58816041
int main(int argc, char *argv[])
{
printf("i dont get a fuck%%\n");
return 0;
}


>>58816040
~0 & ~((~0) >> 1)
>>
>>58816060
dont run this! it crashed my PC
>>
Architecture.

Where does it fit?

A CPU can follow some assembly instrutions right? So a CPU can be x86, x64, MIPS, POWER, ARM or whatever.

But what about GPU? Can a GPU be x86 or x64?

And APU? Can an APU have an "architecture" too?

Please, can someone explain this?
>>
>>58816060
why does it do this?
>>
>>58816041
>argc, argv
when this meme will end

>>58816065
>import STDs
>calling others a normie
>>
>>58816134

It's the standard function signature for main.
>>
>>58816065
Normies don't spend $300 on MLP dolls.
>>
I have another C++ question /g/, doing an exercise in the Principles & Practices using C++ book (Chapter 4, vectors). I'll just type the entire question out for the sake of clarity-
"Read a sequence of double values into a vector. Think of each value as the distance between two cities along a given route. Compute & print the total distance (the sum of all distances). Find & print the smallest & greatest distance between the two cities. Find & print the mean distance between two neighboring cities."

So I got my vector set up, along with a for loop to read inputs into the empty vector, but I don't know how to output any of what he's asking. How can I set something up to print the sum of all the inputs if I don't know how many inputs there will be? How can I get it to figure out which part is the smallest/largest and output it? As far as I know, he hasn't really covered this exact topic in the book yet. Also, while we're at it, he says that "The first element of a vector is v[0], the last is v[v.size()-1]." I understand the v[0], but not the size()-1. Why -1?

I realize this is probably a dumb question, and I also realize I could easily look up the answer, but I don't just want an answer, I want to understand exactly what I'm doing, as I'm teaching myself all of this because I enjoy it. Please feel free to explain things to me like I'm a dipshit.
>>
>>58816134
pls no bully FP-kun
>>
>>58816107
>But what about GPU?
GPUs are Pascal or GCN or Poolaris and such. If they were x86 or whatever it would be a CPU instead.

>And APU?
APUs are CPUs with GPUs glued on, with some memory management special sauce.

>>58816134
>when this meme will end
what would you do?
>>
>>58816041
Ok I'll use forth
0 .
>>
>>58816186
>GPUs are Pascal or GCN or Poolaris and such. If they were x86 or whatever it would be a CPU instead.

Wow never heard of it.
Why is CPU arch so important but GPU so unimportant?
When we install a Operating System we must always check the CPU architecture to get the right version.
And then we need Binaries designed for that architecture.
Why don't you care about that on GPU?


>APUs are CPUs with GPUs glued on, with some memory management special sauce.

Literally glued on?
I thought it was a new technology that was as good as CPU on some stuff and as good as GPU on others, but totally new.
It's just a CPU and a GPU put together and given a new name? Lame.
>>
new thread when?
>>
>>58816178
the name of arguments isn't part of the signature in C
>>
>>58816183
>if I don't know how many inputs there will be?
Assuming you correctly read them all into the vector, then v.size() will be the number of inputs.

>I understand the v[0], but not the size()-1. Why -1?
Let's say v has 4 elements.
v[0] is the first
v[1] is the second
v[2] is the third
v[3] is the fourth
therefore v[3] is the last element.
v.size() = 4
v.size()-1 = 3 = index of last element.

As for actually solving the problem,
we need to find distances between each city; this means the difference between two consecutive elements in the vector.
Going back to our 4 element vector,
the first difference is v[1] - v[0]
the next is v[2] - v[1]
the next is v[3] - v[1]
As you can see we calculated three differences. But there are four elements. Therefore we need to loop one time less than the number of elements. How would this be done with a for loop?
For finding the sum, we need a running accumulator where we will add the individual differences. Have you done loops like this before? As practice, write a function that takes a number N and finds the sum of the squares of every integer beneath it. E.g. sum_of_squares(4) = 1*1 + 2*2 + 3*3 = 14
Also, this seems like you're undertaking a lot of information that you don't know how to apply. I suggest HtDP as a better intro text, but feel free to continue with this C++ book
>>
>>58816251
how are you gonna refer to it then fukwit
>>
>>58816281
Correction, should be v[3] - v[2]
>>
Working on a header to pforth extension tool in Haskell so i won't have to write the C bindings manually.

rule set so far (pfcustom.c):
void <fn>(<arg1>, ..., <argN>); -> static void C<fn>(cell_t <arg1>, ..., cell_t <argN>){<fn>(<arg1>, ..., <argN>);}
<type> <fn>(<arg1>, ..., <argN>); -> static cell_t C<fn>(cell_t <arg1>, ..., cell_t <argN>){return <fn>(<arg1>, ..., <argN>);}
rule set for macros, ect... (constants.fth):
const <type> <name> = <value>; -> <value> constant <name>
#define <name> <digit> -> <digit> constant <name>

Yes I'm lazy but I'm not going through all libraries by hand when I can just write a tool for it
>>
>>58816232
You interact with GPUs through drivers, so many details are not important. APUs are special since the CPU and GPU share memory, though the performance benefits of this are often overshadowed by the weakness of the GPUs. APUs are good for highly parallel compute work, not so much rendering.
>>
>>58816282
>signature
>>
>>58816041
>return 0;
>>success
explain this

>>58816235
when you accept OOP into your heart and call Thread.new()

>>58816232
>Why don't you care about that on GPU?
You do care, when you install video drivers
>>
>>58816251
I'm losing the plot on what you're being hyper autist about
>>
>>58816183
>if I don't know how many inputs there will be
if it doesnt specify just assume 3
> How can I get it to figure out which part is the smallest/largest and output it?
sort it
>Why -1?
pointer math is weird.
>>
>>58816251

It's a de-facto convention. It may not be part of the official standard, but it's what you are expected to use.
>>
>tfw u hack ghc into ur phone
lheuhaheuaheohoaheohaehohoaehoaehfksjsf
>>
>>58816251
>signature
there isn't even such a thing in C.
>>
>>58816299
>>58816304

Would it be possible to make CPU take the GPU approach?
Or make GPU take the CPU approach?
I see it could be great...

1. Instead of having Linux for x86, Linux for x64, Linux for ARM, Linux for MIPS, Linux for POWER, etc... You'd have a single general Linux and then download drivers for your CPU arch.

2. Have Linux x64+Pascal, Linux x64+Poolaris, Linux x86+Pascal, Linux x86+Poolaris, etc... No more need for drivers (many are proprietary).


Why is the way we handle CPU and GPU archs so different?
>>
Is there a way to somehow upload an interpreter/compiler to your brain?
>>
>>58816281
Thank you for the response. Your explanation of v.size()-1 makes total sense to me now. As for the book, yeah it's really odd. I was doing great up until this current chapter (chapter 4) where he introduced while, for, and vectors. I've probably re-read the entire chapter 30 times now. Not that I mind, I knew that at some point there'd be really big hurdles. I'm going to try to work through every single exercise and drill at the end of this chapter and see how I feel. I also keep hearing that C++ is just a brutal first language, especially if you're teaching yourself (though I dunno if there's any truth to that).

Anyways, thank you for the answer. It was quite helpful. I'll also look into "HtDP" as you suggested.
>>
>>58816352
GPUs need a CPU to tell them what to do, for one thing.
>>
>>58816304

This is being used to represent an integer value, not a success/failure.
>>
>>58816357
did you recently take any kind of intoxicants
>>
>>58816373
No, but I can. Is that required?
>>
>>58816367
You can have a computer with just a CPU (no GPU).

But you can't have a system with just a GPU (no CPU)?
>>
>>58816383
yes, i think dxm is required in the upload procedure
>>
>>58816390
yes
also see >>58816373
>>
>>58816390
Yep. They're coprocessors.
>>
>>58816393
I'm able to get that. How do I upload the source and how do I bootstrap? I don't have any other compilers right now.
>>
But what about having a general Linux kernel and drivers for your CPU arch?

No more Linux x85, Linux x64, Linux ARM, etc...
>>
>>58816364
>I also keep hearing that C++ is just a brutal first language
It's true, the error messages are absolutely horrifying and it's easy to make small mistakes and C++ won't give the slightest fuck (e.g., doing v[-1] doesn't make any sense yet it's perfectly OK to do in C++).
At least they're teaching vectors, most "C++" tutorials delve into C style arrays and pointer math which you can often outright avoid in C++ code (and belong in a C tutorial).
>>
>>58816412
brain should come with a good enough OCR by default, adjust your lens to clearly see the installation script and make sure the brain's shell is compatible before running the OCR

should autorun from there sorta like QR code
>>
New thread

>>58816435

>>58816435

>>58816435
>>
>>58816431
And can I use any language? How do I edit and compile the code on-site?
Thread posts: 348
Thread images: 47


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