[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: 1568102515056.jpg (758 KB, 1000x1000)
758 KB
758 KB JPG
Old thread: >>72697152

What are you working on, /g/?
>>
File: 1568242520676.png (177 KB, 1822x1232)
177 KB
177 KB PNG
>>
>>72702597
:- func verse(animal) = string.
verse(horse) = "She's dead, of course!".
verse(donkey) = "It was rather wonky. To swallow a donkey.".
verse(cow) = "I don't know how. To swallow a cow.".
verse(goat) = "She just opened her throat. To swallow a goat.".
verse(pig) = "Her mouth was so big. To swallow a pig.".
verse(dog) = "What a hog. To swallow a dog.".
verse(cat) = "Fancy that. To swallow a cat.".
verse(bird) = "Quite absurd. To swallow a bird.".
verse(spider) = "That wriggled and jiggled and tickled inside her.".
verse(fly) = "I don't know why she swallowed the fly.".

working on some real important shit right now
>>
>>72702613

Oh my god.....

Thats awful
>>
>>72702616
neat!
>>
A way to use c likebyou would go. If you have any linker needs just include the corresponding header and put it in the regex string in the strip near the top.
c mk "file.c" builds the file and others included after a comment //cfiles:
You can build a directory with c build [optional a different dir from cwd]

Change compiler with c -c [compilername] build/mk

https://rocketgit.com/user/spicylord/clutils/source/tree/branch/master/blob/c
>>
>>72702669
By regex strip I mean the variable in the script called "translate"
>>
>>72702669
>doesn't wrap to 80/120 lines the stdgone variable
dude
>>
I want to push to github with SSH public keys.
Am I supposed to generate a private key for every device I push from or can I just use the same private key on every device?
>>
>>72702686
Long string formatting be damned, this is america. I can make my OWN strings as long as I want and the government cant say nothin
>>
>>72702696
you can use the same private key on every device.
>>
>>72702696
you can use the same private key on every device if you enjoy making it impossible to determine which device was compromised and stolen from
>>
File: 1557099473206.jpg (38 KB, 497x656)
38 KB
38 KB JPG
>>72702696
Either works. If you're super concious about security, you'd give them each their own private keys, so you could individually revoke them if they get compromised.
I was too lazy for that and share the same private key across my devices.
>>
I went to college for a comp sci degree just like every other smoothie brat, got my bach, and now I just started my first dev job, and I feel like I still know absolutely fucking nothing
They're not even letting me do any dev work or teaching me shit, they're telling me that I might start programming in like maybe 3-4 months or so but for now just write these e-mails and and make these docs for me
How big of a retard am I? I know I wasted my time in college, so how the hell do I actually proceed?
>>
>>72702733
here, you take a step back and give yourself some advice, and then ask for feedback on your own advice.
I bet you'll hit every necessary point yourself, without prompting.
>>
>>72702733
do the docs you're making document code?
>>
Are graph db's a meme?
>>
>>72702627
it's fine. step out of your comfort zone.
>>
>>72702733
Why did they have to make comp sci a meme degree? Why did tech schools fail to get a hold on teaching programming? Why do universities have to have a monopoly on producing brainlet code monkeys to fill positions that panders can do? I just wasted my first year at uni learning how to write a class in C++. I want do do computer science, not this.
>>
>>72702770
graphs are very useful... for the right problems.
>>
I wrote a Python script that makes rust programs break the CoC.
fn londonize(s: String) -> String {
let mut nigger = "".to_string();
let nigger_nigger = s.to_uppercase();
for nigger_nigger_nigger in nigger_nigger.chars() {
nigger.push(nigger_nigger_nigger);
nigger.push(' ');
}
for (nigger_nigger_nigger_nigger, nigger_nigger_nigger) in nigger_nigger.chars().enumerate() {
if nigger_nigger_nigger_nigger > 0 {
nigger.push('\n');
nigger.push(nigger_nigger_nigger);
}
}
nigger
}

fn main() {
println!("{}", londonize("London".to_string()));
}
>>
>>72702782

I'm annoyed when c++ pollutes my namespace *by accident* for loops polluting i, by design?

It's not ok.
>>
>>72702796
panders->pajeets
>>
>>72702807
>Python script
that's rust
>>
>>72702796
Here's an idea. When they used to fail 80% of the class in the first year, 80% of the class complained. Now 20% complains.
>>
>>72702801
If I want a huge dictonary where eg. a bunch of strings A,B,C all should map to Z and perhaps multiple as well. I was thinking this could be done easily in MongoDB but would something like Neo4J be a better choice for this?
>>
>>72702821
how is that related?
>>
File: orly.jpg (5 KB, 300x168)
5 KB
5 KB JPG
>>72702826
I know. The Python script I wrote below politically incorrected it.
import re
import sys

def tokenize(src):
return re.findall(r'[a-zA-Z0-9_]+|\S', src)

vars = []
atdec = False

if len(sys.argv) != 2:
print('Error: expected exactly one parameter')
sys.exit(1)

fname = sys.argv[1]
src = open(fname).read()

for t in tokenize(src):
if t in ['let', 'for'] : atdec = True
elif t in ['mut', '('] and atdec : pass
elif atdec:
vars.append(t)
atdec = False

result = src
for i in range(len(vars)):
v = vars[i]
result = re.sub('\\b{}\\b'.format(v), '_'.join(['nigger'] * (i + 1)), result)

f = open('negrified_' + fname, 'w')
f.write(result)
f.close()
>>
>>72702867
>not overwriting the original file
it's like you don't even want to violate the CoC.
>>
File: 1568236739441.jpg (263 KB, 1200x900)
263 KB
263 KB JPG
Reminder that this is real.
>>
>>72702867
tokenize = lambda src: __import__('re').findall(r'[a-zA-Z0-9_]+|\S', src)  
vars, atdec = [],0

if len(__import__('sys').argv) != 2:
print('Error: expected exactly one parameter')
__import__('sys').exit(1)

fname,src = __import__('sys').argv[1],open(fname).read()

for t in tokenize(src):
if t in ['let', 'for'] : atdec = 1
elif t in ['mut', '('] and atdec : pass
elif atdec:
vars.append(t)
atdec = 0

result = src
for i in range(len(vars)):
result = __import__('re').sub('\\b{}\\b'.format(vars[i]), '_'.join(['nigger'] * (i + 1)), result)

with open('negrified_' + fname, 'w') as f:
f.write(result)
>>
>>72702848
It sounds like Neo4J could work but if you're not sure what to use then default to SQL.
>>
Can someone link me the /dpt/ reading list
>>
>>72702884
Funny how no one has to remind YOU that this is real, huh. I believe we call that "obsessed".
>>
File: scrot.png (14 KB, 714x130)
14 KB
14 KB PNG
>What are you working on /g/
reading
>>
>>72702911
No such thing exists.
>>
>>72702912
it's a good reminder. Rust isn't that bad of a language, so without knowing in advance of their violently exclusionary community, I might get interested, spend a lot of money and time, only to then be turned away at the door to RustConf by pic related.
>>
Anyone know a good "ui element" unicode font?

I assume a bunch of icons that you'd want are in there already and I want to just draw buttons with unicode, so I can just copy and paste unicode char into an array and makes a row of buttons; but not the cutesy shit.
>>
>>72702911
not /dpt/ but not bad:
https://teachyourselfcs.com/
>>
>use a C library
>documentation isn't in man format
for what purpose
>>
File: sss.png (341 KB, 9000x1184)
341 KB
341 KB PNG
>>72702597
currently writing a simple chart plotter (>pic related, a similar shitty plot created in octave) in C++ because octave/matlab are way too slow and I'm too lazy to look for fast alternatives capable of handling decent amounts of data.
>>
File: pcre_ovector.png (425 KB, 893x914)
425 KB
425 KB PNG
>>72703044
so stuff like pic related is harder to discover
>>
Who is Rust aimed at? It is so inconvenient to write
>>
>>72703061
C++ fags.
>so inconvenient
not compared to C++
>>
>>72703046
looks good
>>
>>72703044
m*n is a bigoted piece of software that discriminated against people who don't identify as male by making them uncomfortable with its name. Imagine if you just transitioned and every time you wanted to read some documentation you had to type "m*n"? It makes you feel like you are asserting to yourself that you aren't actually female, and brings only negative thoughts. Why deal with that when you can just use html.
>>
>>72703068
C++ fag here, yes it absolutely is
you never have to fight a C++ compiler you just tell it to shut the fuck up when it thinks you're wrong
you have to fight the rust compiler
>>
>>72703131
>tell C++ compiler to shut up
how?
>>
>>72703131
If you are fighting with the compiler, it's because you ARE wrong. The compiler used to reject valid code based on lifetimes before, but that was fixed a couple years ago. You just make yourself sound like a retard by insisting this is still a problem.
>>
I'm making a really simple interpreted programming language just as a fun experiment. at the moment it's got while loops, if/else/endif, and rudimentary variables which are referred to by number. I'm planning on adding functions later on
>>
>>72703158
depends on the compiler, here's how you do it in msvc

#pragma warning(push)
#pragma warning(disable:/* warning number */)
#pragma warning(pop)

>>72703161
nope, sometimes compiler warnings should be supressed and ignored
you're wrong, inexperienced, and a stupid child who unironically think modern C++ programmers have memory safety issues
just shut up rustfag, you know nothing
>>
>>72703190
You can suppress compiler warnings in rust, smoothbrain
>>
>>72703187
neat, anon!
>>
>>72703197
cool
i don't actually care though
>>
>>72702911
1) SICP
2) TAOCP
Anything I'm missing?
>>
>>72703207
cared enough to reply
>>
>>72703209
>>
>>72703220
which is not really that much
i reply to even the most retarded of shitposts
>>
>>72703209
Oh,
0) Alice in Wonderland
>>
>>72703197
if you didn't include an insult then he could have just agreed with you.
>>
>>72703336
You know he wouldnt. Retards like him don't seek truth. They just seek to either pretend to be right no matter what or to entertain themselves by shitting up the thread
>>
AHHHHHHHHHHHH

