[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: 324
Thread images: 24

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>58562697

What are you working on /g/?
>>
>>58567241
First for D
>>
>>58567257
Sounds gay, tbqh
Who would want to learn "the D" language
>>
Fuck you for using an anime image
>>
Steve ballmer did nothing wrong
>>
I did this windows keylogger library thingy where you can use a keylogger in your application quite easily and just get logged keystrokes https://github.com/Gikoskos/WinKeylogger

it's in C. What do you guys think?
>>
File: 1461458713552.jpg (181KB, 1102x1079px) Image search: [Google]
1461458713552.jpg
181KB, 1102x1079px
>>58567241
Thanks for using an anime image
>>
>>58567265
your mom would love to learn about it from me
>>
>>58567297
She would, but my mom doesn't use kiddie garbage collected languages.
>>
File: 1482346087159.jpg (34KB, 436x428px) Image search: [Google]
1482346087159.jpg
34KB, 436x428px
>>58567265
>>58567297
>>
>>58567241
why does she wear the mask?
>>
>>58567319
she isn't wearing a mask
>>
>What is Chapel?
Chapel is a modern programming language that is...
parallel: contains first-class concepts for concurrent and parallel computation
productive: designed with programmability and performance in mind
portable: runs on laptops, clusters, the cloud, and HPC systems
scalable: supports locality-oriented features for distributed memory systems
open-source: hosted on GitHub, permissively licensed

http://chapel.cray.com
>>
>>58567241
I'm finishing up second year of a electrical engineering course hoping to go into robotics at the end of all of this. Should I be spending more time learning lisp or C?
>>
>>58567328
at least you can talk. who are you?
>>
>>58567334
>Robotics
Python.
>>
>>58567338
What if I don't want to learn a shit language?
>>
>>58567306
Well, you tried
>>
learning me a haskell for great good
>>
>>58567378
there's this too
https://en.wikibooks.org/wiki/Haskell
>>
Help /g/ please...

I've used C# for about a year now and I'd never made a non-trivial/practical program.

I've tried Lua for gamedev with Love2D and that was the first time I've ever actually got something on the screen.

I've dabbled in C making trivial programs and fumbling with retarded shit that was a waste of time.

I bought "Programming: Principles and Practice Using C++ (2nd Edition)" with the intention of actually learning a programming language and learning how to actually program but I kept getting stuck and not being able make projects that do anything, not being able to use multiple files (the concept of using headers/linking shit/ defining shit etc just doesn't make any sense to me)

Is there a language I can use to learn how to program that has a simple workflow, compact standard library, and is robust/practical for actually making shit?

The problem could very well be lack of effort or competence though. I'm also learning alone with no sort of schooling.
>>
>>58567235
>>58567243
I'm not saying it isn't important, but writing
>>58567168 seems pretty useless IMHO.

>>58567252
Probably, I'd ask somebody in that field though.
>>
I need some image filter ideas.
>>
>>58567398
i'm learning it too but i'm too far into LYAH to switch at this point. which chapters are done better in wikibooks?
>>
>>58567429
C# is very practical
If you want to maek gaem, I believe Unity3D uses C# running on Mono or something to that effect.
>>
>>58567450
One that turns any image into anime.
>>
>>58567454
i've heard the wikibook can be a bit slow, but it's more up to date than LYAH
if you have issues with LYAH try looking at the corresponding wikibook part
>>
>>58567491
if you don't mind: what has changed in haskell over the years?
>>
File: Noragami - Iki Hiyori.jpg (69KB, 450x645px) Image search: [Google]
Noragami - Iki Hiyori.jpg
69KB, 450x645px
>>58567241
I wrote a Racket macro that defines procedures and saves its definition as a list inside a struct.
For example:
(λ-define (foo a b . c) (append (list a b) c))
(λ-access-list foo) ;=> '(λ (a b . c) (append (list a b) c))


What I'm trying to do now is get it to recognize currying so that
(λ-define ((add n) m) (+ n m))
(λ-access-list add) ;=> (λ (n) (λ (m) (+ n m)))


I've written the code so I can take ((add n) m) and turn it into the list, but my biggest trouble is getting the macro to define the new identifier without polluting the namespace with intermediary calls to define.
>>
>>58567533
go away
>>
what is the best text editor and why is it atom?
>>
>>58567344
C++?
>>
>>58567526
a fair amount, if you see any real haskell code you'll notice at least 10 GHC language extensions being used

here are some common ones

>no monomorphism restriction
>GADTs
>existential quantification
>rank n types
>multi param type classes
>flexible instances
>flexible contexts
>type in type
>>
>>58567526
>>58567567
plus Prelude has changed, particularly in GHC
so a few constraints are shifted around,
i think there are examples in LYAH that might not compile or might be unnecessarily restrictive
>>
File: 1484620387411.png (618KB, 738x845px) Image search: [Google]
1484620387411.png
618KB, 738x845px
>>58567533
stay
and thank you for using an anime image!
>>
>>58567526
A zillion extensions that will never be as good as starting from scratch with dependent types.
>>
>>58567429

Given the number of languages you've worked with, you could probably say you already "learned how to program." Your interest now is in making practical applications, yes? Any of the languages you've learned will be fine for that task. You just have to figure out what the hell you want to program, and what 3rd party libraries you want to use to accomplish that.
>>
File: 1466614536281.jpg (113KB, 930x523px) Image search: [Google]
1466614536281.jpg
113KB, 930x523px
>>58567590
thank you for using a karen image
>>
>>58567567
>>58567575
thanks. i need to sit down and catch up on this sometime
i work in math -- a category-heavy branch, even -- and people always say haskell is a natural fit. imperative programming and math do not seem like the best possible friends to me but i can never get into the alternatives
maybe today is the day
>>
>>58567344

https://shodan.me/books/Electronics/

https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#computer-vision
>>
what's the male pattern baldness of programming languages?
>>
>>58567653
https://www.reddit.com/r/haskell/comments/516htg/learning_haskell_as_a_category_theorist/?st=iy574e5z&sh=fdd3d8fd
>>
>>58567689
Go
>>
>>58567692
>>>/p/lebbit
>>
What's the 2003 Toyota Celica of programming languages?
>>
>>58567712
Ruby
>>
I'm working on my decentralized internet TV system (source code is >>58567444)

I'm working on stats collection in the protocol. Every item sent over the network has IDs, and IDs can form linked lists if they make a stream (video, audio, captions, etc). Every item that comes through a socket has the ID listed as coming from that socket in a vector (will rework to make more efficient with Tor). When an ID is tested for the likelihood that a socket has it, each of the IDs have this linked list followed until the local supply of IDs ends. The odds of them having it is currently the absolute inverse of the shortest linked list distance (no finding is 0).

I'm working on a not stupid algorithm for the previous paragraph and how I can effectively compare this against request response time and bandwidth (request response time takes into account decryption, decompression, and node speed more than ping time).

GitHub: github.com/Dako300/BasicTV
IRC is #basictv on Freenode (webchat.freenode.net)
>>
Python is the Javascript of programming languages.
>>
File: AMC_EAGLE.jpg (164KB, 640x480px) Image search: [Google]
AMC_EAGLE.jpg
164KB, 640x480px
What's the AMC Eagle of programming languages?
>>
>>58567751
Java is the javascript of programming languages

>too big
>used to often
>stupid
>pajeets use both
>>
>>58567712
>>58567756
Go back to /o/, you fag.
>>
>>58567763
Which of those don't apply to Python?
>>
What languages should a snake learned?

I already know Python and ASP
>>
>>58567798
Coq
>>
>>58567798
if you've learned python then it's too late
>>
>>58567241
Thanks for using a cancer image.
>>
File: Noragami-OAD-1-6-1024x576.jpg (143KB, 1024x576px) Image search: [Google]
Noragami-OAD-1-6-1024x576.jpg
143KB, 1024x576px
>>58567590
>>58567627

>garbage waifu
>>
File: karen copypasta.png (55KB, 1311x226px) Image search: [Google]
karen copypasta.png
55KB, 1311x226px
>>58567844
>>
>>58567798

s-s-s-s-seeeeee (C)
>>
>>58567798
Lisssssssssp
>>
why all the hate on python in these generals?

I use it daily for work and there's no other language that has the support that anaconda can provide for working with dataframes.
>>
why is equal to "===" in javascript? just to be different from other languages? wtf?
>>
>>58567955
Because people hate mandatory indentation and slow performance, I'd guess.

But it's a very versatile language and it's easy to pick up and just get things going without having to build the wheels just to program a cart, so a lot of "hate" for the language I'd say is just not using it for tasks it performs well.
>>
>>58567982
Because == can do conversions and ends up being a non-transitive mess.
>>
File: YidZYVf.jpg (289KB, 900x1200px) Image search: [Google]
YidZYVf.jpg
289KB, 900x1200px
>>58567955
Python is best snake.

Python is worst programming language.
>>
>>58567994
>people hate mandatory indentation
if you're not indenting your code when using other languages then you should kys

as for the performance it's negligible unless you're a gaymen making gaymes, and if you're doing a project of large scale then of course it's better to use a better language suited for those needs such as c or c++.
>>
Perl..in atom..finally got B::Lint to work
>>
>>58567955

It's the little things in Python that make me prefer Ruby for many of the tasks that Python is used for. The non-inclusive range function is annoying as is the terrible lambdas when compared to any other language with them. Also, there's too many methods written __like_this__. I'll use it if I need a specific Python library not available in other languages, but otherwise, stick to Ruby and C++.
>>
>>58567749
>>58567444
I'm looking for contributors and followers in general. If you have any questions or are interested in helping out, let me know in the IRC.
>>
past me would think current me is such a genius. i had to pick random strings from a big list of them, without any repeats. so i just put them into a list, called a shuffle function, and then took the head out of the list X times
>>
>>58568148
nice. modern perl can be a joy to work with, it's a shame that people give it a bad rap
>>
>>58568261
perl is for autists, not even joking
>>
I dig perl..because i can do so many different things...quickly.. its great for prototyping ant just hacking things out to see if your idea can work and its pretty loose syntactically... it appeals to my inner hippie..atom is nice..really customizable and with linting working now makes me happy.
>>
Where should one start for functional programming languages?
>>
>>58568464
Scheme
>>
>>58567982
=== is deprecated, use ====
>>
>>58568464
Scheme if you want a Lisp
Haskell if you want strong types, or don't care about lisp
>>
>>58568464
Scheme/Racket is probably your best bet.
>>
>>58568526
>>58568562
>>58568598
Thanks anons, I'll give both a try. I used scheme once in uni, but never haskell.
>>
>>58568862
if you try haskell use the wikibook

https://en.wikibooks.org/wiki/Haskell
>>
I need a project, beginner-intermediate level Python, just something to do to get some practice/learn some things. Any ideas?
>>
>>58568926
Discord bot.

Have it fetch lewd stuff from sad panda and share it us.
>>
>first day of intro to comp sci
>hear some guy behind me can't compile a hello world in java because he 'just installed linux a few days ago'

loel
>>
>linux binary is 100k
>windows binary is 6M
>>
#include <stdio.h>
#include <stdlib.h>

extern int aprintf(char * __restrict__ *dst, const char * __restrict__ fmt, ...)
__attribute__((format(__printf__, 2, 3), nonnull(1, 2)));

int main()
{
char *str;
if (aprintf(&str, "%s / %s / %s %d / %s / %lld %s", "born to die", "world "
"is a fuck", "kill em all", 1989, "i am trash man",
410757864530ll, "dead cops") < 0)
return EXIT_FAILURE;
puts(str);
free(str);
return EXIT_SUCCESS;
}


it's nonsense there's no function like this in the standard library, it's about the only thing that makes working with strings bearable.
>>
Learning ASP.NET so I can offer myself up for enslavement to a corporation
>>
>>58569111
What's your intro class cover, mine was just C.
>>
>>58568257
note that by shuffling before every pop you increase randomness and it then still qualifies as a uniform distribution. Why? Because there's work for it.
>>
>>58569207
Java, am pretty jelly

The prof is pretty bad though, she just reads directly from the powerpoints, thankfully I have no problem self teaching/have prior experience so it shouldn't be a problem.
>>
It's time to play identify that function

import Data.Char

main = do
line <- getLine
print $ isX line

isX :: String -> Bool
isX a =
(sanitize a) == (reverse $ sanitize a)
where
sanitize = filter isLower . map toLower
>>
>>58569244
My class was the same. It wasn't like the prof didn't know what he was doing, he was actually a really knowledgeable guy with tons of experience and he travels the world giving lectures. It was just the classroom experience didn't really give me anything, I actually skipped most of the lecture after 3 weeks.
>>
>>58569297
main = (isX <$> getLine) >>= print
>>
>>58567334
>robotics
Labview.
>>
>>58569314
Yeah she said on the first day she has only been teaching for three years and 27 years prior to that was working for Intel. Feel kinda bad for the people with 0 experience since they're probably already lost as hell
>>
>>58568464
If you're on Windows, definitely give F# a go, it's a very modern and feature packed ML derivative.
>>
>>58569320
Can't you just
main = (print . isX) =<< getLine
>>
>>58569380
Oh, very nice.
>>
How can VS Code be so much better than Atom? I'm surprised MS can be this competent with anything not telemetry
>>
>>58569207
>>58569244
>java
>c

holy shit I envy you guys. my first two programming courses were c++ and vhdl
>>
>>58569423
Devdiv.
>>
>>58567344
I used to eat up the python is shit meme, then I actually tried python for a few projects.

Now it's my goto prototyping/finish a task quick language.
>>
what Im working on is going to make me a lot of money. It's already paying the bills and then some but it looks like I'm on track to be making twice as much in less then a year.

this project has been very emotionally rewarding as well. it's been teaching me a lot about business as well as legacy systems that everyone uses. because of my previous security-oriented career and training, i'm also picking up a lot of little new techniques that reveal just how far the rabit hole goes.
>>
>>58569475
Nothing you've said here changes the truth of it being a shit language
>>
>>58567749
>C++
tell me when you decide to go with C and I'll think about it
>>
File: 1435624490905.jpg (92KB, 430x342px) Image search: [Google]
1435624490905.jpg
92KB, 430x342px
>when you master C++ templates
>when you master C++17 template features
>when you understand high level meta-programming concepts
>>
File: RON.jpg (13KB, 320x240px) Image search: [Google]
RON.jpg
13KB, 320x240px
So I have to learn R

what am I in for?
>>
>>58569607
>when these high level meta-programming concepts aren't even applicable to 99% of all projects

Enjoy your useless knowledge.
>>
>>58569607
so you turned into the pajeet on your image?
>>
>>58569628
>>58569641
Very cool opinions on this anonymous image board that keeps telling me to use Rust!
>>
File: What a Weenie.png (169KB, 310x325px) Image search: [Google]
What a Weenie.png
169KB, 310x325px
Okay... I'm a Python beginner, and as a small-ish project, I'm thinking of making a python script that runs every couple of hours and tracks the number of comments mentioning a certain president-elect in reddit's politics subreddit. (then writing the number of comments with a mention and the total number of comments analyzed to a file)

How would I go about this? Is there a reddit API somewhere? I feel like it should be relatively easy to do
>>
>>58569653
yeah, i really hate that "Anonymous" guy too
>>
>>58569667
>P*thon
>>>/r/eddit
>>
>>58569667
this isnt the right place.
Everyone here wants you to use C or Rust and it's that time of night in the US where all the productive-less pajeets try to make you feel bad for not making some system driver in some 5000 BC version of C
>>
>>58569667
this guy is right >>58569700
plebbit would be a more appropriate place for your ilk
>>58569667
>>58569700
see >>58569683
>>
>>58569621
I've been writing R daily for around 2 years now here's my experience:

1) It is a language written by statisticians for statisticians: throw a lot of your general programming knowledge out the window. The statisticians made some major mistakes

2) Vectorize, vectorize, vectorize. For loops are slow: http://stackoverflow.com/questions/7142767/why-are-loops-slow-in-r early optimization can be made by using the write magic vectorization function

