[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: 436
Thread images: 37

File: Smalltalk.jpg (47KB, 409x500px) Image search: [Google]
Smalltalk.jpg
47KB, 409x500px
What are you working on, /g/?

Previous thread: >>61732327
>>
File: golang.png (124KB, 600x600px) Image search: [Google]
golang.png
124KB, 600x600px
>>61738037
First for Go.
>>
File: 1492831891533.png (341KB, 556x561px) Image search: [Google]
1492831891533.png
341KB, 556x561px
>>61738037
>No anime image
>Posts POO instead
>>
>>61738049
nth for go needs to go
>>
>>61738049
reminder that go could have unironically been a good language but it was made intentionally shit

>dude what if we stapled the shittiest parts of java onto C
>>
>need to learn python for a class
>found this out yesterday
>prof said there'd be tutorials for those that haven't used it before
>Be sure to go through the tutorials on this link
>click on link on assignment page
>http://www.scipy-lectures.org/intro/

how much of this do you think I can skip if I already know C++ and some scheme
>>
>>61738068
The fact that OOP haters are the same people who love animu tells a lot.
>>
>>61738130
/dpt/ doesn't like skippers
read the lectures lad
>>
File: image.jpg (573KB, 971x1200px) Image search: [Google]
image.jpg
573KB, 971x1200px
I read somewhere that I can choose any programming language as long as I wanted to program, and as I knew that I already had an Python interpreter installed on my Linux system, I chose Python and I am currently learning the basics. My question is that should I read a couple dozen books on Python and master this language over the years or should I learn a couple more programming languages such as C, Java, C++, Golang and Rust?
>>
>>61738167
hahaha look at this faggot thinking /dpt/ is a person or some shit
hahaha what a queer
>>
File: 1409552551622.png (17KB, 429x397px) Image search: [Google]
1409552551622.png
17KB, 429x397px
>>61738130
r u me?
>Getting an estimate on how much I'm going to need to pay in books for the coming semester
>Remember the last time I took Data Structures (I failed), someone in class asked the professor if we could submit our homework in Python
>Everyone in class laughed, including the professor
>Required Texts for upcoming Data Structures: "Solving Problems with Algorithms in Python" and "Data Structures and Algorithms with Python"

When jokes become reality.
>>
File: 1501743893143.jpg (35KB, 400x400px) Image search: [Google]
1501743893143.jpg
35KB, 400x400px
>>61738049
>>
>>61738210
stop learning python and learn a proper language. you don't have to completely master a language before moving on to another language because most basic programming skills will carry over to other languages.
>>
>>61738210

what are you planning to do?

java, c# , golang, python are good for a variety of things

you definitely cant go wrong with java or c#
>>
>>61738037
working on an anime script that'll churn out optimized lewds
>>
>>61738210
First of all, I think you need to ask yourself what you want out of learning how to program. Secondly, if you were considering learning a different language at some point, focus on the language you've decided to pick up until you have a clear understanding of the basics (basic data types, flow control, loops, how functions work, and recursion). All programming languages are pretty fucking similar, the main difference being how the syntax is laid out. If you know the basics of programming, switching to a different language won't feel like shit. You'll just have to get used to the new syntax.

If you feel like what you want out of programming is Python focused, sure, go ahead and attempt to master it. If you think your interests in programming will lead you into another language, like for a certain job you looked up and would like, then after you learn the basics, consider learning that one. For example, I'm interested in graphics programming, and most graphics programming jobs use C++, so I've been making a point to learn it.
>>
>>61738210
when you feel comfortable with moving on learn C with K&R and scheme with SICP
even if you never use either of those languages ever again, you'll have learned alot
>>
>>61738130
Python is one of the easiest programming languages in existence, but you should still read up on it and do some basic exercises so you don't trip on any language quirks.

>>61738210
C is always the ideal choice for learning. Even if you don't need it practically, it gives you an idea of how programs work underneath the layers of abstraction in very high level tools. Aside from OO computers-are-magic idioms, at least.
>>
I just realized this general doesn't have a pasta
is it because it's a particularly old general and the OP is kept clean out of tradition, or did no one ever feel like making one
>>
File: 1501781157636.gif (29KB, 430x650px) Image search: [Google]
1501781157636.gif
29KB, 430x650px
>>61738381
>Python OOP requires you to right 'self' everywhere
I hate it, I hate it, I hate it, I hate it
>>
>>61738402
it's because it doesn't need one. the topics discussed here are so broad no pasta would help cover them. this isn't a learn programming thread either, it's just one of the many things discussed here
>>
File: 000061-Twitch.png (48KB, 126x146px) Image search: [Google]
000061-Twitch.png
48KB, 126x146px
theres a literal patel joining my team next week
what can i do to prepare?
>>
>>61738037
Hashing functions.
>>
>>61738381
I'm not gonna just be learning basic python+standard libraries. they need us to know python for numpy, scipy, and matplotlib. that's where the time sink emerges, learning three (to my knowledge) large and sprawling libraries
>>
>>61738420
OOP is inherently horrible, so I don't blame them for not bothering to polish a turd. Python works just fine without OO.
>>
hOw 2 maek turtel drAw fASteR!!??!?

from turtle import *
import PIL
from PIL import Image

image = PIL.Image.open("C:\\Users\\Admin\\Desktop\\c4a.jpg")
image = image.convert('RGB')


# sets up turtle window
setup(width=(image.size[0] + 50), height=(image.size[1] + 50)) # using image width to initialise window
title('Draw Image')
bgcolor('black')
colormode(255) # sets to RGB 255


# sets variables
totalPixels = image.size[0] * image.size[1]

# sets up turtle at upper left corner
speed('fastest')
penup()
goto(-1 * image.size[0] / 2, image.size[1] / 2)


pixels = list(image.getdata())

horCounter = 0
verCounter = 0
pixCounter =
pendown()
setheading(0)
hideturtle()
tracer(2000)

while verCounter < image.size[1]:
while horCounter < image.size[0]:
pencolor(pixels[pixCounter])
dot(1)
forward(1)
horCounter += 1
pixCounter += 1
verCounter += 1
horCounter = 0
penup()
goto(-1 * image.size[0] / 2, image.size[1] / 2 - verCounter)
pendown()
>>
>>61738423
if nothing else a link to the online copy of the SICP would make sense seeing how much it's a meme around here
>>
>>61738451
>Python
>without OO
literally everything in Python, including functions, is an object with methods and attributes
>>
>>61738438
reddit tier
>>
>>61738480
?
>>
>>61738439
Do you need to know the libraries before class fully starts or just Python? If the latter, you will likely be able to pick it up as you go.

>>61738477
In an idiomatic sense.
>>
>>61738515
>Do you need to know the libraries before class fully starts or just Python?
yes, and I have until Thursday
>>
What are some ways I can profile my applications memory and cpu usage outside of an IDE like Visual Studio?
>>
boys i need help

where can i learn c#

i tried to learn many "easy" languages before but felt that whatever tutorials i tried did not help me to understand any of the abstractions behind the language itself

what the fuck is all those brackets, man?
>>
>>>61736060
First code box is wrong because you could be doing free(NULL).
Rest seems alright but if you don't copypaste everything into your main, you are going to have a spaghetti of errors dispersed along different functions. A million if checks everywhere. Say fn2 can return -1, -2, -3, -4, depending on where it failed, and fn1, which uses fn2, can return -1, -2, -3, -4, and then -5, -6, -7 which are other places of failure.
With throw/catch you just put a try in the main, and you catch whatever gets tossed up from anywhere, with allows you to debug with ease.
>>
>>61738646
intel has a bunch of tools for that sort of thing if you're willing to pay some shekels

I guess you could just watch it under htop and see
>>
thoughts on nulang?

https://github.com/nulang/nu
>>
>>61738740
contributors look like nu-males
>>
>>61738210
Drop Python immediately. Read book in your pic.
>>
>>61738740
>doesn't implement any standardized lisp
I bet it doesn't even support reader macros, and at that point you can't even call it a lisp.
>>
>>61738402
*-edition threads are the best threads.
See: /brit/
>>
>>61738740
>reinventing lisp for webtards

use common lisp or clojure if you have a brain
>>
>>61738740
>Obj-C runtime
Dropped harder than trump's approval ratings
>>
File: Tetris.jpg (140KB, 1366x768px) Image search: [Google]
Tetris.jpg
140KB, 1366x768px
I've been lazily working on implementing Learntris in OCaml. I'm a full time C++ programmer and a long-time hobbyist Lisper, but I heard that OCaml was pretty neat.
>>
File: 1501743580657.jpg (31KB, 400x400px) Image search: [Google]
1501743580657.jpg
31KB, 400x400px
>>61738956
I'm a simple man
I see OCaml
I laugh
>>
>>61738966
How many of these do you have?
>>
Fuck StackOverflow anyway
>>
>>61739136
>Going to Cuckoverflow
>Current era
>>
File: 1463363949111.jpg (36KB, 511x509px) Image search: [Google]
1463363949111.jpg
36KB, 511x509px
Employed Haskell programmer reporting in
>>
>>61739172
>implying employed as haskell programmer
>>
File: 1470792067398.png (36KB, 268x237px) Image search: [Google]
1470792067398.png
36KB, 268x237px
>>61739208
>>
>>61739136

Since SO isn't being very helpful, I'll see if I can explain the problem...

In C++, where the auto keyword is not used for a function parameter, it means "use the default type of whatever is on the right of this expression". Any list of elements between braces is of type std::initializer_list. Though there is an automatic conversion from an initializer_list to an array, this is only done when the typename is explicit. Since arr is an initializer_list, there isn't a [] operator defined on it. Really, check the documentation:

http://en.cppreference.com/w/cpp/utility/initializer_list

Now print_array and sort are just template functions under some nice syntactic sugar (that's how auto as a parameter works). When you pass in arr, it tries to substitute the type of auto for std::initializer_list<int>, and then runs into trouble when trying to call the [] operator.

The solution is to explicitly declare arr as an std::array<int, 6> or std::vector<int>, since you need both a size() method and operator [] method.

Also, your sort method looks wrong. Step through it and see what happens when you pass it an already sorted list.
>>
>>61739364
>your sort method looks wrong.
same sorting algorithm
https://stackoverflow.com/questions/4108313/how-do-i-find-the-length-of-an-array
>>
Hey, back again still trying to solve this seemingly simple problem with extrememely limited programming skills. To recap.
On Ubuntu
Have a text file, animals.txt that contains:
rat
dog
dog
rat
rat
dog
cat
cat


the bash script someone wrote, which should take every unique item, and list them next to the percentage of total items they appear, also, (and not in this code) I'd like what that % is of a number that can be stored in a variable.
So took me a while to realise "sh calc.sh" didnt work so ran "bash calc.sh"

this is the code:
#!/bin/bash
total=$(wc -l < animals.txt)
words=$(sort --unique < animals.txt)

for word in $words; do
count=$(cat list | grep -F "$word" | wc -l)
percent=$(bc <<< "scale=2; $count / $total;" | cut -d. -f2)
echo "$word $percent%"
done


and this is the error:
bash calc.sh
cat: list: No such file or directory
cat 0%
cat: list: No such file or directory
dog 0%
cat: list: No such file or directory
rat 0%


so obviously some of it is working but I really have no idea what that error means? all the files or directories referenced are being called?
>>
>>61739398
>>61739364

oh wait I see your point
>>
>>61739404
Graduate from bash
>>
>>61739404
Read the damn messages.
>cat: list: No such file or directory
"list" does not exist.
>>
>>61738438
What esoteric programming language is this?
>>
What is a program?
>>
>>61739551
A magic spell used to make the computer do something.
>>
>>61739551
Like bags full of sand.
>>
>>61739459
ok, the fact it's called "list" makes it pretty hard to know what to do, as a complete noob that I admit I am.
>>
File: patrick.jpg (16KB, 320x320px) Image search: [Google]
patrick.jpg
16KB, 320x320px
Why is SICP so fucking god-tier? I have had so much fun tackling each of the exercises so far since they can be challenging but ultimately simple once you approach the problem correctly, and I have so far learned so many things my shitty college refused to teach me, and this is all only by chapter 1 so far. This book is like a treasure.
>>
File: retards_actually_fall_for_it.png (513KB, 1064x1401px) Image search: [Google]
retards_actually_fall_for_it.png
513KB, 1064x1401px
>>61739623
And yet it has 0 relevance in the real world.

You've literally fallen for /g/'s feminine penis.
>>
>>61739593
Don't use magic numbers in your code.
Eg store it in a variable (here, file) and then use it.
list was probably the original name, but you renamed it or something.
#!/bin/bash
file=$1
total=$(wc -l < $file)
words=$(sort --unique < $file)

for word in $words; do
count=$(cat $file | grep -c "$word")
percent=$(bc <<< "scale=2; $count / $total;" | cut -d. -f2)
echo "$word $percent%"
done
>>
>>61739656
kek
>>
Anyone know why this matlab block of code isn't working?

num_files = 4

file_arr = zeros(1, num_files)
for ind = 1:num_files
str = strcat(folder_path_str, 'Image', int2str(ind), '_Temperature.csv')
file_arr(ind) = str
end

>>
>>61739709
Thank you so much
>>
nothing, what should i work on
>>
>>61739868
an SDL2 library for Rust that isn't complete ass
post here when you're done (hopefully in less than an hour) because I need one for a project I'm working on and don't give enough of a fuck to write it myself when I can just abandon the project and do something else.
>>
>>61739967
You could write your project in C. Come back home prodigal anon.
>>
>>61739967
You want a port in Rust? Why?
>>
>>61739985
but i've already done that a hundred times anon. I wanted to try something new. But community support in rust is pretty bad...

>>61739989
To interface with rust code. I just need a wrapper really.
>>
(((structs)))
>>
The C# Expando Object lets me create members at run time. Is there a way to import these members into the current namespace without the instance identifier?
>>
>>61738037
Will book in OP image help me to be more confident in social situations?
>>
>>61738037
>working
>after hours

yeah nah how about I shitpost instead.
>>
File: this_is_fine.jpg (198KB, 1572x800px) Image search: [Google]
this_is_fine.jpg
198KB, 1572x800px
I'm learning Go right now and it is super /comfy/. I have the flexibility of a scripting language with the speed of a compiled one. No bloat too! Why don't you program in the super /comfy/ Go?
>>
Enough with the language discussions.
What this thread should really be about is how we raise consumer expectations so they start demanding good software so pajeet and women(female) can't take over this field.

Software in general sucks ass right now. It's slow, buggy, insecure and lacking in functionality. It should be better. I don't think it's developers faults but rather the work environment that demands crappy solutions because the end-user doesn't care. So we need to manufacture demand.
>>
>>61740250
See >>61738302
>>
>>61740281
>Software in general sucks ass right now.
>raise consumer expectations
The consumers don't care. The consumers can never care. Bad software is the fault of the programmer's delusions.
>It should be better.
make it so
>>
File: 1453692436331.jpg (34KB, 400x264px) Image search: [Google]
1453692436331.jpg
34KB, 400x264px
>>61738037
>2018 - 1/3
>not writing everything in Lua + C
>>
>>61740401
>using lua
>ever
>>
File: mbdd.jpg (188KB, 500x499px) Image search: [Google]
mbdd.jpg
188KB, 500x499px
how do i into embeddeds
>>
>>61740368
First step is to stop using shitlangs that don't help you catch mistakes
>>
>>61740454
MUH TYPS

GUYS, GUYS TYPES

TTYYPPEESS

DUDE TYPES LMAO
>>
So in my C program i use djb2 hash function, but the function itself, as most other hash functions do, doesn't account for collisions, so i guess that's left to the developer. I'm using an array, so i think i will need to implement some sort of linear/quadratic probing or even double hashing. What's the fastest, simplest and most portable way of solving collisions?
>>
>>61740461
you upset?
>>
>>61740461
exactly
>>
>>61740468
Create buckets instead.
>>
>client insists that we target the JVM
Why the fuck do they care what a standalone system runs on?
>>
>>61739656
Lies, he can post on HN bragging how awesome it is.
>>
>>61740496
they reverse engineer the java bytecode easier.
>>
>>61740512
Like it will even help them, you have to write truly awful Java code to get good performance out of it.
>>
File: 1416195406948.png (37KB, 567x703px) Image search: [Google]
1416195406948.png
37KB, 567x703px
DUDE TYPES LMAO
>>
in java how come you can alter arrays from within other methods, but you cant alter ints

for example

 
public static void combine(ArrayList<Integer> listOne, ArrayList<Integer> listTwo){


listOne.addAll(listTwo);
}


would actually alter whatever array listOne was in the method it was called in, but if you did that with ints like below it wouldnt


public static void main(String[] args) {
int number = 1;
addThree(number);
System.out.println(number);
}

public static addThree(int number) {
number = number + 3;
}


>>
>>61740599

it doesn't seem you're returning the number in the addthree function. Or am I misunderstanding how java works?
>>
>>61740468
I forgot to mention, i'm hashing ASCII strings and my array is 1024 elements long. How should i adapt djb2's outcome (unsigned long) to my needs? Modulo? Last/first 10 bits?

>>61740488
Sorry, but i must use closed hashing
>>
>>61740627
i'm not returning it, which is what im getting at

if you put an arraylist in your parameter you can fuck with that arraylist and itll actually be still fucked with if you check it out after calling the method. if you do the same with an int like in the addThree method, it doesnt affect the parameter that you inserted outside of that method
>>
>>61740368
>make it so
I can't write all software.
>>
>>61740655
perhaps because its a simple type, so it doesn't know how to track the instance.
>>
>>61740655
is there a java equivalent of c++ ref?
>>
>>61740401
>Lua
Skid shits fuck off
>>
>>61740768
Java is strictly allergic to pointers
>>
>>61740768
Yes. It's called every variable except for primitives.
>>
>>61740599
https://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value
The reason you can't do number=number+3 and have it affect the parameter in the function call is because the integer is a primitive and the arraylist isn't.

Languages take different attitudes to this. In C everything is pass by value and you explicitly state when you need a reference always (you take a pointer). Javas way of doing this is fairly common.
I don't know how you could make an argument a reference explicitly in Java but I'm fairly certain you could.
>>
>>61740796
Ah. Actually reading that turns out I don't know Java well enough, it doesn't agree with my post. But I'm sure they're right.
>>
>>61739364
God C++ is a fucking mess. I'd even claim I have an above average grasp of the language but this is so fucking complicated and layered and subtle
>>
File: c++ in a nutshell.png (72KB, 1016x98px) Image search: [Google]
c++ in a nutshell.png
72KB, 1016x98px
>>61740939
>>
>>61740281
Not gonna happen buddy. Not until the webapp bubble finally bursts and people realize where their priorities really lie.
>>
File: 1500593433271.jpg (57KB, 381x499px) Image search: [Google]
1500593433271.jpg
57KB, 381x499px
Would it be a sin to recompile TempleOS for ARM and stick it on my phone, or would it be God's will to help sanctify the mobile industry?
>>
>>61740956
kek
>>
>>61740976
is it fully open source? I thought only the run-time applications were JIT compiled from source source, with the compiler and kernel pre-compiled by necessity
>>
>>61740599
The way to think about all variables, even integers in languages like Java and even Lisp is that everything is a pointer.

int i = 1;

In the wonderful world of Java is not creating a 32 bit region of memory and setting it to one. That's how your computer works, that's how the JVM works. That's not how Javaland works. No, i = 1; creating a pointer to the platonic ideal of "oneness."

When you do
i = i + 1;

You're dereferencing i and replacing it with 1, then replacing 1+1 with 2, as 1+1 ~maps~ to 2.

You can muck with arrays because you're actually changing them. You can't change numbers, true, false, or characters. These things are permanent and immutable. You can change which ones variables point to though.

https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.html#%_sec_3.3.1
Look at the pictures in here. The boxes are arrays of 2 elements, and the arrows are what the contents point to. Numbers aren't IN the arrays (they're in Plato's fantasyland), the arrays point to them.

>>61740796
You can make an argument a fake reference by wrapping it up in a class. Not too hard to make a Reference<T> class.

So the swap two ints meme could be solved with that.
>>
>>61740939
Your claim would be a lie then.
>>
>>61741027
Im pretty sure its open source
>>
>>61738037
creating something pic related
for(i=0 to max)
result = i%divisor
am getting close
>>
how good is "purely functional data structures"
should I read it after SICP and "practical common lisp"?
>>
File: Capture.png (12KB, 237x235px) Image search: [Google]
Capture.png
12KB, 237x235px
>>61741164
im high as fuck
>>
I have my game engine made in C but I want to be plugin based.
So if the engine loads a shared library how can I make sure that segfault caused by the plugin won't crash the whole engine?
>>
>>61741317
Run the plugins in separate processes.
Note that this will make it complicated as fuck.
>>
>>61741178
>purely functional data structures
lmfao
>practical common lisp
hahahahahahah it gets better
>>
>>61741377
>>practical common lisp
Common Lisp is good general purpose programming language.
>>
>>61741401
So is Haskell. You should read The Pragmatic Monad.
>>
File: doggo is asleep.jpg (51KB, 600x600px) Image search: [Google]
doggo is asleep.jpg
51KB, 600x600px
>>61738037
Nothing much really. Just working on a program that puts the time and date into mm/dd/yyyy and hh:mm:ss format. I need to find a way to make it update in real time.

from datetime import datetime
current_time = datetime.now()

print ("%s/%s/%s" % (current_time.month, current_time.day, current_time.year,))
print ("%s-%s-%s" % (current_time.hour, current_time.minute, current_time.second))
#Will print the current date in a mm/dd/yyyy format.

input("\n\nPress enter to exit.")
>>
>>61739520
CUDA
>>
I have written my own threadpool in C. Is there any point in trying to replace it with openMP?
>>
>>61741317
Either >>61741359 or override the signal handler to do a clean exit rather than a hard and dirty one.

I recommend not worrying about it though.
>>
>>61738037
What license should I use if I want to upload some code I don't really care about on places like github which I'd then link to in my resume when applying for a job? MIT? Unlicense?
>>
>>61741543
>current_time.year
>>
>>61741027
>>61741082
it's public domain
>>
>>61741731
[spoiler]:^)[/spoiler]
>>
$ man fopen
man: no entry for fopen in the manual.


This is dumb but how do I get the C standard library manpages
>>
>>61742944
man fopen works for me.
>>
>>61739136
that's a pretty dumb question, it's good you got downvoted.
>>
>>61742944
you might have to install a manpages-dev or similar extra package.
>>
>>61743083
This worked, thanks anon
>>
>>61743083
>manpages-dev
apt is such fucking shitshow holy fucking shit
>>
>>61739551
A miserable pile of instructions
>>
>>61738049
What has Go added since 1.6? I haven't been keeping up. Is there a plan yet for 2.0?
>>
File: 1400951018859.jpg (199KB, 715x614px) Image search: [Google]
1400951018859.jpg
199KB, 715x614px
Some implementations of algorithms like quicksort and binary search will stop the algorithm when two pointers within the array cross one another (e.g. low > hi), while other implementatinos stop the algorithm when (low >= hi).

Is there much difference between these two strategies? Are they interchangeable, or are they each specifically chosen based on the design of the algorithm in question?
>>
>he runs his programs on top of an operating system, the most bloated kind of VM in existence
>he believes he controls anything with his "low level" language
>>
>>61738130
>>61738249
>required:
>Intro to Computers
>Intro to Microsoft Office
Pls.
>>
People are using web browsers for their applications because they don't require installing, but using browsers for that is wrong.
We need to create platform that can / lets user
>browse available applications found from internet
>donwload and execute selected application sandboxed
>manage dependencies
How do we do it?
>>
>>61743341
sounds like you want to create a new web browser
>>
>>61743349
sounds like you are fucking retarded.
>>
>>61743341
>but using browsers for that is wrong.
Why?
>>
>>61743362
because html is not designed for running applications on.
WEB browsers only support javascript even that they do poorly.
Application might not require GUI.
>>
>>61743377
these are very vague criticisms
>>
>>61743377
HTML is just a backbone and is loosely involved in the process of running a webapp.

JS support is fairly standard across all browsers. CSS and HTML have more uncertainty. If you need anything more than JS, you can do server-side processes -- however, this may become inefficient for apps without a cash flow.

>application might not require a GUI
Then you create a terminal for it or make it straight as a desktop app.
>>
>>61743383
There would be no need to use HTTP.
Applications could run multithreaded.
>>
Anyone can point to some good rust introductions if you're already familiar with the basic concepts? (memory, pointers, etc..)
>>
File: 1501414251038.jpg (65KB, 630x721px) Image search: [Google]
1501414251038.jpg
65KB, 630x721px
I have a struct with an int pointer and int in it
typedef struct {
int *numbers;
int size;
} some_data;

I want to fill it with an array literal, so something like
some_data first = {
{1, 2, 3, 4},
4
};

But that doesn't work. What am I doing wrong? Is there something similar that works? I don't want to declare hundreds of intermediary arrays also no heap, only on the stack.
>>
>>61743016
What about stack overflow makes you think it's a place for advanced discussion?
>>
>>61743483
Arrays are not pointers.

This might work with a flexible array member but I never tried such a thing.
>>
>>61739136
Wait. Do people still use Stack Overflow?
>>
If I drop support for KitKat on my Android app, will the reviews from KitKat users go away?
>>
>>61743564
Where else do you get help after you've spent several hours pulling your hair out?

Also, it's fun to laugh at and downvote pajeets
>>
>>61743593
>What are forums
Stack overflow is THE definition of pajeets
>>
>>61743558
How can I make an array literal return a pointer to the stack where it is?
>>
>>61743604
You might not want to do that. Is the array constant size?
>>
>>61743483
What if you change that to:
&{1, 2, 3, 4},
>>
>>61743483
>>61743604
Use a compound literal.
some_data first = {
(int []){1, 2, 3, 4},
4
};

NOTE: that array is only valid for the block it's defined in.
>>
>>61743623
uuuuhhhhh
>>
>>61743628
>(int[]) cast works
>(int*) cast does not work
but why
>>
>>61743272
Stopping at >= would leave the last element untouched unless the end pointer points to one past the end of the array. Using > would work if the end pointer pointed to the last element. Calculating one past or the last element for the end pointer might require one less instruction for a particular end pointer calculation, but obviously there is no difference if the algo is written correctly.
>>
>>61743658
It's not a cast, it's a compound literal.
http://en.cppreference.com/w/c/language/compound_literal
>>
>>61743628
Noice, thank you, that worked.
>>
>>61743016
I'm the guy who asked this question.
What's so dumb about my question?
>>
>>61743670
You learn something new each day. Like how C wasn't as pure and simple as you thought.
>>
>>61743583
huh, I don't know but now I'm curious
>>
>D
>Coq
Why are programmers faggots?
>>
>>61743696
They're good for reducing a bunch of unneeded variables, particularly structs, as they can be written inline.
They are also very useful for certain types of macros.
#define SOME_DATA(a, ...) (some_data){ (int []){ a, __VA_ARGS__ }, sizeof((int []){ a, __VA_ARGS__ })/sizeof(int) }
some_data first = SOME_DATA(1, 2, 3, 4);

>Like how C wasn't as pure and simple as you thought
How are they "impure"?
C actually adds features which makes it nicer to program in, you know.
>>
>>61743775
they aren't, they're just girls
>>
>>61743790
Reusing the same syntax for different purposes is what makes sepples an unreadable mess.
>>
Is this still a good book to read?

https://lwn.net/Kernel/LDD3/
>>
>>61743856
>Reusing the same syntax
They are very closely related to the normal use of the syntax, though.
You have an initialiser list (normally found on a struct or array declaration) { ... }, and then you specify a type for it, just like you're casting it (type){ ... }.
>>
File: file.png (514KB, 726x600px) Image search: [Google]
file.png
514KB, 726x600px
>>
>>61743892
Except it's not a cast, and it breaks if you try to use it as if it were a cast. If you used (int*) it doesn't take a pointer to the array, it uses the first value of the initializer list as the pointer value.
array-pointer """equivalency""" in C is already fucked anyway. I don't know why you'd want to lie in your syntax. You call it convenience but it's just a pitfall.
>>
>>61743932
>raii means you can't use raw pointers
spoken like a true pleb
>>
>>61743948
>Except it's not a cast, and it breaks if you try to use it as if it were a cast. If you used (int*) it doesn't take a pointer to the array, it uses the first value of the initializer list as the pointer value.
An initialiser list is not subject to pointer decay, because it's not actually a type. This doesn't work like normal assignment, because it's fundamentally different.
You really should only be using them for structs/unions/arrays.
>array-pointer """equivalency""" in C is already fucked anyway
This is clearly just you being unable to grasp their relationship properly. Arrays and pointers in C are not the same thing, and people need to realise it.
>>
WHERE THE FUCK IS STDDEF.H WITH MINGW AND WHY CANT INTELLISENSE SHUT ITS LYING WHORE MOUTH
>>
The year is 20XX. The C++ committee kept integrating new features for compile time polymorphism on top of templates into the draft. Because of this, everyone was forced to write 99% of their code in header files. With this, closed source libraries were on the brink of extinction, as well as anyone who lived to see anything beyond hello world finish compiling in C++.
>>
>>61744000
nvm found it
>>
>>61743998
>This is clearly just you being unable to grasp their relationship properly. Arrays and pointers in C are not the same thing, and people need to realise it.
Don't be such a smug cunt. I know they're related and I know they're not the same.
Shit like this
void my_function(int ar[]);

should never have been part of the C language since its syntax is blatantly misleading.
>>
>>61744042
But then I can't have my fancy VLA syntax.
void fn(size_t len, int array[static len]);
>>
>>61744028
*2017
>>
>>61744053
>overloading the keyword static even more than it already is.
If you don't get my point yet, you never will.
>>
>>61744064
>>overloading the keyword static even more than it already is.
It's not worth making a new keyword just for that, but yes, static is used too many times.
>>
>>61738037

Discovering Smalldick
>>
>>61744082
nice
>>
>>61741694
MIT
>>
why is JS so great?
const cookies = {
set: (name, value, days) => {
const date = new Date()
date.setTime(data.getTime() + (days*24*60*60*1000))
const expires = 'expires' + date.toUTCString()
document.cookie = name + '=' + value + '; ' + expires
},
get: () => {
console.log('get')
}
}
>>
File: 52a.gif (1000KB, 500x654px) Image search: [Google]
52a.gif
1000KB, 500x654px
>find the perfect font
>a single fucking letter is broken
how do i fix this?
>>
>>61744220
by editing the glyph

post a screenshot
>>
>the only language to write painlessly native libraries to be used in other language is C.
>C is very limited
Seriously thinking about switching from native libraries to stuff that only runs on JVM.
>>
File: scpBold.jpg (124KB, 1366x768px) Image search: [Google]
scpBold.jpg
124KB, 1366x768px
>>61744234
>>
>>61740461
holy shit expressive type systems utterly BTFOed by extremely incisive and articulate satire and criticism
>>
>>61744273
dumb ocaml poster, enjoy your GIL
>>
>>61744265
what languages let you export functions compatible with C's ABI?
>>
>>61744269
>windows
>VScode
>steam
>casting malloc
>using char** instead of char **


kill thyself
>>
>>61744286
Haskeller and employed
>>
>>61744301
>>casting malloc
Imagine getting upset about something like this
>>
>>61744301
You sound a little mad why dont you sit down and take a break skipper
>implying there's anything wrong with any of that anyway
>>
>>61744296
>what languages let you export functions compatible with C's ABI?
Most of them for example Common Lisp(ecl), Scheme, I assume cython basically any implemenation that compiles to C.
Usually it requires you to export them in the language first and if the languages uses GC you likely need to init it when using the library and close it after done. It's pretty implementation specific.
>>
>>61744318
>Imagine getting upset about something like this
>Violating the DRY principle for literally zero benefit
It really is fucking stupid.
>>
>>61744318
>>61744322
t. plebs
>>
>>61744331
>>Violating the DRY principle for literally zero benefit
So why are you using malloc instead of auto and new?
>>
>>61744353
>Sepples
AHAHAHAHHAHAHHAHAHHAHAHHAHAHAHHAHHAHAHAHHAHHAHAH
>>
>>61744331
>has no impact on speed
>makes everything clearer
>B-but muh dry
im going to dryfuck you fuckboii
>>
>>61744353
>using C++

kek
>>
>>61744375
>>makes everything clearer
How is more useless information cleaner?
>>
>>61744386
When assign a pointer after youve created it and the type isnt immediately apparent?
>>
>>61744374
>>61744385
not an argument
struct Foo foo = malloc(sizeof struct Foo);

>writing the typename twice is fine but thrice is too much
>>
>>61744414
>twice
struct Foo *foo = malloc(sizeof *foo);
>>
>>61744414
foo *f = malloc(sizeof(*f));

dumb streetshitter
>>
>>61744408
When the hell wouldn't the type be clear?
>>
>>61744436
Are you implying that makes it any less redundant?
>>
File: 1501723211856.png (34KB, 1116x732px) Image search: [Google]
1501723211856.png
34KB, 1116x732px
Is there a single decent modern lang? Go is a toy, Python is a less complicated albeit more useful toy, JS is pajeet-tier shit, C++ is just C with a shitton of cancerous tumours, Rust, Ruby etc. are useless hipsterlangs... I feel like C is the only viable lang tbqh
>>
>>61744447
When it isnt?

Why do I deserve to be plagued with this autism when I only want to fix that fucking font
>>
>>61744458
Swift looks decent but does not support all platforms, also Apple.
Chapel looks also decent but it's not really production ready, can't use libraries compiled with it.
>>
>>61744468
>When it isnt?
Give an example which isn't stupidly contrived.
>>
>>61744458
do you see the sun from your basement?
>>
>>61744480
Declare char* input
do stuff()
input = (char*)malloc...

Here input could be a int or whatever as well
>>
>>61744536
>Declare char* input
And look at that: it's super obvious.
Are you incapable of keeping more than a single thing in your head at a time?
>>
>>61744458
D
>>
>>61744551
>modern lang
>auto
>>
>>61744551
AHAHAHAHHAHAHHAHAHAHAHAHHAHHAHAHHHA
>>
>>61738302
Source?
>>
>>61744550
>Do a simple example
>WOOOOW ITS SUPER OBVIOUS
xD
>>
>>61744563
Don't use auto?
>>61744564
What's making you laugh so hard?
>>
>>61744486
Yeah, there's a little porthole by the ceiling
>>
>>61744583
>What's making you laugh so hard?
You posted a really funny joke.
>>
>>61744594
Oh, you replied to the wrong person then.
>>
>>61744601
No, it was definitely the right one.
>>
>>61744583
>Don't use auto?
>not having proper type inference
>>
>>61744614
Type inference is a lie
>>
>>61744617
explain
>>
>>61744623
Why do you need your types inferred?
>>
>>61744629
DRY principle.
>>
>>61744641
Another lie
>>
>>61740794
And then there are people who pass around int[] so they can "have their pointers back".
Because arrays of length 1 is a good idea amirite.

I have never been so frustrated and annoyed as when I saw machine learning code in Java with exactly 1 object that wasn't a string, and everything else being essentially int[] fuckyou(int[] a, int[] b) because readable names are for faggots.

It's like... a bad C programmer or something trying to implement kNN?
>>
>>61744641
>>61744629
>>61744623
>>61744617
>>61744614

why do you faggots complaint about useless things and never making anything useful?

fucking programming circle jerk everyday
>>
>>61744458
Java, C#, SQL, Common Lisp, Scheme, Clojure, Kotlin, Scala...
>>
>>61744654
>why do you faggots complaint about useless things and never making anything useful?
Well next you are going to jump on what's usefull just to continue your shitposting spree.
Currently I'm programming in C, would include scripting language to my program but don't want to limit myself to one shitty scripting language. Too bad there's no GOOD language that can compile shared libraries that export C ABI.
>>
>>61744678
>Java
Dropped
>..
>..
>Scala
Well, dropping was not a bad decision after all
>>
>>61738402
There is a pasta; you newfags just stopped using it. There's an irc server and everything.
>>
>>61744678
>SQL
heheheheeheh
>>
>>61744697
>There's an irc server and everything.
yeah and it's better that you don't advertise it anymore, it's already way too shitty.
>>
>>61744458
You must surrender to C++, it's the only choice. There is no escape.
>>
>>61744701
INSERT INTO your_mom VALUES (dick1, dick2, dick3);
>>
>>61744728
>not escaping your table name with `` incase of MYSQL decides to use it as inbuild symbol name
>uppercasing you SQL commands like a retard
>dick1 does not represent any value, dumb fuck
>>
>>61744725
He said decent language, not a steaming pile of shite
>>
/g/ programmers:
I have this small class written in Java:

package projectname.webpages.seehours;

import lombok.Value;
import spark.TemplateEngine;
import projectname.webpages.ModelFactory;
import projectname.webpages.WebPage;

@Value
public class SeeHours implements WebPage<SeeHoursModel> {
String viewName;
String url;
ModelFactory<SeeHoursModel> modelFactory;
TemplateEngine engine;
}


It basically wraps some boring shit you have to do when you want to render a webpage.
Essentially, you can now do:
new SeeHours("template.ftl", "/test/see-hours", SeeHoursModel::testVal, engine).registerGet();

And it would register a new path (/test/see-hours), using the template.ftl template, rendering it using engine, and using the testVal factory method. (the method does take the web request so it can look at what you're asking for).
(ModelFactory is a functional interface, so you can just throw in a lambda if you want to.)
There's a getter for every field. Every field is private and final. There's an all-args constructor defined, and equals, toString and hashCode are all defined using the fields.

How would you write this small thing in your language and make it as concise?
>>
>>61744725
There is literally no valid reason to use C++.
>>
>>61744747
>not escaping your table name with `` incase of MYSQL decides to use it as inbuild symbol name
in this case your mom would receive more dicks

>uppercasing you SQL commands like a retard
nothing wrong with that you faggot. Bet you don't even know why SQL and FORTRAN are written with upper case letters

>dick1 does not represent any value, dumb fuck
how do you know? i only posted a part of the program
>>
>>61744772
Gainful employment
>>
>>61744790
That's Java you are thinking about
>>
>>61744761
use python Flask (has templates i guess) probably
>>
>>61744790
If employment is your goal, there are much better languages to choose.
>>
>>61744815
Like what?
>>
>>61744907
Malboge with OOP
>>
I'm picking up Clojure again. I haven't heard anything about the Scala position, so I don't want to invest any more time in it.
>>
aaaaaaaahhhhhh
>>
>>61744301
You forgot:

>jpg to show off fonts
>>
>>61743170
I actually had to install "man-pages-devel" because I'm not using apt
>>
>150 IQ (certified)
>Can not figure out how to compile GTK on Windows
>>
>>61745292
I wasnt showing off my font you annoying brainlet lmao
>>
>>61745360
You can't.

Believe me, many tried, some saw some results, but in the end it was for nothing.
>>
>>61745360
But why?
>>
I'm noob, I want to contribute to an opensource project. how do I find project that has easy bugs to fix?
>>
>>61745417
What language do you want to work in?
>>
>>61745402
>GTK website only tells you how to download it not how to compile it
>Literally no up to date tutorial
>try to do it anyway
>nothing werks
>doesnt find libraries
>cant resolve functions
I give up
>>
>>61745417
You don't. Easy to fix bugs get fixed quickly then the only bugs left are some arcane edge case issues that no one has any idea how to debug.
>>
>>61738037
I unironically need that book.
>>
>>61745447
this was my fear. each time i go to github, all issues look like that

>>61745439
Python
>>
>>61745447
Maybe people shouldn't use shitlangs
>>
>>61745486
> Python
Maybe nyaa.si?
>this was my fear. each time i go to github, all issues look like that
It's not just bugfixes, anon. There's always testing, writing documentation, code cleanup and improving performance.
>>
>>61745524
Neat site. Also:

>It's not just bugfixes, anon. There's always testing, writing documentation, code cleanup and improving performance.

Thanks, come to think of it that would be better way to start. A good way to become familiar with the code base!
>>
>>61745510
Yeah, I wish we could finally leave C behind.
>>
>>61745598
I agree, C++ is clearly much better
>>
>>61745598
>>61745642
Cease this faggotry
>>
>>61745642
>C++
He said people shouldn't use shitlangs
>>
If C, Java, and Python are the main languages in my tool belt so far, which would be a great next language to learn or even transition to?
*Either for app or web development*
>>
>>61745682
C++.
>>
Maybe in 2035 C++ niggers will reach D level comfiness
    foreach(string line; lines(stdin))
{
write(line);
}
>>
>>61745682
>great next language
C++

>language for app dev
C#, it's a better Java but that can barely run outside windows

>language for web dev
ClusterScript of course
>>
>>61745688
Is Microsoft Shilling C++ in /g/. Amazing.
>>
>>61745693
Maybe in 2035 D won't have a garbage collector.
>>
>>61745702
>C++
>C#
Fuck off, microshit. And take your garbage language with you
>>
>>61745682
Javascript, obviously. PHP after that if you're still interested in webdev and want to have a somewhat faster server. Right now you could use python + django for the backend and then javascript + whatever framework you want for the front end.
>>
>>61745709
If I am doing GC less programming I'd pick C any day, nigger
>>
>>61745682
If you hate yourself, go for web apps in JavaScript.
>>
>>61745727
This
D comes naturally after C, no C++ freak necessary
>>
>>61745727
>GCless programming without RAII
Why would you do this to yourself?
>>
>>61745702
>>61745688
VOMIT.jpg
>>
>>61745747
I'm can do fine without RAII hand-holding, nigger
>>
>>61745747
>Using C++
Why would you do this to yourself?
>>
>>61745753
Congratulations anon, you're the first person alive who can consistently write leak-free C.
>>
>>61745767
C++ is not going to fix your shitty programming, dumb fucking nigger
>>
>>61745767
Yet another example of C++ brainlets being too dumb for C
>>
>>61745767
There's always valgrind
>>
>>61745784
>>61745773
Only a fool with something to prove does things the hard way for no advantage.
>>
>>61745801
Hence smart people use D
>>
>>61745807
GC is not an advantage.
>>
>>61745801
No one is proving anything, nigger. If C++ were so good maybe I would be using a C++ kernel
>>
>>61745813
Neither is RAII, what are you getting at?
>>
>>61745813
C++ language design itself is a disadvantage
>>
>>61745819
Over raw memory management, it is.
>>
>>61745831
Exactly.
>>
>>61745831
What is a ``raw`` memory management?
>>
Struggling through basic operations in matlab.

Why doesn't the below snippet work?
labels = {'Temperature Map for 0V, x1000 Gain', 
'Temperature Map for 1V, x1000 Gain',
'Temperature Map for -0.5V, x1000 Gain',
'Temperature Map for 1V, x1000 Gain'};
labels{1, 3} %why doesn't this print out the third entry?


Below is the error:
Index exceeds matrix dimensions
>>
RAII does not work
>>
>>61745846

malloc, free.
new, delete.
raw pointers (instead of shared_ptr)

a.k.a
C?
>>
>>61745856
What's ``raw`` about it?
>>
>>61745856
>raw pointers
>>61745831
>raw memory management,
These nu-males killed programming
>>
I love being a C++ programmer, especially in 2017.
>>
>>61745856
>like wooah dude, did you see that guy? He does RAW memory management OMG
>>
>>61745866
>``
i hope you die soon
>>
>tfw you embraced garbage collection
kimochi~
>>
I like being a dumb monkey, especially in 2017
>>
>>61745856
>instead of shared_ptr
Even C++/RAII advocates tell you that shared_ptr is rarely the answer. Stack allocation and unique_ptr is enough for almost all cases.
>>
>>61745767
Writing leak free C isn't difficult, if you manage to lose a few pointers you just have to run it through valgrind to figure out where the problem is. C's problem is security, not memory leaks.
>>
>>61745894
It's hard enough for numale C pee pee koders
>>
>>61745894

C's problem is that you have to write everything by yourself, even primitive things. Hell, it doesn't even have built-in string.

Thus C++ could come in handy if you are lazy faggot
>>
Imagine if there was a 3 character sequence which could trigger all the rustfags and cfags whenever it occurs in a post.
>>
>>61745910
>Thus C++ could come in handy if you are lazy faggot
Or if you have more important things to do than reinvent the wheel.
>>
>>61745767
C++ will not stop memory leaking
>>
>>61745927

This too. That's why im learning C++ right now.

I'm not too far into it yet, but doesn't look THAT bad.
>>
>>61745927
What makes you think C++ does not ``reinvent`` the wheel?
>>
>>61745931
Agreed, but it makes it much easier to prevent.
>>
>>61745941
The only thing that makes it easier to prevent is your skill
>>
>>61745936
>That's why im learning C++ right now.
> doesn't look THAT bad.
Ah, the sweat bubble of newfags
>>
>>61745936
Once you get deep enough you'll see how hellish it become.If you're mindful you will keep that stuff to a minimum and just write simple C-esque code with a sprinkling of templates, STL and RAII.
>>
Can some mod finally ban that `` `` faggot
>>
>>61745940

C++ has some nice features in standard library, not as good as Java or C#, but you don't have to code em from scratch like in C.
>>
>>61745959
sweet*
>>
>>61745926
Imagine if there was a 2 character sequence which could trigger all of /dpt/ whenever it occurs in a post.
>gc
>>
>>61745973
GC languages are fine, but D is a GC lang in denial.
>>
>>61745969
So? Import a library? It's not that hard, koder
>>
>>61745960
>>61745959

Well i'm certainly not planning to spam STL crap in my code all over project. But moderate use of modern C++ features mixed with C looks nice to me. Not that bad.
>>
>>61745973
I hope C++ gets GC soon
>>
>>61745990

There won't be point in using C++ anymore if it gets GC.
>>
>>61745990
Just use D instead
>>
>>61745984
What's so ``modern`` about C++? Can you give an example?
>>61745990
What is this?
http://en.cppreference.com/w/cpp/memory#Garbage_collector_support
>>
>>61746007
There is no point in using C++ now
>>
>>61746017

Why not?
>>
>>61746007
>There won't be point in using C++ anymore
Are you saying there is actually any point of using that shitlang?
>>
>>61746021
See >>61745727
>>
>>61745977
D lacks identity. It wants to be everything.
>>
>>61746055
You mean C++, right?
>>
>>61746055
D wants to be C++ but good, which is a noble cause.

But then it has GC.
>>
>>61746068
Why would you be using C++ if you want performance?
>>
>>61746068
and it doesn't even matter for most people
>>
So are you guys saying that i should stop learning C++ because its absolute shit?

I'm working as C# programmer by the way and i know standard C more or less. Thought learning some C++ would be useful in expanding my programming knowledge and experience.

What the fuck should i learn then?
>>
I am yet to see a C++ ``programmer`` who didn't choose C because he's too dumb for it
>>
>>61746112
http://harmful.cat-v.org/software/c++/
>>
>>61746112
Why would you take /g/'s word for anything?
>>
>>61746112
Stick to C, C++ is corrosive to brain
>>
>>61746127

Because i don't want to waste my time and not entirely sure what to learn now. Thought i'd get some advice here from experienced /g/tards
>>
>>61746087
C++ can be written to be as fast as C. C++ gives you flexibility.
>>
So I have to find the largest amount of anagrams in a dictionary for university. It has to be O(M N).

The dictionary is 80,100 words long, each word is lowercase and on its own line with no symbols.

My first thought was:
Get first word, check it against every other word of same length to see if they contain the same letters, but obviously this is way too slow.

Second thought: convert current word to ascii value, compare it with the ascii value of every other word, but this also won't be O(M N).

Third thought: hash table which converts each word to an ascii value and stores them as their ascii value. Would this be achievable as O(M N)?

I'm way in over my head.
>>
>>61746125
I don't know why you would consider a website that posts a made up story to ridicule a language a credible source.
>>
>>61746112
C++ is made for and by substandard programmers
>C
Designed by educated EE people
>D
Designed by educated CS people (compiler engineers)
>C++
A salty illiterate faggot who piggybacked on C's success and kept hoarding dumb people to enlarge its userbase
>>
>>61746139
C++ is a messy, convoluted and poorly designed language and it's easy to write shit C++.
It is however, useful. /dpt/ will shill deadlangs while the rest of the world does work.
>>
>>61746146
>C++ can be written to be as fast as C.
And you end up with C with classes
>>
>>61746157
Looks pretty credible to me
http://harmful.cat-v.org/software/c++/linus
>>
>>61746159
D was designed by C++ programmers who want C++ to be brainlet-friendly.
>>
Are there any nice, simple tutorials or guidelines for releasing software for Linux?

A couple of days ago I was really struggling with getting my C Linux program to work on different distros. It uses glibc, ncurses, glew and some SDL2 libs. The way I went about building the application was I created a run script like this:
LD_LIBRARY_PATH =. ./application


In the end I got it to run on Debian and Manjaro, the app having been built on Debian. I packed in to the directory all the .so files that I thought would be required by straight out copying them from the Debian machine's lib directory, except for glibc which I assume every machine has. But the application still had some problems, namely that its actually two executables and for some reason, the Debian-built app crashes on Manjaro if they're both ran at the same time on the same desktop, but not if they're run on different desktops or if the app is built on Manjaro.

Could use a resource or some tips.
>>
>>61746176
D was created by people who implemented C++ and they know where C++ fails at
>>
>>61746176
The very purpose of C++ IS being brainlet friendly C
>>
Holy fuck lmao C pee pee pajeets getting BTFO
>>
>>61746183
D's creators can't even decide if they want GC or not.
>>
>>61746202
>D's creators can't even decide if they want GC or not.
They decided to have a GC, hence it does. Did C++ damage your brain?
>>
>>61746202
D doesn't do mental gymnastics like trying to replace C and fail
>>
>>61746199
This happens every day
>>
Ok guys you conviced me to stop becoming C++ pajeet.

I better re-read K&R now and try to write some C project, haven't done much for a while and became C# Pajeet on work
>>
>>61746214
C++ has done a better job of replacing C than D has done of replacing C++.
>>
>>61746225
>C++ has done a better job of replacing C
C++ didn't replace C at all
>>
Can you autismo's stop comparing C, C++ and D for one second and help me with >>61746155.

You fags literally spend more time crying about these three languages than you've ever spent programming. I actually believe none of you cunts can actually program for shit. You just want to bring the AMD vs Nvidia fan boy garbage to programming threads.
>>
>>61746220
at* work
>>
>>61746231
Still accomplished far more than D.
>>
>>61746270
What part of ``at all`` is too hard for a C++ brainlet to fathom?
>>
>>61746241
>I actually believe none of you cunts can actually program for shit
you should've came to this conclusion 10 minutes after first visiting /g/
>>
>>61746265

Yeah, thanks for fixing. I mostly do ASP.NET MVC website programming and its so boring i'm almost ready to give up.

All i do is CRUD, requests to database and shit. Fuck web programming.

Pajeets at my work think they are doing (((real))) programming, lol. They don't even know C# properly desu. Even in C# you can code something interesting but they are only doing sites sites sites
>>
>>61746279
Then you're simply wrong. C++ was and is modestly popular. D is dead and only shilled by jobless wishful-thinkers.
>>
>Finally got gtk running
I AM BECOME GOD
>>
File: 1491081808903.jpg (56KB, 945x482px) Image search: [Google]
1491081808903.jpg
56KB, 945x482px
>>61746299
At which point in timeline did C++ ``replace`` C?
>>
>>61746321
>>61746231
>>61746159

https://en.wikipedia.org/wiki/Comparison_of_deep_learning_software
>>
D has a retarded OOP implementation. No reference invariant despite single inheritance, multiple subtyping.
>>
>>61746355
What is that link supposed to establish?
>>
>>61746321
From inception C++'s use cases overlapped with C. That's not to say C++ replaced C entirely (or even
), but it certainly did not fail to replace C at all.
>>
>>61746359
C++ is retarded top to bottom. It doesn't even pass as a tolerable or decent language
>>
>>61746359
>reference invariant
wat?
>>
>>61746368
>From inception C++'s use cases overlapped with C.
Overlapping is not ``replacing``
>>
>>61746393
If a newer language is being used where an older language once was, how is that not replacement?
>>
>>61746414
Right. When C was created by K&R and used in Unix, Linux and other OS variants it has been there, even now. Because everyone knows C++ is a fragile glass tower. C++ is not used where C was meant to be used
>>
any of you bitches watch Jonathan Blow's videos?
>>
>>61746414
Linux is C
>>
>>61746414
C is actually used by real EE people and kernel programmers. C++ is a joke
>>
>>61746414

C++ is not used where C is used though. And its mostly C with classes even in game development where C++ is most used
>>
C++ is arguably worse than Java.
>>
>>61746470
>C++ doesn't count if I don't like how it's written
You're pathetic
>>
>>61746489
C with classes is pretty much admitting that C++ is a mistake and the oh-so-hyped ``modern`` C++ is nothing but a fad that keeps repeating every 3 years
>>
>>61746383
Object references don't change value when cast. D is not reference invariant, and the only reason is because it is a blind copy of the C++ model.
>>
>>61746523
>Object references don't change value when cast.
Are you sure about that?
>>
>>61746437
sometimes.

jai is going to be great
>>
>>61746519
C with classes is what C++ was born as, you historically illiterate moron.
>>
>>61746534
In like 25 years
>>
>>61746531
References change in D when cast to an interface.
I would post code to prove but it seems blocked apparently.
>>
File: consider.jpg (29KB, 600x600px) Image search: [Google]
consider.jpg
29KB, 600x600px
new thread
>>61746548
>>
>>61746523
Maybe I'm a brainlet but I don't immediately see how interfaces would work without such a thing.
>>
>>61746561
Because breaking the ref invariant is how C++ implements objects as a combination of subobjects. Not necessary in single inheritance because there is only one object containing data.
>>
>>61745693
Just code your own comfiness nigga.

class stream_lines {
istream &stream;
public:
struct line : public string {
friend istream &operator>>(istream &is, line &line) {
return getline(is, line);
}
};
stream_line(istream &_stream) : stream(_stream){}
istream_iterator<line> begin() {
return istream_iterator<line>(stream);
}

istream_iterator<line> end() {
return istream_iterator<line>();
}
};

int main(int argc, char *argv[]) {
for(string str : stream_lines(cin))
cout << str << endl;
return 0;
}
>>
>>61746587
So this.. is the power of c pee pee
>>
>>61746241
>>61746155
what about you sort each word and group them by that value then take the key with most words?
e.g. in ruby
words.group_by{ |word| word.sort }.max_by{ |key, words| words.size }
>>
>>61746587
Haha, so much for ``nice std libraries`` that are supposed to make life easier
>>
>>61743341
I'll understand the choice as long as we don't have a decent GUI solution.
>>
>418
fuck
>>
>>61746793
It's another C++ pajeets getting schooled episode
>>
>>61746809
Keep telling yourself that
>>
File: 1497305697332.png (40KB, 1620x774px) Image search: [Google]
1497305697332.png
40KB, 1620x774px
>>61746823
Are you a little hurt in the butt?
>>
>>61746857
Given your love of the D, I'd rather expect you are.
>>
Is it stupid to learn web development or coding for wanting to make money out of it? Could I freelance? Without a diploma? .
>>
>>61746926
You definitely could. Freelancing is monumentously dumb in general, but if you wanna do it, you came to the right field. Same for trying to find work without a degree.
>>
>>61746155
For each word:
Sort the character in the string.
Look up that value in a hash table, and get a list there. Add the word to that list.

After that, get the longest list.
>>
>>61744761

Dude, nobody is going to reply to your post, because nobody actually knows how to write software.
>>
>>61743434
https://rustbyexample.com/
>>
How do I round a number down to 8 decimal places in Python? Without using string arithmetic, of course.

For instance, I'd want to round 0.08603373518 to 0.08603373
>>
>>61747549
multiply by 100000000
floor
divide by 100000000
>>
>>61747602
Jesus Christ, I'm dumb. Did you learn to think that way by taking a CS course, or did the idea just come to you abstractly? I would have never thought to do that.

Thanks.
>>
>>61738210
First: no need to focus on **one** language to master -- you can dabble in a number of popular languages (popular for a reason I might add) because the things you are trying to accomplish and learn by exercise in Jave, you can most likely accomplish in C++, etc.

Pick one because it interests you, practice, read, practice some more and then attempt to apply those same things you've previously touched on in a brand new language.

I would suggest to learn basics of OOP and design patterns in Java if I was starting over again.
>>
>>61746642
It's actually impressive how C++'s standard library manages to both bloated and insufficient at the same time
>>
>>61748046
Every standard library will be insufficient. Question is more about how easily you could express yourself in the language to supplement it.
That's hard in C++ and easy in most languages.
>>
>>61748116
One reason I don't really like OOP is that when you design an object's public interface, that basically becomes set in stone, and you can't reasonably extend it if you think the interface is insufficient. If its bad enough, you end up with a ton of non-method functions, which sort of defeats the point of OOP. I suppose C# remedies that with extension methods. Rust solves this well with traits.
>>
>>61748428
On second thought its probably only really a problem with C++ and Java OOP. Its subvertible with Self because you can modify prototypes. It shouldnt be a problem with Common Lisp since you can declare new methods just like functions.
Thread posts: 436
Thread images: 37


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