Sooo I found "material design" icon font

I manage to find a font viewer in 2019 that doesn't crash

I try to copy in a char code that is in the icon fonts.... it refesses, I find out that its because it doesn't fit in utf-8... I find the encoding option and change it...... MY COMPILER CANT READ UTF16 and vomits nonsense errors

>__<"

I want to define a button by simply coping and pasting in a char into a struct definition fuck everything.
>>
>>72703355
Then write its encoding in bytes manuall
>>
>>72703380

why is a mostly empty font file not inside 2^8 space, in the first place?
>>
>>72703346
you could be right. but they might surprise you.
>>
>>72702613
>>
>>72703346
>a rustfag complaining about people not seeking truth
lmao
The only things I've seen from you niggers is constant lying, purposefully confusing C and C++, and misrepresenting CVE statistics.

you want people to use your language?
Stop saying memory safety is an issue in modern C++, because it's not true.
Stop focusing on memory safety as if it actually matters in applications besides web clients and web services, because most of the time it's so irrelevant it's not even worth paying attention to.
Start upselling the parts of rust that are actually worth using instead of only focusing on the fucking borrow checker literally all of the time, because those are the parts of a language that matters.

Literally the only thing I have ever heard about rust is that it's annoying to use, on purpose, and that definitely a good thing, and that C++ is actually C89 and completely unsafe and terrible.
If you changed your script, at all, people might actually respect you

but wait, retards like you don't seek truth, they just seek to either pretend to be right no matter what or to entertain themselves by shitting up the thread
>>
>>72703567
actually, no, that was dishonest
i just learned you can suppress compiler warnings from rustc so there's that too
>>
>>72703567
>you want people to use your language?
I actually don't. Fuck off, we're full.
>>
File: 1568184399036.webm (1.53 MB, 360x640)
1.53 MB
1.53 MB WEBM
Why do c++ retards get really angry when they see C(had) code? Do they feel insecure about his intelligence?
>>
coding
>>
>>72703685
Wait, are you that adafag who shills rust to keep people out of ada?
>>
>>72703736
Textbook SEETHING LMAO
>>72703728
No I'm the rustchad.
>>
>>72702597

why is does this code randomly cause a segmentation fault? most of the time it runs just fine, but sometimes it fucking crashes with that error.
btw, this code isnt for anything in particular, its just for practice (in tryna learn c++)


#include <vector>
#include <iostream>

#ifndef WORLD_H
#define WORLD_H

class World
{
public:
World() = delete;
World(int w, int h);
int getWidth();
int getHeight();
int getLayout(int i, int j);
void printMap();
virtual ~World();

private:
int width;
int height;
std::vector<std::vector<int>> layout;
};

#endif

#include "World.h"

World::World(int w, int h)
{
width = w;
height = h;
layout.resize(h, std::vector<int>(w));

for(int i = 0; i < w; i++){
for (int j = 0; j < h; j++){
if (i == 0 || i == (w-1) || j == 0 || j == (h-1))
layout[i][j] = 1;
else
layout[i][j] = 0;
}
}

}


int World::getHeight(){return height;}

int World::getWidth(){return width;}

int World::getLayout(int i, int j){return layout[i][j];}

void World::printMap(){
for (int i = 0; i < World::getWidth(); i++){
for (int j = 0; j < World::getHeight(); j++){
std::cout << World::getLayout(i,j);
}
std::cout << std::endl;
}
}

World::~World()
{
//dtor
}

int main()
{
bool cont;
do{
int a,b;
char usr;
std::cout << "enter width of map" << std::endl;
std::cin >> a;
std::cout << "enter height of map" << std:: endl;
std::cin >> b;
World w(a,b);
w.printMap();
std::cout << "do you want to create another map? (y/n)" << std::endl;
std::cin >> usr;
if (usr == 'y')
cont = true;
else
cont = false;
}while(cont);
}

>>
>>72703690
same reason i dont like seeing homeless people sitting on the sidewalk
>>
>>72703690
i don't, unless it's something like gnomeshit
most of the time if it's well written procedural code C apis are actually really nice to work with, the only exception being vulkan, which is both comfy and sort-of oop