3) be DISCIPLINED. It is terribly easy to write spaghetti R. It allows for OOP, functional, vectorized, lots of programming styles. this is bad in many ways because if you can very easily write bad code. I find functional fits best with R

4) READ THE DOCS "?" is your friend. R is a language where you use the 10,000 magic functions to make your life easier. libraries like dplyr helped this a lot.

it's an amazing language and will open your horizons. Easily the best statistical language bar none. Meant for statistics tho, not for programming.
>>
>>58569700
>5000 BC version of C
Is your retarded ass implying C was around at that time? What an idiotic post.
>>
File: insults.png (43KB, 667x778px) Image search: [Google]
insults.png
43KB, 667x778px
>>58569683
>Making an implicitly normative statement on a respectable Christian imageboard
>mfw

>>58569700
>>58569720
Alrighty... Thanks anyways... I might try again and asking tomorrow, but I kind of wanted to crank this out before "the Yuge Day"
>>
File: thumbsup.jpg (9KB, 204x240px) Image search: [Google]
thumbsup.jpg
9KB, 204x240px
>>58569496
>>
>>58569763
yeah, i'm gonna crank one out pretty soon too if you catch my drift.
you shouldn't leave your subreddit anymore though. we don't like your kind around here.
>>
>>58569746
C is so fucking old and legacy feeling why do people still use it
>>
>>58569667
It is relatively easy to do. Bing "reddit api" then fire off a couple of REST requests
>>
>>58569798
How is this in any way a valid response to my post?
also see >>58569683
>>
>>58569798
>>58569833
fuck off, plebbitards.
>>
>>58569861
i prefer Microsoft PowerShell for my programming needs
>>
>>58569891
cool, now go back to your "sub"
>>
>>58569906
hating reddit was sooo 2004. bet you still digg it
>>
>>58569927
>2004
it wasn't even born yet, plebbitor.
i don't hate ribbit, i hate it's users. and that can't possibly be tied to a particular time frame since their retardation is never-ending
you have to go back now, you've been here for longer than necessary
>>
>doing a school project where we have to write a program that'll encrypt and decrypt a string
>easy enough
>get most of it done in like an hour and a half or so
>for whatever reason, the encryption output is giving different output for the same key and input
This don't make sense, I'm using AES in ECB mode
>>
>>58569968
>>58569927
>>58569906
>>58569891
>>58569861
>>58569798
>You wanted some help and ruined everything
>>
>>58570033
just stop being a plebbitor.
or alternatively fuck off back to your """website"""
>>
What is the most numale/cuck language?
>>
>>58570084
Java
>>
>>58570084
python
rust
>>
>>58570084
go
>>
>>58570084
The one your father speaks.
>>
>>58570084
american english
>>
>>58570084
ruby/js/rust
>>
>>58570084
haskell
>>
I'm working on a chrome extension. Is there a way to extend this dropdown box over the edge of the window? I could make the window taller and it works fine, but it looks better if it goes over the bottom edge, like in this image
>>
Which Scheme interpreter should I use?
>>
File: ggggg.png (2KB, 249x89px) Image search: [Google]
ggggg.png
2KB, 249x89px
>>58570382
forgot picture
>>
>>58570084
the rust community here consists mostly of uninformed children, so probably that.
>>
>>58570400
i think you want less padding
correct?
>>
>>58567554
Bah, you tried.

