[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: 319
Thread images: 43

File: 180261.jpg (14KB, 254x400px) Image search: [Google]
180261.jpg
14KB, 254x400px
What are you working on, /g/?

Previous thread: >>60002401
>>
What's the best language?
>>
first for c++17
>gcc7 when
>>
>>60007097
Object Pascal
>>
>>60007098
C++ is only just getting options and variants.
Took them a while.
>>
>>60007097
SPARK
>>
>>60007164
They are near to useless without pattern matching tho.
>>
>>60007330
Yeah, but options will still come in useful though.
Before you either had to hack in some kind of invalid state in your object and override
operator bool
, or return a pointer which forces you to either heap allocate or use global state.

Now you can just return an std::optional<T> which is still miles better than the above "solutions" but yeah, without pattern matching it is still lacking.
>>
>>60007077
give me a project, i need to feel useful
>>
>>60007097
C
>>
>>60007612
x86_64 multitasking kernel.
>>
>>60007624
how about a kernel for my own ISA?
is that permissible?
>>
>>60007643
Yes. In fact that's even better.
Do you already have a VM for your ISA?
>>
>>60007612
get a copy of the ii irc turn vim into an irc client
>>
>>60007673
yes, though the mmu isn't finished.
i'd probably work on that first.
>>
I can move or place the text cursor with all four arrow keys or the mouse.

Next issue will probably have to be marking text.
>>
What are you waiting for, /g/?

https://doc.rust-lang.org/book/
https://doc.rust-lang.org/reference.html

*Not for the brainlets*

https://doc.rust-lang.org/nomicon/
>>
Working on some javascript stuff
I hate it
I have no idea how to use it

For example, after creating an object, how do I make a base function (I don't know the proper term)? is it even possible?
Something like this:

var testObj = function(data){
this.values = [];
for(var i in data)
this.values.push(i);
}
testObj.prototype.BASEMETHOD = function(index)
{
return this.values[index];
}
var test = new testObj([1,2,3,4,5,6,7,8,9]);
console.log(testObj(3));
>>> 4
>>
>>60007097
Common Lisp
>>
>>60007097
Nim
>>
>>60007097

EO
>>
>>60007097
None of them.
>>
>>60007612
Make a 4chan terminal client.
Targeted at Linux users.
>>
>>60008339
FreeDOS*
>>
>>60008298
I'm learning it right now, I keep getting aggravated where I write a function to do something simple (like remove duplicates from a list) just to find there is something like (remove-duplicates ).

I guess it's good I'm getting used to the syntax.
>>
File: war of the interrupts 1.png (7KB, 640x400px) Image search: [Google]
war of the interrupts 1.png
7KB, 640x400px
>>60007673
anyone know a good way to fix this?
>>
File: the day the vm stood still.png (5KB, 640x400px) Image search: [Google]
the day the vm stood still.png
5KB, 640x400px
>>60008503
>>
>>60008478
Yeah, I feel your pain. Keep the hyperspec nearby is all I can say. You can get a local copy if you
(ql:quickload 'clhs)
.
>>
>see old books on pascal and cobol in my dads shelf
>pick one of them up for shits
>grab whatever cobol and pascal compiler i can find
>test book example against compiler
>errors everywhere
maybe i should stick with mathematics.
>>
>>60008478
I know that feeling. Even worse (in Haskell at least) is looking at the implementation and it's basically magic.
>>
>>60008503
>>60008513
I'm not exactly sure what these images are expressing.
>>
>>60008526
I'm interested, how does one set up an efficient Common Lisp system.
I know about quickload, and how it serves as a package manager of sorts.
I have heard of ASDF, which I still have no idea what it does exactly.
Since there is multiple implementations, how do I incorporate a quickloaded library with ease into CLISP or SBCL?
>>
>>60008568
I have a VM, the clock is by when the CPU ends its cycle. Since all devices run on this clock, when a device sends an interrupt to the CPU, the functions blocks, and the cycle never finishes.
>>
>>60008544
>old books
are you fucking retarded?
>>
>>60008619
its easier to study by reading physical ones.
>>
>>60008614
When you raise an interrupt, set a flag somewhere.
At the end of each cycle, check the flag and process the interrupt if it's set.

This is how real CPU's do it I'm pretty sure. They check a pin after each cycle.
>>
>>60008634
what happens is that interrupt pin is raised, and it is held by the device until it is serviced, so interrupts aren't "lost" AFAIK
>>
>>60008631
>2017
>not reading the book on your pc next to open terminal
>>
>>60008526
thanks that helps a lot too! Good to know that is available

>>60008547
I haven't taken a look at SBCL but from what I read about it's run-time compilation and it's performance it was one of the reasons I was drawn to try out CL
>>
>>60007077
Is software engineering really that depressing and miserable? I'm poor as fuck and want to get a well paying job. Nature and science are cool in theory but in practice I hated doing labs. I think electricity is cool but I'm way too dumb for electrical engineering. Programming is pretty cool, conceptually, and I can also learn it from my room, which is a huge plus. I've been learning Python and C++, but I keep hearing that computer science majors are miserable and programming is a terrible career. Anyone care to offer insight?
>>
>>60008658
yeah but the book becomes useless if i cant compile shit from its examples, learning programming is not like math. in mathematics you are the interpreter, in programming the computer is the interpreter.
>>
>>60008704
it depends on where you find yourself

some programmers end up in a situation where they are stuck doing tickets or tasks on a system that bugs are being reported for faster than patches can be released.

others find themselves chasing clients for scraps because they tried to bootstrap themselves in a precarious way,

then there are consultants like me, who are ultimately thieves and swindlers, but live very comfortable happy lives :-D
>>
>>60008704
Software engineering is a lot like science research

If you're decent you can find something fulfilling but pays like shit
or you can find something that pays well but is a shit job
If you have years of experience and connections you can find something both fulfilling and wealthy
If you're shit you can get imported from another country
>>
>>60008652
What do you mean it's "held" by the device?

You can't really guarantee that interrupts won't be lost.
When the interrupt flag is raised, the CPU pushes the instruction pointer and some other stuff to the stack and then jumps to an interrupt handler.
When the handler has finished servicing the device interrupt, it then raises some kind of signal (for example, on the x86, it writes to port 0x20 and 0xA0 which are owned by the Programmable Interrupt Controller or PIC) to notify the system that it can send more interrupts.
Then the handler pops the stuff off the stack and returns to wherever it was before the interrupt came in.

Note that the PIC in the x86 doesn't maintain a backlog of interrupts, so if you wait too long before sending the signal, you can miss interrupts.

In most cases you can avoid missed interrupts by just simply having the device wait for a response of some sorts, or the device could contain it's own queue of events like the keyboard contains a ring buffer of keystrokes.
But for devices like the timer, you just have to simply process the interrupts in time in order to not miss them. That means you have to be very careful about disabling interrupts (for atomicity) and make sure you only do it for the shortest amount of time possible.

It's shit I know, but that's how it is.
I'm not sure if I understood your question properly, but I hope that answered it.
>>
>>60008585
Nowadays there is Roswell (check github) which can install a CL setup for you automatically. You can use quickproject to set up your own projects that you can load with quicklisp. Quicklisp makes use of ASDF (another system definition facility). As far as deploying your projects, there are a few options. You can distribute a FASL file which is what gets produced when you compile a lisp file. You load a FASL with (load "filename.fasl"). Of course, that means a lisp implementation has to be installed on a user's system, which might not be what you want. Buildapp takes care of this problem, but will likely produce large binaries since the entire lisp image gets saved. ECL solves this problem by compiling to C.
>>
File: 2017-04-21-193426_949x356_scrot.png (15KB, 949x356px) Image search: [Google]
2017-04-21-193426_949x356_scrot.png
15KB, 949x356px
>>60007077
ssh 2ton.com.au

https://2ton.com.au/HeavyThing/
>>
>>60008841
connect as new user
press ctrl-j
join channel g
>>
>>60008829
what i meant is that the interrupt line is held by the device usually until it is serviced, not that you can't lose an interrupt if it stops holding it while you have interrupts disabled

like that's at least partially correct right?
>>
>thinking its about time I should learn a bit about programming
>finally decide to take an intro course
>excited to begin
>this should be fun
>first few weeks are kind of easy and fun, simple data types and operators
>hit week 5
>find the fifth prime number between the 20th and 67th value in this list of lists and express it as a square root of its index value times the 4th root of the third value of the seventh list

Is there HONESTLY, any PRACTICAL application for the convoluted fucking prime number exercise problems? Do people honestly fuck with prime numbers out in the real world when they are programming that much? I was doing so well until they decided to turn this shit into a brain teaser. Thinking about dropping the course and just saying fuck it
>>
What's a null byte injection?
>>
this is just a suggestion which should probably be on /qa/, but I think there should become a programming board specifcally for these threads. Also Lainchan has that and it is wonderful.(even though I don't go there I just browse their irc channel)
>>
Rust and Idris are good stepping stones. By themselves they are interesting enough to be played with but a synergy will be amazing.
>>
>>60008851
>like that's at least partially correct right?
Yeah, but why does your function block? and which function?
>>
>>60008585
i've been just using an .sbclrc file and I put some hotkeys in vim to run whatever lisp code is in my buffer through to it. simple enough to try out code and get a response but still be able to go up lines and edit stuff, etc
>>
>>60008883
I would post a link to a helpful page but with two neurons to rub together you should be able to find it yourself.
>>
>>60008918
the function that interrupts the cpu
>>
>>60008585
>>60008833 cont.
When programming, my setup is as follows: emacs + SLIME, paredit, quicklisp, and a local copy of the hyperspec. Nothing too fancy. My .emacs is a hodgepodge of different snippets found on emacswiki or github:
;for paredit and other interesting things
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)

(setq inferior-lisp-program "sbcl") ;change to whatever implementation you use
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup '(slime-fancy))

;you may not need this
(setq slime-contribs '(slime-fancy))

(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode)

;miscellaneous stuff
(setq
backup-by-copying t ; don't clobber symlinks
backup-directory-alist
'(("." . "~/.saves")) ; don't litter my fs tree
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ; use versioned backups

(setq-default indent-tabs-mode nil)
>>
>>60008952
All it should do is set the flag and return.
The device will be serviced later from the interrupt handler.
>>
i feel autistic because i got btfo by 3 questions on K&R's bit manipulation section and now i seriously want to learn assembly before going any further
>>
>>60009065
It's much easier to visualize bit manipulation in C than in assembly.
>>
Professor gave us an extra credit assignment to create our own semaphore that can work for all system processes. Is there some way to do this?
>>
>>60009104
>Is there some way to do this?
Yes.
>>
>>60009093
i want to gain a better understanding of low level through learning assembly. i don't actually want to program in assembly. my university doesn't offer any asm classes, i've literally never done anything low level in my life
>>
>>60009126
I guess I better do some research
>>
>>60008872
What course anon?

They're all trash, they don't actually teach you much outside of syntax

Just read SICP and teach yourself. You should be able to figure it out.
>>
File: 1427805883128.jpg (63KB, 720x960px) Image search: [Google]
1427805883128.jpg
63KB, 720x960px
Any C# programmers here? Can you list a few of your first practice programming projects written in the language? I'm learning it on my own from a book but want some ideas for projects to apply my knowledge to. Can be with or without WinForms.
>>
>>60007097
Swift
>>
>>60009185
texteditor
game
chat
crud webapp

go
>>
>>60009185
Just do standard programming challenges. Once you have commandline programs down, go back and try adding in a GUI through winforms. Once you've done that, try and tackle WPF.

God fucking speed when you get to WPF.
>>
>>60007097
Rust
>>
>>60008332
this
>>
Ideaguys, feed me some ideas for "A Small World"
>>
>>60009219
I just got into WPF a few days ago after making lame stuff in WinForms for a while and god damn I love it. It was pretty tough to get into at first but it's really flexible. I can actually make fairly complex good looking UI now.
>>
>>60009282
The difficulty curve shoots into the stratosphere once you start dealing with data bindings and Model-View-ViewModel design practices.

Or maybe it just "clicks" for you, which if it does then you can make a shitload of money specializing in WPF UI
>>
>>60009195
>>60009219
Thank you very much
>>
>>60009273
what is it?
>>
>>60008924
post lines which allow for running current lisp code
>>
>>60007097
Nasm.
>>
File: Anime_girl_thinking_3.jpg (22KB, 240x320px) Image search: [Google]
Anime_girl_thinking_3.jpg
22KB, 240x320px
>zero-cost abstractions
>move semantics
>trait-based generics
Some kind soul please, explain me, in plain english, what this mean.
>>
>>60009378
>>zero-cost abstractions
Abstractions with zero cost

>>move semantics
Semantics for moving

>>trait-based generics
Generics based on traits
>>
>>60009299
Yeah I bet. I haven't really gotten that deep into it yet but I'm hooking up an SQLite database to a listbox of items to display certain properties, which was really simple. That MVVM concept though, I haven't bothered to look into that yet. WPF devs make a shitload of money huh? That's surprising. I might look into that some more.
>>
>>60009378
>zero-cost abstractions
Abstractions that don't add any time/space overhead.

>move semantics
You can shallow copy a value to a new location but you're not allowed to use the old value any more. You can deep copy a value to keep using the old one. This is important for reasoning about ownership.

>trait-based generics
You can constrain your generic types to implement traits (kind of like interfaces) for static dispatch.
>>
>>60009378
>>zero-cost abstractions
https://blog.rust-lang.org/2015/05/11/traits.html
>>move semantics
http://rustbyexample.com/scope/move.html
>>trait-based generics
https://doc.rust-lang.org/book/traits.html
>>
>>60009406
WPF devs make a little more than a "standard" dev at a company, but it's more like you're guaranteed a job and will be pampered like royalty.
>>
Any good simple app project ideas that might be marginally unique?

I just got my smart phone repaired after a year of it being broken and I want to get into Android dev.
>>
>>60009421
Ah okay. That sounds nice haha
>>
>>60009428
Solve P vs NP. No one has done it so far!
>>
>>60009475
Simple
>>
PCI defines a "programming interface" type for most device classes to support generic drivers.
Where can I find what these interface types mean?
>>
>>60009428
Flappy Bird
>>
Idea: 2D game engine in S7 Scheme, similar to Lua's Love 2D.
>>
File: acleverjew.jpg (226KB, 840x1153px) Image search: [Google]
acleverjew.jpg
226KB, 840x1153px
>>60009475
Isn't it solved?
>>
>>60008298
Esoteric languages don't qualify, son.
>>
>>60009730
You are esoteric.
>>
>>60009475
N = 1
>>
File: ss+(2017-04-21+at+10.04.59).png (18KB, 600x291px) Image search: [Google]
ss+(2017-04-21+at+10.04.59).png
18KB, 600x291px
CS student faggot here learning Java

Project due in two hours and I'm afraid /g/ is the only place I can go for this. This loop is in main and is supposed to throw up the options for the user after it takes their input, processes it, and does its thing. The problem is that when i tries to loop, it has a NoSuchElementException for the line where the scanner is turned into a string. I've had a couple people look at this and they had no idea either. Can someone please help me fix this? I'm sure it's some really stupid thing I've got to be missing here.
>>
>>60009144
>read SICP
>First chapter is nothing but abstract math exercises and examples
>>
>>60009856
use nextInt
>>
>>60009856
my fuckig eyes are on fire
>>
File: unknown.png (173KB, 308x326px) Image search: [Google]
unknown.png
173KB, 308x326px
>>60009913
still gives the same error
>>60009921
from the spaghetti code or the rainbow vomit syntax coloring
>>
>>60009856
That's not how you take input in pajeet-lang.
import java.util.Scanner;

public class shit {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

while (input.hasNextLine()) {
System.out.println("Enter some shit");
System.out.println("1 - blah blah");
System.out.println("2 - etc.");
String line = input.nextLine();

// Do your shit with your input here:
System.out.println(Integer.parseInt(line));
}
}
}
>>
>>60009936
int userInput = input.nextInt();

drop the parseint scheisse
>>
>>60009940
Moving the scanner out of the loop doesn't fix shit. Except now I get an IllegalStateException and I dont even know what that means.
>>60009961
Interpreter method is a switch block.
>>
>>60009961
wait i didnt even read the code right, sorry i'm panicking hard
>>
>>60009971
>IllegalStateException
Stop trying to close your scanner. It's closing System.in when you do that.
>>
File: Untitled.png (434KB, 808x822px) Image search: [Google]
Untitled.png
434KB, 808x822px
>>60009971
>IllegalStateException and I dont even know what that means.
why don't you google it you fucking retard
>>
>>60009971
then
uni.Interpreter(userInput);

but with my change above
>>
>>60009987
Holy shit thank you that fixed it.
>>60009991
you guys are better than google
>>
>>60009129
How low level are you looking to get?
>>
>>60009416
>>60009417
Thanks anons, you are a beautiful person.
>>
If I have a loop iterating over a large collection, and inside that collection I have to iterate over ANOTHER collection.
If a condition is met from that second collection, I need to move to the next element in the first collection.

So in pseudocode
foreach outerVar in collectionA
foreach innerVar in collectionB
if (condition)
//Go to next element in collectionA loop and start over
>>
>>60008658
>2017
>Not having both
>digital copy for easy portability
>physical copy because nothing beats a hard copy of a book
>>
File: br.png (309KB, 1366x768px) Image search: [Google]
br.png
309KB, 1366x768px
.>>60007077

Making a Braitenberg vehicle simulator using OpenGL, no reason why. Predator-prey dynamic added for fun.
>>
>>60010134
can you use mouse control in openGL?

i mean, move the scene with your mouse?
>>
>>60010129
>because nothing beats a hard copy of a book
Except for a digital copy, of course.
>>
>>60008872
Encryption relies on prime numbers anon. Outside of security related things, you probably won't have to worry about primes specifically, but general math and logic skills are used often
>>
>>60010154
i agree, nothing beats eye strain and awkardly trying to position a laptop while you're in bed
>>
>>60010151
That's a retarded question. Input has absolutely nothing to do with OpenGL; it's a rendering API.
You can make mouse movements rotate the scene or whatever, using whatever is giving you input, but that's irrelevant, really.
>>
>>60010151

I currently use the keyboard to adjust the vectors that make up my view matrix, so I think adjusting using the mouse and considering a more orbital view system would be doable! All the cool dudes on ShaderToy can handle it.
>>
>>60010196
that's why i see openGL programs with X11 support

interesting
>>
>>60010088
If this is a question the answer is use a regular for loop and when (condition) is met increment the i that iterates collectionA then reset the j that iterates collectionB
>>
>>60010225
>use a regular for loop
Actually you may not have to but I just don't know the iterators for foreach
>>
File: ree.jpg (40KB, 900x900px) Image search: [Google]
ree.jpg
40KB, 900x900px
how the frick is this an accepted editorial solution for this
https://leetcode.com/problems/two-sum/#/description
public int[] twoSum(int[] nums, int target) {
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
map.put(nums[i], i);
}
for (int i = 0; i < nums.length; i++) {
int complement = target - nums[i];
if (map.containsKey(complement) && map.get(complement) != i) {
return new int[] { i, map.get(complement) };
}
}
throw new IllegalArgumentException("No two sum solution");
}


he says the compliment can't be equal to i, but there's test cases where there's multiple elements with the same value that add up to the target value. wouldn't this would fail that situation?
>>
Resources for learning webshit for someone already very familiar with C/Java/Python? Wanna learn HTML/CSS/Javascript. All the online resources hold your hand too much and I get bored taking 20 minutes "learning" how to do a while loop (I already know how just give me the damn syntax and move on)
>>
>>60010561
Stupid frogposter.
>>
File: 1469523949299.png (924KB, 7528x2744px) Image search: [Google]
1469523949299.png
924KB, 7528x2744px
>>
>>60010624
Roll
>>
Is there a term to describe how composite indexes in a database can only be used in a left-to-right order?

e.g. index [a,b,c] can be used for queries on [a] and [a,b] but not for [c] by itself.

It's bugging the shit out of me.
>>
>>60010666

I'm sure there's something in set theory that describes that.
>>
>>60010561
still don't know how his works but i did it in python, it works because you iterate twice. at the end of the first iteration, the index in the map will be updated to the last occurrence. during the second iteration, then, you first encounter the first occurrence, give it that index, and then give it the index from the map which has been set to the latest occurrence. so it works.
>>
>>60010567
Derek Banas gives good brief overviews, more like infodumps on YouTube. He does exactly what you ask. Though you might have to figure out your own projects to actually learn the material. But a book is the best solution. I think the You Don't Know JS series is popular. Anyways, >>>/wdg/
>>
>>60010694
>set theory
Sets have no order, so "left-to-right" doesn't really make sense..
>>
>>60010730
permutations
>>
>>60010624
>>60010661
Take your rolling shit to its own thread.
In only shits /dpt/ up and wastes posts.
>>
>>60010738
>and wastes posts
Every post on 4chan is a wasted post
>>
>>60010737
That's not an "order" though. You're just describe one element matching to another, which you can label arbitrarily.
>>
File: 1490856036748.png (66KB, 1000x1000px) Image search: [Google]
1490856036748.png
66KB, 1000x1000px
>>60010624
>Linked "list"
what did he mean by this?
>>
Somebody help me here (preferably quickly). When it says "Enter a number from 0 to 9", I want it to enter 3, but it enters 77. What do?

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main(){
int array[10] = {77, 33, 88, 99, 22, 55, 11, 44, 66, 0};
int num = 0;
cout << "Reading in: ";
for(int i=0; i<10; i++){
cout << array[i] << " ";
}

cout << "\nEnter a number from 0 to 9: ";
cin >> num;
cout << num << endl;

if(num > 9 || num < 0){
cout << "Number is out of range.\n";
}
else{
cout << "Element number " << num << " is " << array[num] << endl;
}
return 0;
}
>>
>>60010789
Abstract data type list, rather than just linked addresses?
>>
File: pizza-botnet.png (1MB, 1280x720px) Image search: [Google]
pizza-botnet.png
1MB, 1280x720px
can't delete your leetcode account, and i didn't know your incorrect submissions are permanently displayed as a percentage on your account, so now that i did like 13 incorrect submissions on the first question trying to figure it out i have to just hit submit with my perfected solution over and over again to get my rating up in case an employer finds the profile
>>
Give me some intro to opengl ideas
>>
>>60010823
Someone told you the solution last time faggot.
>>
>>60010844
Demoscene demo
>>
>>60010844

Semi-transparent bouncing sphere on a flat wireframe plane with a starfield backdrop, and after render to buffer use an ASCII character preprocessing filter accurate to glyph size in a regular terminal to make it textmode.
>>
ive been working on an auto shitposting bot in python, but i want to take it to the next level

right now it just brute forces captcha by guessing the same one over and over and it gets a decent success rate of like 5% per attempt, so what i want to do now is make it get hooked up to some sort of proxy checker that will check if the proxy is banned on 4chan, if not get another random proxy to test until it can post
>>
>>60010884
4chan pass
>>
>>60010884

Pfft, lame. Why not set out to fuck up captcha instead? That's way more exciting.
>>
>>60010694
I'll keep looking but for now I've settled on "left-to-rightedness" and my professor can deal with it.
>>
>>60010054
you're beautiful
>>
>>60010893
bans for the ip get applied to the pass as well
>>
>>60009856
>that for loop
just use a while loop holy shit
>>
>>60010666

Transitive relation?
>>
>>60010624
test
>>
File: weww.jpg (124KB, 1280x720px) Image search: [Google]
weww.jpg
124KB, 1280x720px
Friendly reminder that this is what C written by EEfags looks like.
http://ideone.com/c697Lt
It's a connect-four clone, where every single win condition is hard coded.
>>
>>60011730
This is a joke, right? How does someone miss the whole point of programming?
>>
>>60011730
what is a EEfag?
>>
File: 1437366569708.png (418KB, 570x482px) Image search: [Google]
1437366569708.png
418KB, 570x482px
>>60011776
>>
File: 1484506548831.jpg (46KB, 250x236px) Image search: [Google]
1484506548831.jpg
46KB, 250x236px
>>60011730
i really hope this is meant to be ironic
>>
>>60011730
how else would you do it?
>>
>>60007097
Fortran
>>
File: 1492457583970.png (435KB, 720x720px) Image search: [Google]
1492457583970.png
435KB, 720x720px
>>60011868
Anon, what is the number one reason to make a script or program something?
>>
>>60011894
>Anon, what is the number one reason to make a script or program something?
Because someone offered you money
>>
>>60011894
i'm just curious how you'd do it. if you're shitting on him it implies you know a better way
>>
>>60008841
>CBC
trashed
>>
>>60011730

EEfags? Looks more like it's written by someone who has not coded C for very long.
>>
>>60011912
Nice try, bud, but you haven't answered my question.
>>
>>60011974
Nice try, bud, but you haven't answered my question.
>>
>>60011730
>all those comments
Do people actually comment every little thing the code does?
>>
>>60011868
The same way you'd determine a win condition by sight.
Just iterate over every row, column and diagonal until you find 4 uninterrupted pieces in the same color.
There's your win.
Are you fucking retarded?
>>
>>60010624
el role xDddD
>>
>>60012010
thats what he does
>>
>>60011998
I would tell you my solution if you answered honestly, but it seems you just want to shitpost.
>>
>>60012024
>I would tell you my solution if you answered honestly, but it seems you just want to shitpost.
you were the first one to answer a question with a question
>>
>>60012032
Because I want you to think this through. I only like giving solutions if you've spent a sufficient enough time thinking about it.
>>
Where do I get started with Android App development? I want to make a personal app for myself. I need to know java correct?
>>
>>60011730
This is what VHDL does to your brain
>>
@Something(a = 1, b = 2)
int a;

^ is Java. Does C++ have something like this. I would like to store attributes on my variables.
>>
>>60012084
C++ has the ability to force you to do what you did in 10x as many lines of code! Isn't it great?
>>
>get brainfucked by teacher about Prolog
>still no clue what's Prolog for
You don't say it's created to solve logical riddles.
>>
>>60012099
It's probably going to be about the same considering I would need to work with reflection to access them when working with Java.
I'm mainly just looking for something that's about as equally readable.
>>
>>60012116
>equally readable.
I literally don't have any idea what that code snippet does
so no, c++ has nothing like that
>>
>>60012084

what is wrong with a structure?
>>
>>60012044
>Because I want you to think this through. I only like giving solutions if you've spent a sufficient enough time thinking about it.
implying the guy who wrote that even browses here. the anon found that on /sci/, i'm saying YOU don't even know how to do it any better
>>
>>60012133
It's pretty much like metadata for the variable
>>60012155
Yeah, I guess that could work. Maybe I can use a template or something so I don't need one for every data type.
>>
>>60012244
>the anon found that on /sci/
proofs?
>>
>>60012288
go look in the archive. its stale
>>
>>60012273

> Yeah, I guess that could work. Maybe I can use a template or something so I don't need one for every data type.

How many datatypes do you have? I've written some pretty big programs and when things get a little hairy a structure that has a structure (that might have a structure) usually simplifies the number of datatypes needed greatly.
>>
>>60012314
They are all primitives. Mostly uint8_t, uint32_t, and floats. I essentially just want to attach an address to it.
>>
File: 1490832719629.gif (227KB, 600x600px) Image search: [Google]
1490832719629.gif
227KB, 600x600px
>>60012244
I thought you were the anon asking for a solution, but I just re-read and saw I misunderstood. Sorry about that.
My solution would be to create a "piece" structure that's composed of three integer fields where each one corresponds to a direction (horizontal, vertical, and diagonal). Each time a player places a new "piece", the program will check for adjacent pieces and calculate the new piece's fields based off any adjacent piece (new_piece.direction_field = prev_piece.matching_direction + 1 where if prev_piece doesn't exist then new_piece.direction is just incremented by 1). This will continue until a player has a piece with a field that's equal to 4.
>>
>>60011876
this but no anime
>>
File: 1476854844528_1.png (726KB, 952x1064px) Image search: [Google]
1476854844528_1.png
726KB, 952x1064px
>>60012422
>>
File: 1458546951680.jpg (47KB, 474x479px) Image search: [Google]
1458546951680.jpg
47KB, 474x479px
>>60012422
Anime makes everything better, though.
>>
File: lucoa_sweater.jpg (199KB, 850x1202px) Image search: [Google]
lucoa_sweater.jpg
199KB, 850x1202px
Did somebody say anime?
>>
File: tomboy_a_best.jpg (133KB, 470x545px) Image search: [Google]
tomboy_a_best.jpg
133KB, 470x545px
>>60012631
I do believe someone did.
>>
I'm writing, what I think is, a solid library that implements a big collection of data structures in C.

Do you guys think that programming a library for C/C++ is bad style? Should I make it header only? I'm using Cmake and only C99, with no platform-specific dependencies, so I assume there is support for a big variety of platforms and compilers in case someone wants to compile my library.

Is this bad?? I was reading about the "header-only libraries should be used and nothing else" meme on /r/programming, and how everyone supported it and was a bit taken away by that. Please tell me your opinions and experiences on this.

From my point of view it's a different thing to have a pre-compiled library and a different thing to plainly have some headers scattered around, that can slow compile-time significantly (especially in big projects, or big libraries like mine). Plus, if a new version of the library comes out (with bugfixes for example), then the programmer won't have to recompile his entire project with the new headers or anything; they will simply have to recompile the binary of the library (given that it's a shared binary).
>>
>>60012698
If it's just data structures, make it header only.
If you implement them (like adding, sorting, deleting, inserting, etc) then don't make it header only.
>>
>>60012698
>Do you guys think that programming a library for C/C++ is bad style?
Of course not. C uses libraries just as much as any other language.
Some of the most useful pieces of software to modern computing are C libraries.
>Should I make it header only?
That really only works for certain types of libraries. If it's just data structures, you could probably get away with it.
Trying to force a "normal" library into that mould just makes it annoying to use, annoying to upgrade (i.e. no dynamic linking), and can even lead to licensing weirdness.
>>
>>60012724

This.
>>
File: img_058.png (90KB, 254x272px) Image search: [Google]
img_058.png
90KB, 254x272px
>mfw I just optimized my code with proper memory management
>>
>>60012724
If you mean the types, the way I'm going with it is that I'm using void* data and key types for the data structures, with structs that look like this

struct Node {
void *data;
struct Node *nxt;
};


and I'm also storing pointer to a comparison function etc.

I guess one advantage of making it header-only, would be that I could use a macro instead of a standard pointer data type, so that it would be a lot like templates in C++. That could give some "speed" boost probably since each node struct would be perfectly aligned with the user key and data.

But my current implementation is void* everywhere
>>
>>60012796
if you are littering your shit with voids you have made a serious mistake somewhere.
>>
>>60012818
I don't think I've made mistakes so far. I'm debugging very heavily and compiling with all warnings possible. What types of mistakes are you talking about?
>>
>>60012796
>Storing a void *
>Needing 2 allocations per node
struct Node {
struct Node *next;
unsigned char data[];
};
>>
>>60012837
I mean your general design is wrong because you are using voids. Implementing generics with void is wrong, don't do that.

Just because it's possible doesn't mean you should.
>>
File: 1479614433808.jpg (77KB, 500x500px) Image search: [Google]
1479614433808.jpg
77KB, 500x500px
I'm currently learning to program with Java with Sedgewick's intro book and it's going pretty well. Although I do not have a CS background I have done some programming with matlab and python for projects and know the rudimentary basics from playing with bash scripting and such. Also, I have a good mathematical background for matrix manipulation and numerical analysis (mech e - focus: CAE).

I am wondering what is the best way to go learn the material. Should I keep doing what I am doing, read the chapters 1-3x times -> Write the example programs -> Do exercises from previous chapters, aiming to do all eventually & read chapter snippets that are relevant?
Or just read quickly through the material -> go straight for exercises and read chapters according to the questions asked? Is practice > reading superior when learning programming?

Should I focus on this single book or read other fundamental books to improve my understanding at the same time? I seem people mention SICP and others. I want to make sure to get proper understanding in the beginning so I won't be writing shitty code and learning shit again.

I never managed to grok programming and now I want to do it. Any tips appreciated.

Also, java is a good (serious) beginner language, right?
>>
>>60012855
you should read a book called linkers and loaders, then implement a compiler.

after that it shouldn't be too hard to learn anything.
>>
>>60012855
>Also, java is a good (serious) beginner language, right?
No. In fact, I consider it to be one of the worst.
>>
>>60012855
Once you get the syntax down, work your way through examples. Once you feel ok witht he language, try making something you feel is just out of reach of your current skills. Research how to accomplish it and then try to implement it.
>>
>>60012868
Thanks for the recommendation!

>>60012869
Well, I'm not a complete beginner like I said but I see your point. Python had a better learning curve.

>>60012875
Yeah, the syntax is slowly coming, although I have some problems following the example programs sometimes. Application > stuying it seems then.
>>
>>60007097
AS3
if (str.search(/%[ions]/) != -1 && args.length > 0)
>>
>>60013058
The more I look at it, AS3 doesn't seem that bad (At least syntax wise and such.). I just still don't know why your school would pick it for that class.
>>
>>60013124
Its not that bad, really
Its just that the entire fucking platform is riddled with security holes, and peculiarities, that just makes shit broken for no discernible reason

>I just still don't know why your school would pick it for that class.
Outdated teachers and outdated material
>>
File: t.jpg (8KB, 380x97px) Image search: [Google]
t.jpg
8KB, 380x97px
>>60013124
For example, I've had bugs that fixed themselves just by compiling 10 times in a row
>>
>>60013161
what the fug
>>
>>60013273
Yeah...
>>
>>60007620
This. And for scripting, I would go for Lua. It's just a layer of 10k lines of C.
>>
Which library / framework let's you write GUI applications that target pc and mobile and has the smallest applications size?
What about general performance like how many items you can have in scrollable list before it gets really slow?
>>
>>60008909
>Also Lainchan has that
It got nuked recently.
>>
>>60010192
>Laptop while in bed
What the fuck are you doing?

>eye strain
Where?
>>
Finished, plugged and debugged stop-and-copy GC.

Now I'm going to look at concurrent methods.
>>
/dpt/ is this true?
SOME_TYPE* a;

*(a + i * sizeof(SOME_TYPE)) == a[i]
>>
>>60014054
no
>>
>>60014074
then what is a[i]
>>
>>60014105
just *(a + i)
>>
>>60014105
*(a + i)
>>
>>60014054
or *((char *) a + i * sizeof(SOME_TYPE))
>>
>"A Discipline for Software Engineering"
is that even valid english?
t. yuro
>>
>>60014110
>>60014113
ah, i see
thanks
>>
>>60014124
You wouldn't sizeof a char.
>>
What system programming language should I learn?

C, C++ or Rust?
>>
File: 1467579901918.jpg (45KB, 500x325px) Image search: [Google]
1467579901918.jpg
45KB, 500x325px
I have to start doing something profitable I DO NOT want to end up as another mindless drone slaving in front of a computer from 9 to 5 and kissing bosses ass for the rest of my life

anyone here a succesful programmer that just spends their days shitposting away on /g/?

alternatively I'd like to work at a relaxed company. What type of software do companies like this usually create?
>>
>>60014136
C and be aware of C++.
>>
>>60014136
If you want to be edgy rust, if you want something with real world applications and jobs C and C++
>>
>>60014132
What? I'm casting it to a pointer of char so that
i * sizeof(SOME_TYPE)
would add the same offset.

It's completely unnecessary, but it just illustrates how pointer arithmetic works in C.
>>
>>60014139
My dear anon thats dream of every lazy person ever. I guess you could pull it off if you dont mind frugal life style. Since you don't actually need lots of money for 1 room apartment and basic necessities.
>>
>>60014148
I would want to learn Rust but I don't know if it's worth it.
>>
>>60014136
C.

C++ is very narrow domain and is slowly dying.

Rust may or may not catch on; your effort might well be wasted.

C is everywhere and on everything. At some point in the far future it might be replaced with something better, but that's still conjecture right now.
>>
>>60014147
>>60014148
> C++

Why do you suggest C++ when it's there's no standard ABI for C++? I know there isn't a standard ABI for C to, but you can specify the function call convention, but AFAIK you can't specify how classes are compiled in C++.
>>
File: good books.jpg (100KB, 606x323px) Image search: [Google]
good books.jpg
100KB, 606x323px
Why do most IT books suck balls?
>>
>>60014169
>THERE ARE JOBS AND LANGUAGES ARE USED EVERYWHERE HENCE REAL WORLD APPLICATIONS!

clear enough for you? Whether it has standard ABI has nothing to do with that
>>
>>60014170
>>>/g/wdg
>>
>>60014156
/dpt/ used to tear itself to pieces over 'sizeof char'. Many IT Crowd jokes were made. Before your time, I guess.
>>
>>60014170
Well professors at unis have to write papers and books to keep their position and phd. So it emerges that they just invent new useless shit and write more and more shit...
>>
Is it too late to learn Android app development?
>>
>>60014160
I'm reading some intership requirements and it makes me so depressed. It feels like they are recruiting for some kind of cult
>>
>>60014177
PHP has lots of jobs and is used everywhere, but I would never recommend it.
>>
// ...

int* a = new int[10];
int b[] = { 1, 1, 1, 1 };

delete[] a;
delete[] b;
// ...


Should I delete b after it's used?
>>
>>60014207
C++ was a mistake.
>>
>>60014189
Applicant specifications are mainly written by HR drones.

Add to that the fact that most internship positions are just a free-labour grab.

These two things mean 1) you shouldn't take those requirements very seriously and as a result: 2) you shouldn't let it get to you, maaaan. Sign up if you want it, don't if you don't, fuck the po-lice.
>>
>>60014169
I said be aware, not choose C++.
>>
>>60014191
and he throws "php" bomb... I see that you are trying to illustrate a point but comparing C or even C++ to php is bit much dont you think...

Anyway use case for recommending php is backend dev with lots of jobs...

And about rust, systems programming and rust are comparatively hard, you end up spending ages to learn them and you end up with what? Knowledge that might or might not be useful but it sure is well designed(according to you)
>>
>>60014207
AFAIK b[] is just an array of 4 integers allocated on the STACK, so no, you don't need to free it, you will get e segfault if you do.

Start with C first.
>>
File: 1455302970223.jpg (75KB, 500x667px) Image search: [Google]
1455302970223.jpg
75KB, 500x667px
>>60014211
thanks for the uplifting advice brother
>>
Any C++ wizards here?
I have a bunch of void functions that accept no arguments or have default args that I do not care about to return a function pointer with specific signature to push it to Lua VM.
The signature being:
typedef int (*lua_CFunction) (lua_State *L);

I first tried:
template <typename Func>
auto GenericCallback(Func func) -> lua_CFunction
{
return [=](lua_State *state) -> int {
func();
return 0;
};
}


But apparently the conversion cannot be performed due to the capture in the lambda.

So then I tried:
template <class Func>
struct GenericCall
{
void operator()(Func func)
{
func();
}
};

template <class Func>
struct GenericFunction
{
static int Callback(lua_State *state)
{
GenericCall<Func> instance{};
instance();

return 0;
}
};


But I then get an error that the template expected a value but got whatever I passed to the template.

The way I want to use that is:
lua_pushcfunction(state, GenericCallback<ImGui::BeginTooltip>());


And so on.
>>
>>60014218
Comparing a language to PHP is /dpt/'s version of Godwin's law.
>>
>>60014250
Use std::function
>>
>>60014264
I tried to substitute the lambda for std::function in the first variant but the signature did not match.

As in int (*)(lua_State *) wouldn't match with std::function<int(lua_State *)>, and using int * for the std::function template would result in an incomplete function signature.
>>
>>60014250
Examples like this reinforce my belief that I'm too much of a brainlet/pajeet to learn C++, so I won't even try. For know C and Lua are my only friends, maybe I will find some more along the way, because it feels very lonely.
>>
>>60014284
I should also learn Make, Bash and (La)TeX, they seem niche enough to be manageable.
>>
>>60014284
>I'm too much of a brainlet/pajeet to learn C++
That's the wrong attitude to have. You are not too stupid for C++; C++ is too stupid for you.
Only absolute retards and literal lunatics can deal with that clusterfuck of a language. If you try to find logic in C++, you just won't find any.
>>
>>60014298
And regex has the same problem LISPs have - they were so simple that a shitton of dialects have developed before significant standardization efforts.
>>
>>60014324
Regex syntax is decently standard. If you know one form of it, you can use other forms without too much trouble.
That's ignoring perl and all its non-regular retardation, though.
>>
>>60014343
Thanks, I'll keep that in mind.
>>
File: sana-22[1].jpg (242KB, 1024x1536px) Image search: [Google]
sana-22[1].jpg
242KB, 1024x1536px
Firstly, not a programmer but a system admin trying to learn programming

I used to use winforms with visual studio to create apps a long time ago. What should I be using now to create applications for various shit at work?
>>
>>60014431
COBOL
>>
>>60014461
lol
>>
>>60014431

If you wan't to do various small apps just use C# WPF. With Mono (and now .NET Core) they'll even work on Linux/Mac.
>>
What reporting plugin/extension/software i should use if i have WPF program connected to database using EF?

I need something simple, just to present data from tables and to have page numeration
>>
>>60014502
>WPF

Fuck you. WPF is fucking shit.
>>
>>60014543
Visual studio was made in WPF
>>
>>60014543
?
It's xml based so you can a a ton of shit which is not possible with winforms or alike. You however will have to code not drag n drop it as no designer I know makes clean minimal code.
>>
>>60014431
You can still stick to C# and use winforms.
Alternatively you could do shit with python if you're making stupid simple CLI shit.
You could also look into C++ and Qt if you want to do crossplatform shit.
>>
Where do I find a book of C caveats?
int a = 2, b = 3, c = a + b; // c is undefined
char d[] = "epic";
char *e = "epic";
d[1] = 'b'; // okay
e[1] = 'b'; // segfault
someFunction(++a, ++a); // undefined
int f = -7 % 2; // you can only rely on (x / y) * y + ( x % y) == x
someStaticLibFn(); // compiler must know the calling convention
// compiler must know the calling convention
// and the loaded code has to be either position independent
// to be used by multiple programs or be loaded
// for each program separately, much like static libs
someDynLibFn();


I'm using this "simple" language but I still can't feel totally comfortable with it.
>>
>>60014587
stupid simple CLI shit sounds about right.
any good ui libraries for python?
>>
>>60014600
qt
>>
>>60014600
Python has a lot of options in that regard. Read https://wiki.python.org/moin/GuiProgramming and take your pick. Just ignore tkinter because it's fucking shit.

Qt is an option as well, which allows you to use Qt designer to build the gui. Take into account the extra learning curve though, as you have to deal with both learning Python as well as Qt, as well as dealing with how to package that shit into an executable.
>>
>>60007330
you can achieve some of the functionality of pattern matching by visiting a variant with a lambda overload set (generic lambdas/auto can catch general cases) or constexpr if and type traits and such, both of which will be improved further in the future with concepts
>>
>>60014595
>>60014595
also casting a data pointer to function pointer is undefined (can't execute it), and you can't cast (const char ***) to (const char *), I think you have to cast it to (const char **) first.

Also knowing the difference between const char *, char const *, cons char const * (this is pretty trivial but it's important to know the existance of these different types).

I mean stuff like this, that only experienced, senior C programmers can teach C newbies like me.
>>
>>60014654
C++'s lack of decent higher order functions to go with optional and variant is a fucking abomination
How the fuck did they allow that?
And even worse, in their place they've got this absolutely stupid fucking "visit" function.

OOP ruins fucking everything. These people need to be shot.
>>
>>60014666
What? You can have decent higher order functions with OOP. C++ is an abomination though.
>>
File: 1460743484994.jpg (180KB, 945x945px) Image search: [Google]
1460743484994.jpg
180KB, 945x945px
>>60014555
>>60014576
>/g/ suddenly likes WPF
where the fuck am I
>>
>>60014684
>You can have decent higher order functions with OOP
That isn't OOP, and the point is OOP minded retards ruin shit
>>
>>60014595
>// c is undefined
No it's not.
>int f = -7 % 2; // you can only rely on (x / y) * y + ( x % y) == x
Since C99, modulo on negative numbers is completely well-defined.
quotient*denominator+remainder = numerator
>// compiler must know the calling convention
Yes, of course. That's part of the ABI.
Unless you're using stupid microshit which has multiple calling conventions for some reason, you don't need to worry about this at all.
>>
>>60014666
i no longer find C++ lacking in terms of higher-order functions after C++17's addition of constexpr/generic lambdas. what's wrong with visit and how does it or anything surrounding it/optional/variant have anything to do with OOP?
>>
>>60014699
It's not perfect, it's alright
>>
>>60014714
No shit sherlock. The point is >>60014666 is retarded, as OOP has nothing to do with it.
>>
>>60014663
>casting a data pointer to function pointer is undefined
C doesn't guarantee that "data" pointers and function pointers are compatible.
However, in POSIX C, it's fine. Obviously you need to cast it back if you want to actually use it.
>and you can't cast (const char ***) to (const char *)
Actually, yes you can. Probably not for the reasons you're think of, though.

Just skim-read the standard if you want to know all of these little details.
>>
>>60011730
This was posted by a ME, you fucktard. The guy also admitted to have no experience with programming and he doesn't like it.
>>
>>60014742
"Visit" was almost certainly made with OOP in mind

>>60014738
The point is the standard library is fucking shit and lacks HOFs, not that you can't write your own HOFs
>>
>>60014715
This is a good question for the initialization order specifics.

http://stackoverflow.com/questions/36314005/is-it-safe-to-reference-the-struct-that-is-being-initialized-in-its-initializer
>>
>>60014778
I don't use C++, so I'm trying to understand variants and visitors and whatnot. So a variant is a type-safe union, and a visitor is an object which may contain some operations that can be applied to variants. Is this close? If so, this reminds me of map.
>>
>>60014850
C++ is the answer to the question.
>>
>>60014778
>"Visit" was almost certainly made with OOP in mind
just seems to me like an odd thing to say about a straightforward generic higher-order function

>The point is the standard library is fucking shit and lacks HOFs, not that you can't write your own HOFs
the functionality is honestly somewhat new to the language, and C++'s standard library is generally minimal as hell anyway. maybe they'll add more in the future, but it's not like that shit is particularly hard to write yourself in the meantime. and i'm sure there'll be any number of third-party libraries cropping up in the near future to that effect as well
>>
>>60014866
Yes. OOP reinvent square wheel - ie. bad FP.
>>
>>60014866
I don't know any of this visitor bullshit, but std::variant is a discriminated union, and visit is a shitty function

>>60014875
>a straightforward generic higher-order function
It isn't straightforward, generic or useful.
What it ISN'T is pattern matching.
To use generic, you have to check the case of the variant and act in EACH function you pass.
This is fucking ridiculous - it's a completely useless function!

Instead they should have made it work like this:

variant<int, string, float>
visit(inthandler, stringhandler, floathandler)
>>
>>60014850
That's brining up initialiser lists, which is something different.
>>
>>60014867
Is it defined in C++?
>>
File: 1481883613210.jpg (32KB, 640x640px) Image search: [Google]
1481883613210.jpg
32KB, 640x640px
>string userName
>string password
nani?
>>
>>60014900
With class, you can control what happen.
>>
File: 1486376698008.gif (415KB, 500x500px) Image search: [Google]
1486376698008.gif
415KB, 500x500px
>>60007077
A theorem prover and an OS written in it.
>>
>>60014951
seL4
>>
>>60014888
you mean like this?

template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;

int main()
{
std::variant<int, float, std::string> v;

// ...

std::visit(overloaded{
[](int i) { /* handle int */ },
[](float f) { /* handle float */ },
[](std::string s) { /* handle string */ }
}, v);

// ...
}
>>
File: 6nyrg06ddoqy.png (739KB, 750x679px) Image search: [Google]
6nyrg06ddoqy.png
739KB, 750x679px
man boost libs are cool and all but half of them are useless because of all the template shenanigans
>>
>>60014867
C last draft: 701 pages
C++ last draft: 1622 pages.
>>
>>60014964
yes, and whichever state it's in, it should call

but that isn't how the actual version works
it's garbage
>>
>>60014974
>man boob libs are cool
homo
>>
>>60014534
>>60014534
>>60014534

Please respond
>>
>>60015012
>it's garbage
This is implicitly known to be true since we're talking about C++. No need to say it.
>>
>>60015012
>yes, and whichever state it's in, it should call
it does

>but that isn't how the actual version works
yes it is. it is equivalent to regular overloaded function resolution
>>
>>60015027
Not programming.
>>>/g/wdg/
>>
>>60015083
it's desktop program, those /wdg/ guys don't have clue about that
>>
>>60015074
I didn't see this overloaded { } shit, what is the point of visit without it?
>>
>>60007097
APL
>>
>>60014974
well the cool thing is that they're a collection of libraries and not just a single huge library
so you can pick whatever you want
>>
>>60015094
it's a way around the more verbose but functionally equivalent alternative of a named function object type with operator() overloaded for the variant types. you could also just pass a single non-"overloaded" lambda taking auto and branch functionality with constexpr if and type traits and such
>>
File: 1483612379290.gif (662KB, 292x300px) Image search: [Google]
1483612379290.gif
662KB, 292x300px
What is the best language to write an anime girl in?
>>
>>60015249
Japanese or if you are uneducated faggot english
>>
New thread:

>>60015283
>>60015283
>>60015283
>>
>>60015274
>Japanese
Too ambiguous to compile.
>English
I said "anime girl".
Thread posts: 319
Thread images: 43


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