but shit like the win32 api can fuck off
>>
Officially dropped out of college recently. Gonna work on some old school projects. First one is a program that creates an n x n ascii maze.
>>
working on a small program to set my keyboard led colors because fuck the shoddy proprietary windows app.

so far i can turn off and set the intensity of the leds
>>
hey, im majoring in EE (currently last year) and I wanna learn more about programmin, I took a course in C and a course in java (both required by uni) so I have some basic programming knowledge.
right now I wanna learn c++ because the company im working for is into IIoT and most modern PLCs are programmed in arduino, are there any other languages I should learn?
im probably gonna end up doing a software engineering diplomate (like minor, but better) were they will teach me more advanced shit in java, javascript and database stuff. but that will be in a while. theres so much shit to learn ffs someone guide me (pls senpai).
>>
>>72703887
this isn't a huge variety of languages, so a masturbatory linguaphile will tell you to learn Forth or APL or Smalltalk or some even less useful languages to round you out.
I suggest, rather, that you take C++ seriously and get general algorithms and data structures and such books for it. Knuth or even a simple crypto book's going to "stretch your brain" more than any memelang.
>>
File: 1567928350370.jpg (49 KB, 1280x720)
49 KB
49 KB JPG
>>72702613
>>72703482
C shart doesn't even have constant parameters for reference types
>>
>>72703887
You should learn a dynamic language, a functional language, and a lisp. You could do this by learning three different languages, or you could learn Clojure.
>>
>>72702669
>calling yourself spicylord
>>
>>72703887
God, you EE subhumans make me sick.
>>
why did they make arrays in C be pointers, unlike structs and primitives? Because of this you can never get a variable that holds the actual value of an array and you can't pass it around by value, or put it into a struct as a value. The arrays were fixed size at compile time anyway so being a dynamic size can't be the reason. Could they just not figure out how to elegantly implement the [] operator without arrays being pointers instead of normal values like everything else?
>>
>>72703919
as vile and despicable as >>72703944 's malicious encouragement is, Clojure is actually a practical and useful language if you're already doing stuff (that isn't Android or other '''embedded''') in Java.
It's only a dynamic language though. The FP and Lisp contributions are nil.
>>
>>72703985
because it was easier to compile on a PDP-11
>>
>>72703985
in C++ you can pass a std::vector of substantial size by value to functions that perform trivial operations on it.
This is almost certainly a mistake, and a very expensive one.
C improves on C++ by preventing this entire class of error.
>>
>>72703985
I really hope you don't pass your structs by value.
>>
>>72703985
write your own language.
>>
>>72704003
You're the one being malicious.
>>
>>72703919
>get general algorithm and data structures books for it
which one do you suggest? ill search for that knuth one.

>>72703944
>Clojure
never heard of it, what is it for?

>>72703977
>EE
>subhumans

lemme guess, compsci faggot that thinks calc 2 was ridiculously hard
>>
>>72704003
He didn't ask for languages with original "contributions" but to learn more about programming.
>>
>>72704047
>what is it for?
yet along LISP to fragment the community.
>>
>>72704063
I'm not responding to what he asked for, but to what the malicious encouragement said. And what he said was "you can learn an FP lang, a Lisp, and a dynamic lang" in just Clojure. This is absolutely false. You'll get less accustomed to FP than even Erlang would help you get, and that's also a dynamic language without all the ML stuff that are the basis of real FP. Clojure's only connection to Lisp is s-expressions and shitty syntax. Do you use that? Not really, it's just syntax. Can you follow Let Over Lambda in Clojure? Hell no.
>>
File: hmm.jpg (182 KB, 1024x1024)
182 KB
182 KB JPG
>>72703096
>>
What languages are the most based? How much of basedness do I have if I write functional JS? How do I increase my basedness? Move to Clojure?

t. New to /dpt/
>>
>>72704021
I only did it once to see how it worked...but I felt like a king!
p.s. when I create a variable to index into an array, should I use type size_t, all the examples just use signed int
>>
File: 1560960484175.jpg (95 KB, 708x800)
95 KB
95 KB JPG
using System;

class C
{
public C()
{
Console.WriteLine("New C()");
}
}

public class Program
{
public static void Main()
{
const C x = new C();
}
}


>NOOOOOOOOOOOOOOOOOOOOO YOU CAN'T JUST... CREATE A CONSTANT OBJECT
>>
>>72704097
>What languages are the most based?
native systems languages and lisps
however using a lisp makes you a weenie
a based weenie, but still a weenie
>How much of basedness do I have if I write functional JS?
you're like a unicorn but you smell like ass so no one likes you
>How do I increase my basedness? Move to Clojure?
yea that might work
>>
>>72704047
It was originally designed for long-running data processing software that takes real-world data as it is produced and draws conclusions from it (because that's the kind of software the author wrote) but people are using it for a variety of things.
I don't know if it would be specifically useful to you for EE, but the reason I suggest it is because it would get you thinking in frames of mind you haven't tried yet (dynamic, functional, lisp). At that point, you would be better equipped to choose the "right" language on your own.
Here's a video, if you like videos.
https://www.youtube.com/watch?v=VSdnJDO-xdg
>>
>>72704097
Rust and C++ are the only basedlangs out there
>>
>>72704129
I can't tell if your post is wordfiltered or not
>>
>>72704112
Holy shit. How the fuck do people shill shit language then?
>>
I've been writing a cli music player in C and it's going well, but I've been torn over the library I used. Is SDL too heavy to be using? I'm only using the sdl mixer and nothing else. The terminal is managed by ncurses for maximum auti- I mean aesthetics.
If I should be using something else, a recommendation would be nice.
>>
>>72703758

vectors of vectors of user defined sizes, you say? that get redefined in a loop?

Data fragmentation probably, vectors pinky promise that they linearly fit in memory, if you make big vectors(which a 2d one would be) and the memory can't put it anywhere, it crashes.

Try making it a bool, or even a smaller int
>>
>>72704122
>dynamic
ive done a lot of shit on matlab but I dont consider that a "programming" language in the same sense as c++ or java is (by dynamic you mean no data types and shit right)?
>>
>>72704095
Have you ever tried Clojure?
>>
I want the program to print the value 10, not a memory address. How do I get the ostream object in the << operator overloading definition to get the value of 10 from the Foo object's pointer-to-int data member? It keeps printing out a hex memory address, I tried foo.x, *foo.x, *(foo.x), &foo.x, &(foo).x, (int)foo.x, (int)*foo.x.
#include <iostream>

class Foo {
private:
int *x;
public:
Foo(const int num)
: x(new int(num))
{
}

~Foo(){ delete x; }

friend std::ostream& operator<<(std::ostream& stream, const Foo& foo);
};

std::ostream& operator<<(std::ostream& stream, const Foo& foo)
{
stream << foo.x;
return stream;
}

int main()
{
Foo *a = new Foo(10);
std::cout << a;
delete a;
std::cin.get();
}
>>
>>72703355
Can you use strings containing utf-8 byte sequences?
https://tutorialzine.com/2014/12/you-dont-need-icons-here-are-100-unicode-symbols-that-you-can-use

>>72703187
cool

>>72703758
Can you get it to crash while running inside a debugger? (i.e. GDB's continue command)

umm Does that World class destroy itself between initializations or just resize?

Maybe you could initialize to [zero x zero] before the loop, resize while still looping, and destroy after.
>>
>>72703977
>t. can't into electronics
>>
>>72704173
no, I'm just complaining completely randomly about it for no reason. It was very clever of you to ask this question. It's as if you went directly for the curtain's controls, and pulled them aside, without even talking with the giant projection of a head.
>>
>>72703887
As EE, study C, C++, and whatever assembly language you're interested in.
>>
>>72704168

so it isnt my fault the program is crashing?

>try making it a bool or even a smaller int
a bool would be a problem, given that I need more than 2 possible values in each position for what I wanna implement later.
>>
Hard to say, I took a long break
>>
>>72704025
I am thinking about writing a language that you can type without using the shift key as I am tired of all the finger contortions necessary to type all the special characters in most languages

I think I would make white space significant like python
dissallow upper case characters in identifer names
allow and suggest using periods in identifiers to seperate words like to.string
use brackets for function params sin.cos[x, y]

let me know if you have any suggestions
>>
>>72704172
>by dynamic you mean no data types
Yes, that is what I mean. Well, it has data types, but it doesn't force you to make the way you use them conform to a simple, predefined pattern. There can be advantages and disadvantages to this, so you will find it helpful in the future if you can identify when you should use dynamic types versus static types.
>>
>>72704209

Your not taking control of how your program structures memory, it is your fault

Also probably use uint8
>>
>>72704191
How did you develop such a mean-spirited personality?
>>
I got an onsite interview with amazon next week, can anyone link me to the sekrit chinese/punjabi cheat repo?
>>
>>72704217
>no upper case characters
>but also no underscores
you want people to declare variables with dashes-in-the-name?
hope you're good at writing lexers because subtraction operator is undefined for the following undefined variables:dashes, in, the, name, and expressions can't be used on the left side of an assignment operation.
>>
>>72704249
periods.in.the.names
>>
>>72704242
Learn Lisp.
>>
char *base_url = argv[optind];
char *wl_file = (file_flag > 0) ? in_file : "wls/default.txt"; // Point to the same memory address
t_args *args = (t_args*)malloc(sizeof(t_args));
args->url = (char*)malloc(sizeof(char*) * BUFSIZ);
args->fname = (char*)malloc(sizeof(char*) * BUFSIZ);

strcpy(args->url, base_url);
strcpy(args->fname, wl_file);

/*printf("url is: %s\n", args->url); */
/*printf("file name is: %s\n", args->fname); */

if(pthread_create(&thread_id, NULL, fuzzy_request_async, (void*)args) != 0) {
printf("Error!");
} else pthread_join(thread_id, NULL);

free(args->url);
free(args->fname);
free(args);
>>
>>72704255
I'm sorry, but periods has no attribute `in`
>>
>>72704249

varname1
>>
>>72704187
>does that World class destroy itself between initializations or just resize?

as I understand it, a class with a dtor will destroy itself after its scope ends, which I believe its at the end of the do while loop, what does resize its the 2d vector, which is uninitialized for a brief moment when the constructor is called and then its resized with the desired parameters.
I deleted the default constructor for world btw, as I dont wanna use it in any case.
lemme try what you say
>>
>>72704272
ah, the perfect language to chase away ESL changs and street shitters
>>
>>72704174
stream << foo.x[0];
...
<< *a <<
>>
>>72704280

I honestly don't see the problem and use it ironically

fuck camelcase
>>
>>72704233
>Your not taking control of how your program structures memory, it is your fault

how do I do this?
>>
>>72704174
stream << *(foo.x);
and
std::cout << *a;
you're dealing with two pointers here not one
deference both
>>
>>72704267
x = obj.instance/method.name[param1, param2]
>>
File: 1523665652267.gif (1.06 MB, 500x500)
1.06 MB
1.06 MB GIF
>>72704047
>lemme guess, compsci faggot that thinks calc 2 was ridiculously hard
I TA for complex analysis, and I hate every single one of you.

Please do NOT respond to me, undergrad.
>>
>>72704327
>just x
hello haskell user
>>
>>72704327
also
>using the division operator to access object members
>>
>>72704347
pure mathematics is degenerate
>>
if I have Sedgewick's Algorithms books in C (and haven't read them yet), should I get the newer C++ versions of the books?
>>
>>72704378
are you going to read them?
>>
>>72704378
No. You should not use C++ for any purpose.
>>
>>72704378
Don't worry, we all need to stuff our libraries full of pretentious nonsense that we never read too
>>
>>72704383
yeah, one of the sets.
>>
>>72704390
They'll be ebooks so there's no real upside or downside to how pretentious I can be.
>>
>>72704293
>>72704320
I don't want the usage of std::cout to be messy, I just want to pass in "a", not "*a" to cout and get 10. Anyway, I figured out a way but I'm not sure it's best practice since I'd rather achieve the same thing with reference-to-const-object instead of const-pointer-to-const-object since that's more "modern."

friend std::ostream& operator<<(std::ostream& stream, const Foo* const foo);
...
std::ostream& operator<<(std::ostream& stream, const Foo* const foo)
...
stream << *foo->x;
>>
>>72704296

Knowing allocation rules, and mostly either having large data structures in global scope defined at compile time or having initialization that happen before logic code starts shitting everywhere.

I'm honestly not a fan of vectors, it may work if it was a real array(so it wasn't moving data around); although your probably learning from a modern c++ source that wants that shit; just know their wrong.

Having an unlimited sized data structure defined with user data in a loop is not ok, no matter what modern c++ idiots say.

And really get in the habit of cutting down your data to the minimum, your using 64 bit ints to store 1 or 0
>>
>>72704374
you are going to have to do math using short words because I cannot use the + either, and no parens so I might force rpn:

a = x y z add 1.0 sub floor 2 mul
>>
>>72704415
then don't use pointers
why are you using new and delete anyways
you should not be dynamically allocating memory for a simple class that holds an int, and you should definitely not be also dynamically allocating memory for that int, make it on the stack or if you have to, use std::unique_ptr
>>
File: 1376716670552.gif (692 KB, 333x335)
692 KB
692 KB GIF
>>72704375
It's fine if you hate me, as long as you channel that anger into not being a retard in my class.
>>
>>72704296

You could also make it not vector(vector(int)), but have vector(pointers to vectors(int))

So the vectors could fill gaps in memory far better

remember 2d arrays are fictions, and they are actually the w*h
>>
>>72704447
>force rpn
gay
also uncreative
just do what haskell does.
curry the shit out of everything.
alternatively you make anonymous tuples a first class object and gets passed into literally eveything
 foo = bar [baz] 

If every object has a default "call" function which accepts a tuple, then that call function can be defined differently for different objects
If
bar: dict
then passing a tuple into bar/call results in accessing a member.

certain objects can be marked as operator by defining the operator function, which takes a priority and two variables--both tuples: lhs and rhs. Evaluation of expressions is recursive.
>>
>>72704468
yup, I know about unique_ptr, make_unique etc. etc., purpose of this simple example is to learn how to overload ostream operators
>>
>>72704437
>it may work if it was a real array
I tried doing it with a normal array and the problem I ran into was that you cant declare the array of arrays as a variable in the header file without a set dimension (as in I cant say int layout[][]) and I cant later resize the array as I want.
(I cant because I dont know how to, if theres a way im unaware of it)

>youre using 64 bit ints to store 1 or 0
kek, fixed that
>>
>>72704507
in general, being explicit about dereferencing is more important than making things look clean, especially when it's so minor
it's not a cheap operation and people should know when you're doing it
>>
>>72704507
also you'll want to construct a sentry and test it, that's the proper way you're supposed to do it
std::ostream& operator<<(std::ostream& stream, const type& Type){
auto sentry = std::ostream::sentry{stream};
if(sentry) {
//output here
}
return stream;
}
>>
>rosettacode down for hours
>not a single tweet about it
I guess it's not that popular anymore. hmm.
>>
>he doesn't maintain a meticulously clean commit history
Why anon, do you not take pride in your work?
>>
>>72704492
I don't know anything about haskels I speak american and I don't eat curry
you mean something like this?
a = mul[2, floor[sub[add[x, y, z], 1.0]]]
not sure that is better than rpn except in the simple cases
>>
>>72704556
the smartest man I know has the same message for every single commit.
>>
>>72704568
what is the message?
>>
>>72704514

If you willing to use c style, you can always use functions which take pointers then treat them like arrays.

*(&array) and array[0] are equivalent, functions that take arrays have "safety features" and therefore should be ignored for the wonderful world of pointers.

Generally what you do is have a global pointer, make your array first thing first in your main, then point your pointer at it.

For 2d arrays, I would have to look it up but I believe its array[y*w+x] to access it using pointer hacking methods
>>
>>72704606
Updating: very very minorly
>>
>>72704565
No.
Writing the definitions in a recognizable language
mul.operator<1>(lhs, rhs} { return lhs * rhs } // priority 1 
sub.operator<2>(lhs, rhs) { return lhs - rhs } // priority 2
add.operator<2>(lhs, rhs) { return lhs + rhs } // priority 2
floor.call(rhs) { return |rhs| }

a =  2 mul floor x add y add z sub 1.0

is syntactic sugar for
a = [2] mul [floor [[[[x] add [y]] add [z]] sub [1.0]]
>>
>>72704622
it looks pleasing, but I don't think humans are smart enough to keep track of the precedence, normally in code I put parens around every math op that could possibly be confused even
x + (y * z)
>>
>>72704617
does he ever squash old commits together and give them a more informative message?
>>
>>72704606
>...for you
>>
>>72704664
then write [/code] a = 2 mul [floor x add y add z sub 1.0]
>>
>>72704686
>>72704664
in case you're a brainlet and haven't realized yet, tuples ARE your parens. It just so happens that in this example, all tuples have a length of 1
>>
>>72704478
i dont think the problem is the memory, I just made and printed a 1000000x1000000 map, it only crashes when I create a world with certain pairs of numbers, like 5 and 8, if I make a square world, it never results in a segmentation fault
>>
>>72704615
this sounds fun, ill look into it
>>
>>72704707
you have obviously screwed up the order of the [x,y] array indices somewhere
>>
>>72704678
nope. 387 commits with that message. the next one is 14 commits with "Updating: testing .travis.yml"
genius has no need for petty concerns like commit history.
>>
Do you guys use anything other than git? like fossil or w/e? Is git the best we can do?
>>
>>72704707
Probably the resize is backwards then
>>
>>72704732
I think for personal projects there should just be a mode where it watches the directory and commits locally every time the files update and then syncs every day
no need to make discrete commits and give them messages, you just get an ability to go back through the history of the files
>>
>>72704727
amazing!
>>
I have given up on ever making a #include .h again and instead going full #include .cpp with my own files.

Am I based or insane?
>>
>>72704724
>>72704744
ill check
>>
>>72704765
sounds like you want pycharm's local history feature
>>
>>72704793
you are insane. For your brand of insanity, I recommend: Forth, Smalltalk, or APL.
>>
>>72704793
insane, pretty sure that's undefined behavior
>>
>>72704732
I unironically don't think there's much to improve on with git. Better support for large, unchanging files I guess so you don't have to use weird add-ons
>>
>>72704814
>Not just commiting your entire codebase and all assets into git as a giant .zip file
It's like you don't even know how to use git properly.
>>
>>72704812
Its not undefined, its literally as if it was copied and pasted

>>72704806
Are you impling I'm old
>>
>>72704831
>not just committing binary blobs to master
Small time
>>
>>72704814
Fossil doesn't have this issue.
>>
>>72704840

>not writing in pure assembly in one go shipping it to paying clients and instead giving it leeching commies who run github

tiny brain
>>
>>72704918

>not writing it in beautiful self documenting assembly, for all to enjoy.

dur
>>
>>72702613
Kek
>>
i'm working on a go api
>>
Do you guys post your projects somewhere to get some recognition/users? Obviously not here unless its an alt account, nobody wants to be associated with this place.
>>
>>72705098
I've posted what I've worked on here with my real github account several times before.
>>
>>72702597
I have an app with a local copy of a remote DB.
>Bricked phone, find new one
>Download DB, 6h
Found problem. When new object created a temp object is created. Once database synced temp object remains. Modifying temp object makes dumb shit happen. Wrote code to delete that shit.
>compile, 2h
>new android rules, can't use that target version
>xamarin auto updated, increase target version again
>... still compiling (and I'm pretty sure it's doing nothing)

Does anyone actually write code when they're 'writing code?'
>>
Safe string getter.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char * getstr() {
int len = 0;
char * s = malloc(1);
s[0] = 0;
char c;
while ((c = getchar()) != '\n') {
s[len] = c;
len++;
s = realloc(s, len);
s[len] = '\0';
}
return s;
}

int main() {
for(;;) {
char * s = getstr();
printf("%s\n", s);
free(s);
}
}
>>
>>72702733
Motorola advertised 2 years writing documentation but not code for their graduate program her. You were supposed to avoid that crap. Keep sucking dick and look for the next job. If you leave in the first year what ever job you get next you're stuck with.
>>
>>72705103
Are you crazy? I posted here once and got nothing but comments on my profile pic, people calling me cute
>>
>>72705179
>people calling me cute
post ur milk duds so we can rate.
>>
>>72705140
Some time is spent reading code, or solving problems in the abstract, but yes, a lot of time is spent writing code.
If your compiler regularly takes 2 hours, I'm amazed if you can get anything done at all. Look into hot reloading or find a different language, a language that lets you make a little change and see the new output right away. At least use it for prototyping.
>>
>>72705168
Too bad getline already exists and works perfectly well.

>int len = 0;
size_t is a more correct type for this.
>char * s = malloc(1);
realloc(NULL, len) works perfectly fine and acts like malloc, so you can just leave this as NULL.
>char c;
int is the correct type.
>while ((c = getchar()) != '\n') {
You're not checking for EOF.
>s = realloc(s, len);
Also not checking for errors here.

>>72705179
The stuff I've worked on is actually decently high profile, and even would have some users on here. I haven't talked about it in ages because I haven't really done anything noteworthy recently.
But even when I do post about it, I typically don't get many insightful comments.
https://github.com/swaywm/wlroots

But now I'm trying to strip out our support for software cursors and make the user deal with it, for a variety of reasons.
>>
>>72705204
It's an android app compiling for release. There aren't a lot of choices.
>>
>>72705179
could be worse
>>
>>72705207
>realloc(NULL, len) works perfectly fine and acts like malloc, so you can just leave this as NULL.
Your """suggestions""" make the program segfault.
>>
>>72705388
Obviously you take out the part where you write a null terminator to a null pointer, dumbass.
>>
>>72704701
yeah I see, it is like lisp
and I hate it
you really have to do mental work to parse that, reading left to right is just easier

stop trying to make lisp a thing
it is never going to be a thing


class window

func draw.crosshairs[float thickness, color c] int error.code, bool was.redrawn
error.code = 0
float2d win.center.point = add x, y, z sub 1.0 floor mul 2.0
if[not sprite;;draw[win.center.point, c]]
error.code = 1
return error.code, true
>>
>>72705395
But then two consecutive newlines will return NULL when it should return an empty string to be consistent.
>>
>>72705420
Whatever; leave it as it is then. It's up to you to determine the exact behaviour it has in edge-cases.
I personally would've just moved the part where you write a null terminator outside of the loop, and the empty line case would've been taken care of by that.
>>
critique my garbage c++ /dpt/! im trying to learn it!
specifically, when should I return a pointer to a vector instead of just returning it? when should I accept a pointer to a vector instead of allocating a new one?

https://pastebin.com/hZfY8gcN
>>
>>72705448
You would also have to change it to a do while then or else it will segfault on consecutive newlines.
>>
>>72705207
Hey I remember you, wlroots anon. I've asked about dependency-less Linux graphics before and I believe you answered. Kernel mode setting, generic buffer management and stuff.
>>
File: 1560817775415.jpg (38 KB, 256x300)
38 KB
38 KB JPG
>>72705738
Yeah, that's something I would've answered. I'm somewhat of an expert on that.
>>
I am > I was
>>
>>72704217
I missed your reply earlier. No shift key? Sounds nice. As for suggestions, I liked significant white space until I realized why the lispers like parentheses so much: https://www.youtube.com/watch?v=D6h5dFyyUX0
Is there some way you could support structural editing without the parentheses?

>>72705410
>reading left to right is just easier
>not like lisp
I don't know what that other guy is giving you grief for. Putting him aside, in clojure they try to support reading left-to-right with macros:
(-> (+ x y z) (- 1.0) (Math/floor) (* 2.0))
>>
>>72705449
Don't write a class just for one function anon this isn't C# or java.
If there's no data associated with something, try not to make a class.
Idiomatically you'd probably use a lamda for something like isPrime and next, but you're just a beginner, so why not ideal, a class is fine.

also snake_case > camelCase in C++, consistency is important, follow the conventions of your standard lib
>>
>>72705449
No need to write classes for things which don’t manage state. Just write free functions like you would do in C.
Also look into namespaces, they are a much cleaner way to logically organize a group of related functions. https://en.cppreference.com/w/cpp/language/namespace
>>
>>72705843
*while not ideal


>>72705449
>specifically, when should I return a pointer to a vector instead of just returning it?
*reference (only use pointers when you want pointer semantics)
when the function does not take ownership of or modify the lifetime of the vector and for some reason you want to return the pointer at the callsite (like when you want to chain functions)
>when should I accept a pointer to a vector instead of allocating a new one?
almost always
vectors are big boys so you almost never pass them by value
pass by const reference if don't want to modify them

i completely missed this, sorry
>>
>>72705836
>Is there some way you could support structural editing without the parentheses?

I think anything without overloaded symbols could, c++ with its (quick mental math break) 20 different meanings of *, couldn't; but they were showing it worked with " and (, why not ',', { and [?
>>
>NOOOOOOOOOOOOOOOOO
using namespace std;
>>
>>72706010
Doesn't this cause conflicts with different libraries and std? Both std and boost are pretty big with many common word names
>>
>>72705843
>>72705899
>>72705901
thanks anon. in this case primes is memoized (it keeps track of a list of known primes between calls) should it be a class or can I use a free function here?

you say I should accept const references instead of const pointers, should I return const references too (instead of const pointers)?
>>
File: 1552771955742.png (61 KB, 310x320)
61 KB
61 KB PNG
Just got my first gig that involves machine learning and am very excited to finally put my neet honed skills to the test, problem is the client basically wants to resell the project to a bunch of other clients and give me a slice aka not paying me a dime until he begins selling the thing which would be around 2 months after development begins. How do I go around not getting jewed? Is this how all freelance work is, not knowing if I'll get ripped off?
>>
>>72706037
memoization's an optimization--it affects the performance but not the outcome of a function. So go ahead and use a free function and just hide the state required for the memoization.
>>
>>72706046
>not working for regular wage
ABORT
ABORT
You're clearly out of your depth, anon.
Are you prepared to hire a lawyer when this person screws you? If you're not, you can't even really play.
>>
File: 1567462619043.jpg (46 KB, 310x300)
46 KB
46 KB JPG
>>72706046
>working for free
There are paying gigs, sounds like you are getting dicked
>>
>>72706061
I mean, the client seems pretty wealthy and has a business and everything, surely he wouldn't sully his good name...
>>
>>72706010
>C standard
>don't use names that start with _
>C++ standard
>don't use names that start with _

C/C++ programmers
int __________var

Then they bitch about global using breaking tgeir code
>>
File: 1550194436765.webm (1009 KB, 1280x720)
1009 KB
1009 KB WEBM
>>72706046
>resell the project to a bunch of other clients and give me a slice aka not paying me a dime
My etiquette handbook says pic rel. is the appropriate response to your situation.
>>
>>72706046
nope
>>
>>72706037
it always depends, if you're modifying the contents of the vector after the fact, then no, else yes
>>
will c++40 include
using std::{vector,find};

declarations?
>>
>>72706106
Why does it break their code?
>>
is it worth starting with something like gamemaker at first or will it just teach bad habits?
(I don't really have a pressing reason to learn programming, other than for the sake of the skill. As an introduction, something like Gamemaker seems easier to screw around with.)
>>
>>72706106

Idiots everyone knows you do var_ and pronouse it "var prime"
>>
>>72706170
what the fuck
>>
>>72706166

You'l hate drag and drop bullshit in all about 1 week of real use; I would suggest love2d first
>>
Can anyone explain how VGA works in real mode?
I set the mode to 80x25/16 color and then the teletype bios call stops working
I can't find any good resources that aren't just 1000's of listings of bios calls
trying to make a boot loader btw
>>
>>72706157
Lots of stl code starts with one or more _ ironically to avoid clashing with custom variables, but coders have to be leet hackers and use global variable names that follow the same principle
>>
>>72706105
he's already sullying his good name by not paying you.
there's a role in economics for the person who doesn't get paid until the product ships, and that person is not you -- or you'd know more about this.
he's not necessarily intending to screw you over, maybe you have a good relationship. Maybe there's literally nobody in your business with this guy who can fund things, and actually you're both workers - he the salesman with the connections, perhaps.
>>
>>72703096
How the fuck does manual remind you of males? Are you retarded?
>>
>>72706216
I believe it was parody.
>>
>>72706216
>he thinks the author of Emacs's M-x woman is a retard
>>
http://hackage.haskell.org/package/kan-extensions-5.2/docs/Control-Monad-Co.html#t:CoT
reminder haskell is useless abstract garbage
>>
>>72706037
Static variables are good for memoization tables as long as things are multithreaded.
References are usually preferable to pointers unless you really want the address. Const ptr/ref means that the user can’t change the underlying data from this ptr/ref, it is the preferred way to pass in parameters for non-elementary types.
>>
I like Rust but I wish it had overloading and inheritance.
And the println! macro could be smarter.
>>
>>72706283
macros abuse is cancer.
>>
>>72706283
Rust does have operator overloading, but operator overloading is fucking shit.
Inheritance is fucking shit too.
>>
>Turns out the gtk bug is actually distro specific
FFFFFFFFFFFFFFFFUCK!
>>
>>72706292
>operator overloading is fucking shit.
Until you're working with vectors and matrices.
>Inheritance is fucking shit too.
Fuck off nigger. Only brain damaged retards like yourself enjoy copying the same code everywhere.
>>
>>72706316
You seem to be utterly incapable of working without POO everywhere.
>>
>>72706283
use traits and trait objects
>>
>>72706316
>She thinks inheritance is the only way or even the best way to avoid copying code
God you're a fucking idiot monkey
The ONLY acceptable use of "inheritance" is interface inplementation.
>>
>>72706323
t. POOava/SEPPLES programmer
>>
File: 1545809685606.jpg (191 KB, 1080x1020)
191 KB
191 KB JPG
>no inheritance
NOOO HOW WILL I IMPLEMENT MY SINGLETON FACTORY OBSERVER
>>
>>72706356
>wojak poster
>having an ironic meltdown
kys
>>
>>72706356
you can write an observation microservice... factory microservice
>>
>>72706360
who are you quoting?
>>
>>72706371
Back to r/4chan and take your shitty wojak folder with you.
>>
>>72706310
AAAAAAAAAAAAAAAAAAAAAH I FUCKING HATE C
WHY THE FUCK DOES IT HUNT ME FUCK YOU GTK FAGGOTS FUCK YOU FUCK YOU FUCK YOU
>>
>>72706376
Face it, you're a dumbass. Do you need to keep confirming that by posting your ineptitude here?
>>
>>72706376
*squint*
>use gio::prelude::*;
>pub fn
I dunno man, people who use other languages manage to get GTK to work for them :)
>>
>>72706376
why use gtk?
>>
>>72706331
>yo hol up jus lemme write a completely new 50 property struct that shares 40 properties with another struct, wadya mean I can just inherit them? pfffft dat be pajeet sheeeit
>>
>>72706391
Because gtk offers the best interop in any language and I got used to gtk
>>
>>72706376
Yeah C is stupid. What's new?
>>
>>72706407
>I got used to gtk
really? >>72706376
>>
>>72706425
That's perfectly valid gtk code, and it even runs on mingw64 on windows too.

FFFUCK! I've never been unproductive like this before.
>>
File: 1560312447857.png (16 KB, 274x301)
16 KB
16 KB PNG
>>72706376
>>72706423
>>72706435
>Tranny writes a poor wrapper interface over a C library
>It's C's fault
It doesn't help that Rust is so utterly incapable of dealing with libraries with ownership models that are different that its own strict one. It basically forces you to write terrible wrappers, and is the reason so many retards try to rewrite perfectly working C code in Rust.
>>
>>72706376
>Not being able to fix
0x00007ffff723dd54 in __memmove_avx_unaligned_erms () from /usr/lib/libc.so.6

lol rustrannies, everyone
>>
>>72706442
Explain how it runs on mingw64?
>>
>>72702597
 #include <iostream>
int main() {
std::cout<<"I slacked off today."<<endl;
system("pause");
return 0;
>>
>>72706444
Fuck you nerd faggot nobody got time to fix __memmove_avx_unaligned_erms
>>
>>72706471
>system("pause")
cringe
>>
File: 1566806881448.gif (195 KB, 800x800)
195 KB
195 KB GIF
>I LOVE TYPE SAFETY
>>
>>72706479
>Le onions reddit man XDDDDDDD
Will you seriously just fuck off? The garbage belongs on reddit, just like you do.
>>
>>72706471
pardon me for not adding the other brace in. So used to visual studio 2019
#include <iostream>
int main() {
std::cout<<"I slacked off today."<<endl;
system("pause");
return 0;
}
>>72706478
I don't like it ending so abruptly lol.
>>
>>72706442
Maybe they both suck, and sepples too. At least Durgalang doesn't explode if you use a variable with an underscore. Muh performance is a stupid excuse to use a shitlang because 90% of the time it doesn't matter for your project.
>>
File: 1560221448246.png (197 KB, 785x731)
197 KB
197 KB PNG
>NOOOOOOOOOOOOOOOOOO YOU CAN'T JUST... IMPOSE TYPE SAFETY ON ME!
>>
In C++ is it possible to have member variables that aren't initialised by the constructor? I mean, what if you don't want to initialise them right away?

Is it simply expected that you should initialise every member variable?
>>
>>72706435
take a break, go for a walk, hypothesize
>>
>>72706507
you can do anything in C++. if you don't need macros.
>>
>>72706479
Complex type systems are pointless intellectual masturbation at the cost of compile time. All you need is generics and local inferred typing.
>>
File: 1568185834315.jpg (103 KB, 907x718)
103 KB
103 KB JPG
>>72706479
based wojak poster
>>
>>72706495
Nobody brought up Java, you stupid street shitter.
>>
>>72706517
My IDE is complaining when I don't explicitly initialise them but it seems necessary if you don't know what they should be at the time of object creation
>>
>>72706510
Thank you anon. I'll go to the gym and maybe even go out the pub tonight. It's Thursday.
>>
>>72706521
I'd rather be debugging someone else's Java than their segfaulting C and global variable collisions.
>>
>>72706541
If any other fellow rustfags are interested, I opened the issue with my throwaway github:
https://github.com/gtk-rs/gtk/issues/891
>>
What do? I'm bored as balls, and I need ideas for a new project. Something simple too please, I'm a beginner to C++ still.
>>
>>72706553
>Sepples
Forget that garbage and go learn a real language.
>>
>>72706558
>real language
What're you gonna shill me? Hasklel? Java? Python?
>>
>>72706553
Don't worry about anything anyone says. Try making something that you will find necessary. For example, a to-do app or something.

C++ is a fine language. C++ has flaws but it's not all that bad as /g/ makes it out to be.
t. Rustfag
>>
>>72706553
Are you a beginner to programming or just C++?
>>
>>72706573
First one, I have some modicum of knowledge on how programming worked when I was like 13, but never delved into actual programming until very recently. As for C++, yes, I'm very new to it. I understand how hello world works, I can even make rock paper scissors, but I can't pull off the impressive stuff like most others have.

TL;DR, Both.
>>
>>72706568
>t. Rustfag
Not exactly encouraging words mate, but I'll take what I can get haha.
>>
File: 1542629541459.png (43 KB, 1200x800)
43 KB
43 KB PNG
>>72706601
Listen here little baby. You're gonna get a lot of hurtful and degrading comments, but that ain't what I'm about. Let me just say, you are perfect the way you are. You hear me sugar? PERFECT. Don't ever change. You deserve anything and everything you want. Stay safe for me, baby girl. >mfw thinking of you hurting
>>
REEEEEEEE
>>
>>72706392
>10 property struct plus the struct that has the other 40 properties
ftfy
>>
>>72706635
This is why you need flatpaks
>>
>>72706635
on Fedora when I open a program in gdb, it tells me exactly what packages to install to get the required debuginfo.
Does Arch not have that?
>>
>>72706616
...Anon, nicest words I ever got on here. Didn't expect the warm feels man.
>>
>>72706616
this was never funny
>>
File: scrot.png (34 KB, 733x884)
34 KB
34 KB PNG
>>72702597
>What are you working on, /g/?
Starting work on a packer for ELF files
elfpacker $ ./elfpacker -3 ../../random_code/asm_world/hello
[+] Hello, World!
[>] Using ELF32 header
[*] 32 bit elf detected.
[+] Elf header e_entry: 0x200004, e_phoff: 0x20
elfpacker $ ./elfpacker elfpacker
[+] Hello, World!
[*] 64 bit elf detected.
[+] Elf header e_entry: 0x1310, e_phoff: 0x40

int main(int argc, char **argv)
{
int elf_flag = NO_FLAG;
int c = 0;
while ((c = getopt(argc, argv, "36h")) != -1) {
switch (c) {
case '3':
if (elf_flag != NO_FLAG) {
error("Can only set ELF32 or ELF64, not both");
exit(-1);
}
info("Using ELF32 header");
elf_flag = FLAG_X86;
break;
case '6':
if (elf_flag != NO_FLAG) {
error("Can only set ELF32 or ELF64, not both");
exit(-1);
}
info("Using ELF64 header");
elf_flag = FLAG_X64;
break;
}
}

if (optind == argc) {
error("Usage %s [-3]|[-6] <executable>", argv[0]);
exit(-2);
}
int fd = open_file(argv[optind]);
int filesize = get_filesize(fd);
if (filesize <= 0) {
error("Filesize <= 0");
close(fd);
exit(2);
}
void *p = map_file(fd, filesize);
if (elf_flag == FLAG_X86) {
pack_32((struct eh32_t *)p);
} else { // FLAG_X64
pack_64((struct eh64_t *)p);
}
munmap(p, filesize);
close(fd);
}
>>
>>72706649
who knows
Linux is too fragmented. I'm considering development on flatpaks, but the API is cumbersome
>>
>>72706273
if only someone came up with an actually usable functional programming language instead of this fucking circlejerk
>>
>>72706592
C++ is a great language for building software with very demanding performance requirements but it is not a beginner language. Spend a few weeks with Python or Racket or something.
>>
>>72706735
Use Rust
It's unironically the only useful semi-functional lang :^)
>>
File: 1563282069503.png (477 KB, 984x923)
477 KB
477 KB PNG
>>72706735
>usable
>functional programming
pick 1
>>
>>72706743
>Racket
kek lost me there
>>
>>72706735
OCaml's perfectly usable. just, uh, fork and use distributed programming instead of threads. Typed term I/O actually makes this fairly pleasant.
Erlang's also usable for lots of fun stuff if it counts.
Mercury's usable, but there's not much in the way of libraries or community atm.
Rust blatantly has lots of ML in it, and the gravitation forces pulling all code into masturbatory bullshit are far weaker for it than for Haskell.
No personal experience though. I'd like to see a review of Rust that's from an GC'd FP perspective instead of about C++.
>>
>>72706762
Wait what, Mercury's functional?
>>
>rust is good!
>rust is for trannies!
shut the fuck up all of you
>>
>>72706781
t. self hating rust tranny
>>
>>72706774
yeah. ML types, higher order programming, currying, typeclasses, purity. The whole nine yards. It's a logic/functional language.
>>72706781
Rust has a lot of good points AND it is hopelessly infested with trannies. Much like Western civilization.
>>
>>72706781
Stop being a faggot and learn the basics of every language. Don't bury your head in the sand and ignore everything else like a seppletard.
>>
>>72706793
Oh that's right. I forgot it's just a modern prolog.
>>
>ownership model doesn't work in the real world (http://way-cooler.org/blog/2019/04/29/rewriting-way-cooler-in-c.html)
>"eliminates whole classes of bugs at compile-time" - still uses unsafe internally
>in fact you can't even write a doubly linked list without unsafe
>no stable ABI or dynamic linking
>relies on unsafe C libraries for things like SSL
excellent language
>>
>>72706743
I like to challenge myself.
>>
Can someone recommend good books on data structures and algorithms?
>>
>>72706832
>in fact you can't even write a doubly linked list without unsafe
You can with weak pointers and ARC
>stable ABI
mostly useless
>>
>>72706866
using refcounted ptrs for all the elements sounds insane
>mostly useless
not if you wanted to write a rust ssl library
>>
>>72706866
>dragging in refcounts for a fucking linked list
>dynamic linking is useless
no wonder rust is a joke
>>
>>72706883
>dynamic linking is useless
Dynamic linking is useless. Space is dirt cheap now, computers don't run on 256MB anymore.

Dynamic libraries produce inconsistent result, see >>72706635

Furthermore, why the fuck would I ever write a linked list if it's in the standard library? Do you like rewriting std::vector everyday?
>cnile brainlet
Oh I see. lol.
>>
Why is android development so fucking obnoxious? I mean it's easy to build a simple app but if it gets complex you end up wanting to start over because the code turns into a huge clusterfuck. Am I just a retard? How do I make Java look readable?
>>
>static linking
why yes, i want every subroutine to be able to return into system() with no issues
>>
>>72706907
>dedpulication is the only reason to use dynamic linking
rustrannies are mega brainlets huh.
>>
>>72706926
Seething cnile boomer. Enjoy your unpredictable behaviors and slower performance.
>>
New thread:
>>72706941
>>72706941
>>72706941
>>
File: 1536063434957.jpg (80 KB, 1000x1000)
80 KB
80 KB JPG
>>72706949
>he does it for free
>>
>>72706976
What?
>>
>>72706976
kek



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.