Have a (You), bait goes on sale again tomorrow morning at 9 :^)
>>
>>58570485
baited for this exact response
>>
>>58570389

Depends, what do you want to use Scheme for?
>>
>>58570521
For now I'm just doing sicp.
>>
>>58570466
Less padding could work for like one entry, but it could also be a very long extension over the edge so it wouldn't really work. I'm not sure if chrome allows it to extend over the window somehow and changing the z-index didn't put it above the edge either
>>
>/wdg/ hates C
looks like I found a place gayer than /dpt/
>>
I need some ideas for applications I can build that I can use to pad my portfolio. I'm a software developer with little professional experience, but just assume that I can build just about anything. I specialize in web applications and enterprise shit, if it matters.
>>
File: 1460092973539.jpg (55KB, 600x1104px) Image search: [Google]
1460092973539.jpg
55KB, 600x1104px
>>58567444
>AMDMachine
>>
>>58567798
ASP isn't even a language, so I'm going to go ahead and recommend something simple like RPG Maker for you.
>>
>>58567429
C# is great for big webapps. I don't know how good the performance is on Linux, but it's by far the optimal choice for Windows servers.
>>
>>58570443
>consists mostly of uninformed children

that goes for any language here. These threads are shit.
>>
>>58569155
The function you're recreating is called snprintf. Go read the standard before you reinvent the wheel, retard
>>
Working on trying to create a backtracking algorithm to solve the 8 queens problem.
Given an initial queen placement you must attempt to place the remaining 7 queens so that none intersect.
If you can solve it you print all the queen coordinates. Otherwise you print insolvable.

      ROOT
/ \
A B
/ \ / \
C D E F
/ \ / \
x x x Good Solution


I'm almost done. I have the recursive structure down for the method, just need some way to mark which branches are dead ends so it can backup and follow other branches down to possible solutions.
>>
>>58570743
Make an 8x8 array?
>>
>>58570777
The 8x8 array is the easy part. already doing that and using booleans to block all queen locations given (x,y) for a queen.

The hard part is you have to use recursion to solve the problem efficiently.
If you tried to bruteforce it without an efficient algorithm there would be over 100 trillion tests to find one of the 92 solutions.
>>
public class MainClass
{
String input = "";
Scanner scan = new Scanner(System.in);
System.out.print("enter your name: ");
input = scan.nextLine();
Player player = new Player(input);
player.Begin();
}

public class Player
{
public String name;
public int power;
public int defense;
public Player(String newName) { name = newName; }
public void Begin()
{
Scanner scan = new Scanner(System.in);
System.out.print("enter your power: ");
power = scan.nextInt();
System.out.print("enter your defense: ");
defense = scan.nextInt();
System.out.print(name + ": POW: " + power + ", DEF: " + defense);
}
}


Output looks like:

enter your name: Bob
Power:
Defense: 4
Bob: POW: 0 DEF: 4

For some reason, I'm unable to input an integer for power.
>>
>>58570847
Would it really? Each queen removes quite a lot of locations so the set might not be as big as you'd think.
>>
>>58570860
You are missing the difficulty of the problem. If you place queens arbitrarily you most likely will reach a dead end before all queens are placed.

You have to place 8 queens. It gets easier every time you place a queen until you find out some placements you can only place 5, 6, or 7 queens before no available spaces are left on the board.

So if you don't have a way to preserve all that work you did finding one dead end, then you will be doing a lot of bruteforce work that does have a lot of combinations. It's a fantastic puzzle to show the value of an efficient algorithm.
>>
>>58570847
>you have to use recursion to solve the problem efficiently.

You do realize you can do the same logic as recursion with a loop right? Recursion just makes the code more readable.
>>
#include <stdlib.h>

void *my_malloc(size_t sz)
{
void *ptr;
if ( (sz = 0) // no warning is emitted due to the extraneous parentheses
|| ((ptr = malloc(sz)) == NULL))
{
return NULL;
}
return ptr;
}


Reminder that extra parentheses not mandated by your warning options are considered harmful.
>>
I hope potential employers don't mind an anime avatar on my github profile
>>
>>58570908
I don't see how you would solve it without using recursion.

I'm specifically looking at the technique called backtracking which you cannot perform without recursion because you have to traverse a tree from the root to the end and don't know how many times you have to back up and traverse other paths.
>>
>>58570650
how about you go read the standard yourself.
snprintf requires a previously allocated buffer, as opposed the GNU extension asprintf, which automatically allocates a necessarily large buffer using malloc.
>>
>>58570919
It's a feature e.g.

FILE *f = fopen("something.txt", "r");
char c;
while ((c = fgetc(f)) != EOF && c != '\n') {
...
}
>>
>>58570954
with a stack and a loop. That's basically what happens with recursion anyway.
>>
>>58570536

MIT Scheme or Racket.
>>
>>58570954
It was proven decades ago that any recursive algorithm can be implemented without recursion. It's just painful in many cases.
>>
>>58571008
imho MIT Scheme is better for SICP since it's so barebones and simple.
>>
>>58570743
>I have the recursive structure down for the method, just need some way to mark which branches are dead ends so it can backup and follow other branches down to possible solutions.
Why? Just traverse through the brances and when you find a working solution save it to some global list/array of valid boards.
>>
>>58571016
See below.

>>58571008
If you're not using Racket you're doing it wrong.
http://docs.racket-lang.org/sicp-manual/index.html#%28part._.Installation%29
>>
>>58570996
>>58571011
Neat. didn't know that. I'm into this to learn about an algorithm and write the best code. recursion seems most fit anyway.
>>
>>58571046
General rule is the algorithm is simplest when it matches the data structure, so if you're exploring a recursively defined data structure (a tree, for example), then a recursive algorithm is a good fit for first implementation.
>>
>>58570627
On Linux Java is slightly faster and uses less memory.
>>
>>58570992
oh yeah absolutely. but this is a case where supposedly == was meant instead of =.
>>
>>58571080
We gotta be careful for sure. C can surprise even veterans.
>>
>>58571046
Recursion is not bad, I'm just saying it's not the ONLY way to solve that problem. One reason you'd want to switch to iteration is if you're hitting stack overflows using recursion. Or if the language you're using has expensive function calls and you need the speed. (although for both of these, depending on the language you can rewrite recursion so that the compiler/run time can tail call optimize it into basically what you'd write by hand).
>>
>>58568050
> C
> Large scale project

Just, what?
Java/C# are made for large scale projects. Notice that these don't have #include, but imports, so that you don't need something like make just to intelligently compile something. They have things like maven that defines entire projects with integration tests, unit tests, compile-time dependencies, etc., jenkins for continuous integration, compiler macros that actually hook the compiler, real enums that aren't just ints, but actual types with behaviour, generic types, and all sorts of stuff to make large scale programming better.

C doesn't.

You don't have to like Cava and J#, but they are pretty good at their niche.

C is made for smaller programs.
>>
File: 1474392523020.png (132KB, 500x500px) Image search: [Google]
1474392523020.png
132KB, 500x500px
>>58570976
Indeed, I didn't pay attention to str not being allocated as I quickly read your snippet so I could reply with a disparaging comment as to try to claim superiority over an anonymous poster on an anime imageboard because I'm a loser NEET who secretly faps to 2D traps
>>
>>58571134
I hate to agree with you. Most large C projects have switched to a subset of C++ or at the very least a highly extended dialect of C.
The fact that things like xmacros are even a sensible option is ridiculous, not even to mention the abysmal state of C build systems (hope you like hundreds of bespoke scripts that must all be kept up to date).
>>
>>58571134
>I don't know how to write large-scale programs with C
>Therefore C can't be used for large scale projects
Good one, idiot.
>>
>>58571181
>things like xmacros are even a sensible option is ridiculous
What do you have against X macros?
Sometimes they are the best tool for the job and can massively reduce code duplication.
>>
>>58571142
well at least you weren't completely wrong, as asprintf() can be implement in terms of two vsnprintf() calls, intermitted by a single malloc() call.
however doing that portably with error checking requires considerable boilerplate.
>>
>>58571134
What's the maximum reasonable size for a C program
>>
>>58571212
>however doing that portably with error checking requires considerable boilerplate
What errors?
Passing an incorrect format string and/or arguments is simply undefined behaviour, so you don't need to check for that shit.
Otherwise, if malloc fails, just return NULL.

>>58571224
However big the Linux Kernel is.
>>
>>58571208
Its a bit of a hack I feel and quite limited at that.
But I guess at least most folks don't feel justified to use m4 with C, as that'd lead to even worse state of things.
>>
>>58571230
>Its a bit of a hack I feel and quite limited at that.
I feel that it's actually quite an effective use of the preprocessor.
You just probably just don't like the fact that C macros are unhygienic, which is a valid complaint, but it's way too late to change that shit.
>>
>>58571228
Well if you don't care are about error checking and good diagnostics I guess anything goes.
But I'd rather have all that.
>>
>>58570847
Well... I wrote a most obvious recursive bruteforce approach and it gives the answer immediately, using an 8x8 array to store forbidden board cells.

#define W 8
struct Board{
bool cells[W][W];
QList<QPoint> queens;

Board(){ memset(cells,0,sizeof(cells)); }

void placeQueen(int x,int y){
cells[x][y]=1;

for(int p=x-1;p>=0;p--) cells[p][y]=1;
for(int p=x+1;p<W;p++) cells[p][y]=1;
for(int p=y-1;p>=0;p--) cells[x][p]=1;
for(int p=y+1;p<W;p++) cells[x][p]=1;
for(int p=1;x+p<W && y+p<W;p++) cells[x+p][y+p]=1;
for(int p=1;x+p<W && y-p>=0;p++) cells[x+p][y-p]=1;
for(int p=1;x-p>=0 && y+p>=0;p++) cells[x-p][y+p]=1;
for(int p=1;x-p>=0 && y-p>=0;p++) cells[x-p][y-p]=1;

queens << QPoint(x,y);
}
};

QList<QPoint> queensProblem(Board & state,int howManyToPlace){
if(howManyToPlace==0) return state.queens;

for(int y=0;y<W;y++){
for(int x=0;x<W;x++){
if(state.cells[x][y]==1) continue;

Board board=state;
board.placeQueen(x,y);
QList<QPoint> answer=queensProblem(board,howManyToPlace-1);
if(! answer.isEmpty()) return answer;
}
}

return QList<QPoint>();
}

int main(int argc, char *argv[]){
Board board;
board.placeQueen(4,4);
qDebug() << queensProblem(board,7);
return 0;
}


(QPoint(4,4) ,  QPoint(2,0) ,  QPoint(5,1) ,  QPoint(1,2) ,  QPoint(6,3) ,  QPoint(0,5) ,  QPoint(7,6) ,  QPoint(3,7) )
>>
>>58571271
Realistically though, what errors can you even report?
There is no (portable) way to know the number of arguments or the types of arguments given to a function, so you cannot check those against the format string. The only way to get error messages for this is with a compiler extension, which >>58569155 used.
Otherwise, you could scan the entire format string for invalid format specifiers, but the previously mentioned compiler extension already does that for you, and you would just be duplicating a lot of the shit printf already does.
You should really just set some preconditions for your function, and if the caller doesn't meet those preconditions, the behaviour is undefined and your function doesn't guarantee any particular behaviour.
>>
>>58571253
Oh I use it myself. I just wish there would be better tooling by now (some of which I'm actually working on myself as a side project, but that's long way in the future when it'll be done).
>>
>>58571308
Can't do much about va_list.

int asprintf(char ** restrict dst, const char * restrict fmt, ...)
{
if (dst == NULL || fmt == NULL)
return -1;

va_list ap;

va_start(ap, fmt);
int len = vsnprintf(NULL, 0, fmt, ap);
va_end(ap);
if ( len < 0
|| (unsigned int)len >= ( INT_MAX <= SIZE_MAX
? INT_MAX : SIZE_MAX ))
return -1;

int sz = len + 1;
char *buf = malloc((size_t)sz);
if (buf == NULL)
return -1;

va_start(ap, fmt);
int ret = vsnprintf(buf, (size_t)sz, fmt, ap);
va_end(ap);
if (ret < 0 || ret >= sz) {
free(buf);
return -1;
}

*dst = buf;
return ret;
}


Here's my fallback implementation which is about what you have to do to be standard complying.
>>
whats the best way to save the setting values of your program? is using a normal .txt file good enough?
>>
>>58571343
I don't even know of a situation where (v)s(n)printf can even fail.
>>
>>58571365
json or xml
>>
>>58571405
>json for saving program settings
pls no

>xml for saving program settings
god have mercy
>>
>>58570856
Scanner is not as simple as it seems.

1: Don't initiate it as a class variable.
2: Don't have it as a class variable.
3: Don't fucking make it on System.in, use System.console() instead.

Your error comes from using nextLine() though. Scanner is not a good way to read from the keyboard if you're going to do it more than once per program.

This of course, requires you to launch the program from a console, and not say, Eclipse.

Here's a fix:
http://pastebin.com/NV0JSqhr
>>
>>58571391
The case of malformed variable arguments would be one.
As evidence of general difficulty of implementing printf style functions correctly, there was a fresh gcc bug with not taking width.precision options in to account and emitting false warnings.
>>
>>58571426
>The case of malformed variable arguments would be one.
That's undefined behaviour, so any return value is meaningless.
I mean a "proper", recoverable error, where a negative number is returned.
>>
>>58571182
> He stated that a tool was not made for a specific purpose
> Therefore it follows that you cannot do it with that tool.

Ladies and gentlemen, the C hipster. No reading comprehension and let loose on a language with plenty of rope to hang himself with.

>>58571224
Subjective, it depends on your team, really.

>>58571253
Hygiene and C macros are a weird complaint.
They aren't macros in the lisp sense of the word to begin with. They're just string replacements. They don't hook the compiler, and they don't produce C programs, but text that the compiler turns into C programs. (Or barfs on.)
>>
>>58571365
>is using a normal .txt file good enough?

Yes. Especially on Unix plain text is generally preferred over binary formats.
>>
>>58569297
main = getLine >>= print . isX
isX a = sa == reverse sa
where sa = san a
san = filter isLower . map toLower
>>
>>58571439
I'm not familiar with the any specific libc implementation, but I'm sure they have high granularity access to va_list internals and are completely capable of flagging such errors gracefully.
>>
On the topic of generic programming.

Why would you favor homogenus translations? To me it seems like a rather dogmatic approach to try to fit everything into the same mold when that's clearly not what the programmer facing representation is about.

And there doesn't really seem to be any advantages unless the amount of types is massive. Like, thousands.
>>
>>58571457
To continue, just as you malloc can fail, even if only artificially, printf functions too are vulnerable to memory limitations.
But maybe I'm being too paranoid. However, as any compiler can do dead code elimination for UB, any extra safety is "free" and worth it if only because of the peace of mind it brings to developers.
>>
>>58571443
>They aren't macros in the lisp sense of the word to begin with
From wikipedia (with some bits removed to make the point clearer):
>A macro in computer science is a rule or pattern that specifies how a certain input sequence should be mapped to a replacement output sequence.
There is no special requirement for them to be hygenic or work with the compiler's AST.
Lisp macros are macros and C macros are macros.
You can't really argue against that.

>Ladies and gentlemen, the C hipster. No reading comprehension and let loose on a language with plenty of rope to hang himself with.
He was just complaining about a bunch of features which aren't even necessary for writing large scale software. He obviously doesn't know how to write programs without those and seems to think that large scale programs cannot be written without those.
There are so many counterexamples. Just take the Linux kernel. That thing is fucking massive.
>>
>>58571365
Use ini or conf formats. They're good at that sort of thing. If it's Java, use a properties file.
>>
>>58571420
Hey, thanks for the feedback but I found out what the issue was already. I've always had an issue with scanner in the past and I thought I finally got how to use it figured out, so it was even more confusing as to why the program wasn't working, but it turns out it wasn't an issue with scanner at all, but rather something else in the program that interpreted the input incorrectly.
>>
>>58567241
xipn xjmm tnbti uibu mjlf cvuupo?
>>
>>58571508
This is good advice. But if you're using C, the simplest way which is guaranteed to work is probably just dumping uintN_t variables to a binary in network byte order with memcpy.
>>
>>58571497
Hence why I said:
> in the lisp sense of the word
Since lisp macros hook the compiler, hygienic macros makes sense to talk about.

But for a text preprocessor, it does not.

> He obviously doesn't know how to write programs without those and seems to think that large scale programs cannot be written without those.

Actually, I said that these features make writing them easier. That's why languages with such features and tools are better for writing large scale applications.

You can indeed write large scale applications without say, dependency handling. Why would you want to though.

You have to get things done, and you have to do it right. Some languages are better at some things. You're not writing financial applications in JS (IEEE 754 is not suitable for representing money), and you're not writing web pages in C, and you're not writing Linux in Java. You could probably do those things, but they don't sound like very good ideas, now do they?

(And yes, I'm aware someone is likely to try to write a kernel in JS. People are dumb.)
>>
>>58571457
Looking at glibc, they don't do any special shit to determine actual argument types.
They just use va_arg like a normal program.
https://github.com/bminor/glibc/blob/ee19f1de0d0da24114be554fdf94243c0ec6b86c/stdio-common/vfprintf.c
Although I am seeing a few situations where it can fail gracefully (search for "done = -1").
>>
>>58567241
im going through the little schemer and its fun, but how do i try stuff out?
>>
>>58571565
Install scheme and write stuff?
>>
>>58571565
DrRacket is a pleasure to use. Don't bother with edwin.
>>
>>58571574
>>58571593
im using drracket with #lang r5rs and im at the 4th chapter but im retarded.

 
(define a 1)
(define b 2)
(define c 3)
(define d (a b c)) ;;list

(define (atom? x)
(and (not (pair? x)) (not (null? x))))

(atom? a)

application: not a procedure;
expected a procedure that can be applied to arguments
given: 1
arguments...:
2
3
>>
>>58569423
VS Code has telemetry.
>>58570564
They also masturbate to PHP and JS.
>>
>>58569423
MS is the world's premier IDE developer. And I say that as a borderline freetard.
>>
>>58571659
If I only could just use a Microsoft IDE, with an Intel compiler, using Java tooling, for an RISC architecture, with BSD philosophy... Eh might just as well wish for world peace.
>>
How do I bootstrap a virtual machine
>>
>>58571711
Do you even need to bootstrap your virtual machine?
>>
>>58571551
I think one reasonable error condition is an asynchronous call to setenv(). While undefined behaviour, it introduces a set of safety related problems that are required to be dealt.
>>
Programming a SDR EVP python script. A good way to practice DSP
>>
>>58571740
and I meant setlocale() here, sorry.
>>
>>58571726
Yes

I made my VM so that it can build and execute without any dependencies, not even OS system calls

It has a fundamental instruction set and data structures and a general mechanism to make system calls that get mapped to the OS's automatically

The point is to be as close to the OS as possible and do systems programming in high level language

However I've put myself into situation where I can't load the program that would implement I/O functionality

What do
>>
>>58567454
you can do both btw lyah isnt that good unfortunately (because its so cutesy i wish it was good but its not)
>>
>>58568543
what standard is that?

ive been using =====
>>
>>58569628
>when programming isn't applicable to 99% of life

Enjoy your useless knowledge.
>>
>>58571821
Thankfully. the committee is about to deprecate that syntax in favour of the much shorter =^)
>>
>>58571775
i'm already at the last chapter so it's too late to switch. i'll check out wikibooks though.
>>
>>58571343
Feel free to use this btw, it's _free_ _code_. OK going to bed now.
>>
>>58571769
Write bare minimum necessary code to bootstrap the VM and include it with the program image (like a C string). You can reload an updated, more feature-ful source later if you want.
>>
Sorry to annoy you guys, but /sqt/ won't answer my question after 3 hours.

Need help getting MinGW 64 (for NetBeans, on Win7)
I went to https://sourceforge.net/projects/mingw-w64/files/
Downloaded mingw-64-install.exe
Doesn't come with a make file.
This if for C++ btw.

Am I meant to download Mysys separately for a make file? If so, could you provide a link?

Also, not sure if this is weird, but my current Path to MinGW is C:\MinGW-w64\mingw32\bin.
So I'm confused why it says 32 in there.

Originally I got the installer from https://sourceforge.net/projects/mingw/
Downloaded mingw-get-setup.exe
It comes with a make.exe, and it allowed me to compile C++14.
Problem was, it wouldn't let me use std::to_string().
And then later I found out from some /g/uy that to_string() is in the 64 version

What do I do /g/?
>>
>>58571954
install linux or get a mac
stop worrying about development being painless
>>
I've made a list of public static final integers for set values (pretty much the same thing as enumerators).

public static final int SUNDAY = 1;
public static final int MONDAY = 2;
public static final int TUESDAY = 3;
...

When I try to assign an integer to these values, I get a null pointer exception.

int x;
x = SUNDAY;

This would error out.
>>
>>58571954
>mingw

Install msys2 instead. You're welcome.
>>
>>58572010
hell if you have a ~sick pc gaming rig~ just use a *nix vm.
>>
>>58572015
thanks for the post
>>
>>58571954
Mingw is a terrible pain on Windows and full of all kinds of corner cases, that need hacks. You best just use Visual Studio or >>58572010
>>
>>58572029
You're welcome. Now can you please assist me?
>>
anyone here use far manager at all? Looks bad ass af desu.
>>
>>58572042
With?
>>
>>58572044
A what manager now?
>>
>>58572041
Been using VS for the past 7 years
I'm going to stop studying soon and won't be paying for a non student copy
So I figured I'd best get use to another IDE

>>58572025
Alright I'll give it a go, thanks
>>
>>58572063
>far manager
looks like a russian norton commander for turbo nerds stuck with windows
>>
>>58572071
pretty much popular with ruskie competitive programmers.
>>
>>58572049
Helping me find out why I'm getting the error
>>
>>58572089
Because you do not understand how static variables are initialized.
>>
File: IMG_0008.jpg (90KB, 1228x522px) Image search: [Google]
IMG_0008.jpg
90KB, 1228x522px
>>58567241
Why the "return false" at line7 gets ignored even if comes after the return true of the for loop above?
>>
>>58572123
Maybe I got it. is it because a return closes a func right away? like a break in a if statement?
>>
>>58572123
because 9 is less than 10.
>>
>>58572123
Because 9 is less than ten.
>>
>>58572123
>9 < 10
>expects false
>>
>>58572158
You should probably look for some better tutorial of whatever language you're learning.
>>
>>58572159
>>58572158
So I guess I'm right. sorry, I started yesterday.
>>
>>58572087
hell i'd still rather use it than os x finder.
>>
>>58572170
I just didn't know return closes the func right away. So actually, if it finds a true value it doesn't even check for the rest of the array. Right?
>>
>>58572187
yes return just returns immedietely
>>
>>58572191
Thank you, I just checked.
>>58572172
This is actually quite good so far.

And you guys are very helpful. Thanks, I'll probably be back kek
>>
>>58572215
Yo stick at it, you're doing good.
>>
>>58572070
Msys2 contains the msys runtime and package manager as well as mingw32/64 to allow you to compile native windows programs. It's also got a terminal emulator, git, lots of software packaged, everything you need. Really comfy.

In fact I think it's only competitor is that fabled Windows 10 Ubuntu integration. I haven't used it, but maybe it works similarly?

Anyway, short of actually running Linux msys2 is the best I've used.
>>
Ok, I am decent at Python, Haskell and C. I am applying for grad school in mathematics.

BUT

how do I apply my programming skills to get gf help ty
>>
>>58572275
idk i just ask cute girls out and see what sticks. think of it as the monte carlo method.
>>
>>58572295
and if that fails, just put them into sleep mode
>>
>>58572332
thats not gpl compliant
>>
>>58572345
>>58572332
>>58572295
>>58572275

posts >> /dpt/.txt
>>
>>58572275
>Python
>gf
nah, not a chance.
>>
>/dpt/ always talking about how bad java is, about how its for pajeets, and that it sucks the soul out of you
>tfw now when java is required for my uni, I feel like killing myself even though I know nothing much about it
>>
>>58572563
cool, now move to /r/java where you belong
>>
>>58572576
fuck off nigger
>>
>>58572460
>putting a hidden .txt file in a root sub-directory
>>
>>58572563
>>58572576
java is fine
>>
>>58572581
#wow #whoa
>>
Lets say that I'm thinking of making a program with gui in c using gtk, what am I in for?
I mean its ok choice, r-right?
>>
>>58572581
i'm not subhuman though, i don't use java
back to your subreddit
>>58572584
see above
>>
>>58572602
depends, are you a plebbitor with sub 80 iq?
if yes, then use something like python or java instead
>>
>>58572602
GUI programming will make you want to kill yourself, the language you use doesn't really matter (although I heard good things about tcl+tk and REBOL).
I'd recommend going with Qt instead of GTK but it isn't really better, especially if you're using C.
>>
>>58572622
>GUI programming will make you want to kill yourself
I survive just fine writing programs with UI in Qt.
>>
>>58572617
>>58572622
Gotcha, as I imagined...
I'm gonna give it a try nonetheless.
>>
>>58572583
Check out @dpttxt on twitter. Also follows lots of other 4chan generals .txt such as the hilarious /emugen/
>>
>>58572605
i mean, gtk is bad, i mean real bad.
however, their docs are excellent so you it ends up being a far nicer than most other gui frameworks.
just be very careful because any debugging will be hell.
>>
Netbeans
Just got mysys2 working
Thanks to this /g/uy
>>58572025


Trying to get the sample SFML program working
Get this "error":
http://pastebin.com/itAMsfEx
I can't understand what the fuck that means
What does it mean?
>>
>>58572639
What kind of software do you write? Because the few times I had to do it I always found it excruciatingly soul-sucking.
>>
>>58572639
Qt is really good but understanding c++ at the requisite level to make use of it is a struggle all in itself.
God bless Nokia.
>>
>>58572665
did you know nokia owns bell labs now? we own unix now, yeah finland we taking over.
>>
>http://zguide.zeromq.org/page:all

Check out all this hype
>>
>>58572655
It's a software package for monitoring online mass media sites and satellite TV channels.
I was confused for a while by Qt. Prior to that, I was using Borland C++ Builder. Borland had what Qt calls signals for every event, clicks, doubleclicks, mouseover everything. Qt only has some signals for UI elements and for the rest you have to either install even filter or inherit built-in UI object classes (like, for example, to make a label clickable).
I still think that Borland's approach is better, but I'm not confused about Qt anymore and am using it gladly. Even models. Which are an abomination.
>>
Somebody explain
"public static" in "public static void"
also, what if I want my function to return something "public static Integer"?
>>
>>58572706
>public static void
public static function that returns nothing

>public static Integer
public static function that returns Integer

>public static
public static something that you didn't finish writing
>>
>>58572697
linux torvalds did a good talk why and how qt is really good (for his dumb scuba diving app), you can probably look it up on youtube.
>>
>>58572716
It was some other dude that did the talking. And that dude did most of the porting too. I've seen it.
>>
>>58572706
Public means that the function will be available to everybody.
Static means that the method belongs to the Class, not to the Objects.
>>
>>58572723
yeah guess my memory failed me that time. it was good though!
>>
>>58572733
or in non-faggot C++ words, it means there is only once copy of it. Static as in statically allocated, as in it will live for the life of the program, even if it goes out of scope.
>>
>>58572746
finally, something that makes sense
>>
>>58572746
That's Java, not C++.
>>
>>58572764
It goes into the .data section (unless its zero and goes into .bss). That is exactly what I described.
>>
>>58572746
understanding ``static`` and ``extern`` requires a knowledge of how the linker works, which sadly is a niche subject in most all computer science curriculums, even though it is a one of the most significant parts of how software works.
there exists just a couple of books on it which i highly recommended anyone to read if they work with native languages, even before any assembly/compilers/os courses or at the very least in tandem
>>
>>58572783
The original question was about Java, your answer is about C++.
>>
>>58572791
oh, so just look up the java virtual machine abi. theres only just one right, should not be a bother
>>
>>58572801
I'm not the one who asked the question anyway.
>>
>>58572808
well i'm not the guy who gave the op a hard time either
>>
>>58572791
Oh, sorry. I read your comment backwards then.

Well, yeah, that's true but the semantics are basically the same (although they don't technically last the entire program in java)
>>
>>58572784
>there exists just a couple of books on it which i highly recommended anyone to read if they work with native languages

And those would be?
>>
>>58572746
Not him but that also means that if a member object is static, it's essentially shared between all instances of that class? What about child classes?
>>
>>58572826
Child classes also share the same single object. You can test it quite easily, which is what you should be doing instead of asking.
>>
>>58572817
Linkers and Loaders by Levine, Advanced C and C++ Compiling by Stevanovic. first one is more of a historical overview, while the latter is a practical guide. There are other books, specifically on the x86[-64] Linux/System V ABI but these are the only two I've been able to find that deal with the subject in a general manner.
I apologize for not mentioning them, I'm drunkposting :^)
>>
>>58572838
int googleYourShit =Integer.parseInt(args[number])
>>
>>58567749
> read the code
It's like a C-programmer was given C++, but he still does it the C-way. Because of people like you there are so many C++-haters.
>>
>>58572855
I would but not really in the position to. Don't ask why but was just browsing the thread before work.
>>
>>58572694
It starts talking about how magical and amazing it is, then then says that there's no easy solution to waiting until all workers are ready in the PUSH - PULL example. That's one of most common things and this library that's supposed to make my life easier wants me to have hard time doing it.
>>
New thread:
>>58572928
>>
>>58572892
You can't discount C but with C++ niceties as a "wrong" or "bad" style of programming.
Due to the failures of the C ecosystem, it has become a necessity for many major previously C projects to adapt a C++ subset to manage their complexity.
It's a completely legit, and successful, use of the C++ language and the highest levels of standards committees acknowledge that,
>>
>>58572856
>linkers and loaders

I was expecting that one :)

>There are other books, specifically on the x86[-64] Linux/System V ABI

I would really like recommendations for that.

>I'm drunkposting :^)
https://www.youtube.com/watch?v=70I2JcZHn6c
>>
>>58572943
>Due to the failures of the C ecosystem, it has become a necessity for many major previously C projects to adapt a C++ subset to manage their complexity.
You're full of shit.
>>
>>58572979
+1
>>
>>58572070
Isn't VS community free these days? You can go download it and use it for whatever until you're making like $1,000,000+ in revenue.
>>
>>58572947
>linking
>abi

Seconded, I love that stuff and would lobebto learn more

link to PDFs plz
>>
>>58572892
Nothing there is really bad or wrong
>iterating over a vector
Doesn't matter, more readable personally
>using basic pointers and nothing fancy
Allocation and destruction is handled at another level
>PTR_DATA and PTR_ID_FAST macros
This is actually pretty important. All of those type of functions pass two parameters, an ID and a type. The type is put into the function to prevent overflow and underflow errors, and is also used (via C-style casts) to automatically cast to the type.

That aside, I don't see anything wrong
>>
>>58572015
An enum is a proper type in many languages actually.

So in say, Java, you have a month enum at java.time.Month.

So if I do:
boolean isLeapYear = false;
Month month = Month.APRIL;


I can ask it questions. Like, how many days does this month have? What day of the year corresponds to the first day of this month?
month.length(isLeapYear);
month.firstDayOfYear(isLeapYear);


The alternative to this would be to have functions hanging around in the Month namespace and that would look fucking ugly:
Month.firstDayOfYear(month, isLeapYear);
Month.length(month, isLeapYear);

I mean, we're not writing C for dullards here are we?
>>
Programming noob here, what do you /g/ents prefer a noob uses when learning the basics of a language, terminal or IDE. Thanks.
>>
File: 1480130831274.jpg (127KB, 392x481px) Image search: [Google]
1480130831274.jpg
127KB, 392x481px
>>58567749
i3. My nigga
Thread posts: 324
Thread images: 24


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