[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] [Home]
Board
Settings Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File deleted.
What are you working on, /g/?

Last thread: >>69756177
>>
>>69761586
I'm this fag:
https://github.com/johnch18/vm_v1
>>
File: 1547874937181.png (384 KB, 1024x768)
384 KB
384 KB PNG
>>69761586
what does this image have to do with /dpt/? i guess at least it's anime and christian but it seems kinda off topic
>>
File: smallsteps.webm (738 KB, 1280x720)
738 KB
738 KB WEBM
>>69761586
>What are you working on, /g/?
robotics. I am afraid to break things. That's why only small small steps.
Maybe i should start simulation before rl hacks, but simulation is so fucking time consuming
>>
>>69761601
It doesn't look like there's too much to break, honestly.
>>
>>69761586
>its a /pol/nigger episode
>>
>>69761601
what hardware are you using?
what are you programming it in?
>>
>>69761586
>...and then consequently enslaved them myself
>>
I'm gonna have to get my hands dirty with the frontend
What is the patrician's choice of minimal, reliable SAP framework with decent ecosystem?

inb4 >>/wdg/
i said patrician's choice
>>
>>69761629
It doesn't, but those servos can break that plastic really fucking fast.
I mean it's not a big problem, but time consuming.
Either way: I somehow want this to get a "real" robotics project and not only some lame arduino hack. So basically a second reason to go small steps.

PS: I am using ROS2 and as it seem there are close to 0 open source project with it yet (it's still beta). Maybe I can be one of the first ones and help the community or something. Starting with old ROS1 didnt sound motivating
>>
>>69761643
/pol/ hates God
>>69761657
things that never happened
>>
>>69761649
>what hardware are you using?
x86 (my desktop. Raspi or odroid h2 in the future. not sure yet)
pololu mini maestro pwm controller
counterfeit towerpro mg996r servos (real ones are on their way)
>what are you programming it in?
ROS2 (aka c++17 for now. Later maybe python too)
>>
File: Drunk_Kobayashi_Python.png (220 KB, 640x362)
220 KB
220 KB PNG
>>69761586
Circular queues (and other basic data structures) in python because I'm doing the CS degree meme. In a few week they'll let me start oop with java. How accurate are the java horror stories?
>>69761667
That's a really cool looking project - how long have you been doing robotics stuff anon?
>>
Serious question: why do people on this board WORSHIP C?
>>
>>69761720
They like larping as embedded devs
>>
>>69761712
java is very verbose and ugly but you can generally tell what a java program means by reading it. It's certainly not arcane, it's just boring.
>>
>>69761720
that's a strong word to be using in all caps
>>
High performance web api for websockets
Nim or C#?
>>
>>69761720
Is SICP not the hot meme on /g/ anymore?
>>
File: stable.webm (2.5 MB, 1280x720)
2.5 MB
2.5 MB WEBM
>>69761712
>how long have you been doing robotics stuff anon?
since oktober 18 or something lol.
I shitposted here quite often with my first shitty prototype which was a real hacker solution. webm related.
Since one more servo fucked itself and i didnt have anymore spare ones i moved on instead of buying new ones of those shitty plastic servos.
>>
File: 1547816204146.jpg (356 KB, 1280x720)
356 KB
356 KB JPG
>>69761745
>>
File: size.jpg (1.03 MB, 3000x2000)
1.03 MB
1.03 MB JPG
>>69761712
>>69761748
size comparison
>>
>>69761662
vue.js
>>
>>69761586
Is the visitor pattern useless now that C++ has std::variant? They accomplish essentially the same thing.
>>
File: 1549542259826.png (184 KB, 697x493)
184 KB
184 KB PNG
>>69761643
.

Trying out Rust, the build tools are nice, but the syntax seems off at times.
Going restart my Roguelike project in it and look at the language more deeply.
>>
>>69761858
Not really? The visitor pattern is a hack for languages that lack multimethods. std::variant is the closed polymorphic analogue to base classes.
>>
>>69761881
I meant they both allow me to easily add operations to a data structure but reduce flexibility in adding types. When is a visitor better than std::variant?
>>
>>69761943
linear
>>
>>69761943
-o

https://www.youtube.com/watch?v=t0mhvd3-60Y
>>
>>69761943
linear and unique aren't always the same though
>>
File: 1539382155556.jpg (481 KB, 1200x1730)
481 KB
481 KB JPG
Can one of you Cniles explain what's happening here (or how it's called so I can look it up on google).
char *something[] = {
[FOO] = "ur waifu a garbage",
[BAR] = "blah";
};

specifically that weird [FOO] here ? what's the type of FOO?
>>
>>69762059
designated initialiser
>>
>>69761592
nice
>>
>>69762059
This is a designated initializer. FOO and BAR are (I presume) macros containing integers. This initializes those specific elements of the array.
>>
>>69761742
Go
>>
>>69761943
T:1
>>
>>69762085
fuck
>>
>>69762080
>>69762074
thx
>>
>>69761758
>Don't speak to me or my son ever again.
>>
File: hellopleasewtf.png (4 KB, 256x109)
4 KB
4 KB PNG
Hello, could someone please tell me why in the ever loving fuck I can't simply write it like this?
>>
>>69762076
Thanks!
>>
File: 1548244378016.jpg (76 KB, 563x530)
76 KB
76 KB JPG
>>69762128
>that 2 1 0 case
Absolutely disgusting.
>>
>>69762144
Pointers do not have a size member function - or any member function. They are not aware of their size in any capacity.

It is typical to pass a size with a pointer to a function. Use the size_t typedef.
>>
>>69762144
Because C doesn't have methods
>>
>>69762144
a doesn't have a .size() method. Cause it's a raw array.

Is that C, C++ or Java?
Java -> it's
a.length

C -> you can't
>>
>>69762144
1) Does a lot of work in a seemingly simple statement (contrary to C principles)
2) When people nest this stuff it gets very involved, unintuitive and inflexible like R
>>
>>69762166
>>69762166
my boomer-ass teaching assistant gave us this assignment like that, the int v[] stuff is me tho.
>>
>>69762144
in what language?
>>
>>69762144
`a' is just a pointer under the hood
>>
>>69762144
>>69762192
I suppose the int n parameter is what's telling you the size of the array that a points to. It's assuming that your boomer is doing its job properly ofc.
>>
>>69762144
VLAs are terrifying. Please, think of the stack frames and reconsider.
>>
>>69762221
stfu this MIT nigger is clearly a beginner and the nigger shepherd clearly set it up that way so who gives a shit.
>>
>>69762221
>allocating to heap when you could just use VLA
>>
>>69762166
>what is K&R coding style
kys moron
>>
>>69762221
The stack is already a dynamic data structure if you're using function pointers. Embrace it.
>>
>>69762241
slightly less shit / 10
>>
>>69762134
myFun :: Int:1 -> Int
>>
i have weekly seminars and i need to represent their starting times. how do i represent them when they only consist of a day of week and time? (eg. monday 8am). both in sql and in the application layer. preferrably something, that could be queried for example "give me 5 upcoming events from today"
>>
>>69762144
You probably have to type (a.size()-1) cause a.size is probably the legit size but the last index is most likely one less than that cause it probably starts at index 0
>>
>>69762264
why not just natural numbers? e.g. monday = 1 (or 0 if you prefer), tuesday = 2, ... friday
7am or 8am (whenever earliest possible is) = 1 (or 0), 7:30 = 2, etc
>>
How do you guys get in the flow of learning new things, when you're not feeling it?
I've been in a slump with learning iOS development for the past week, I haven't really done much.
Breaking my routine surely hurt that a lot, but I also lost both discipline and motivation for it.

I know discipline is more long-term and important than motivation, but how do you guys motivate yourselves in the short-term, to get back in a good routine to become more self-disciplined with learning, again?
>>
>>69762280
querying that would be pretty gay but i guess that i have no other option
>>
>>69762299
just translate back and forth
hell you could even use another table to store the text Monday ... Friday and the numbers, then do a join or whatever bullshit SQL programmers do
>>
>>69762323
okay thanks anon
>>
File: 1519365489772.gif (353 KB, 350x197)
353 KB
353 KB GIF
>>69762074
double thanks senpai!
>>
File: 1547981901101.jpg (103 KB, 1280x720)
103 KB
103 KB JPG
>>69762374
>>
>>69762281
myFun :: Int:1 -> Int
myFun x = x + y
where y :: Int:1
y = 2
>>
>>69762290
self-hypnosis
>>
>>69762290
I fake it until I get the motivation back. Try to get yourself to stick to something for as long as you can, and remember that any work you put into it is still work (ie. spending a few hours to accomplish something small seems poor and you generally would beat yourself up over it, but compared with no progress its still net better. Or maybe you could only stay focused for 15 minutes before getting pulled away, 15 minutes is still time spent and now you have a goal to beat).

I generally go to the library to work on anything important. Helpful because its quiet and its an easy escape from big distractions like porn/vidya/youtube/etc. Do whatever you can to elimizzle distractions, make your bed, go work outside, etc
>>
Posted >>69761714 without looking at the reply count because I'm dumb as hell

Anyway hit me with those sweet embedded programming resources
>>
File: 1546314710936.png (607 KB, 1788x990)
607 KB
607 KB PNG
>>69761586
fn rot13(string: String) -> String {
let alphabet = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
];

string.chars()
.map(|c| *alphabet.iter()
.chain(alphabet.iter())
.skip_while(|&x| *x != c)
.nth(13)
.unwrap_or(&c))
.collect()
}
>>
>>69761592
I'm fucking retarded, I had used malloc like an idiot and had structured the function around that. What a waste of time, holy shit.
>>
>>69762522
looks like java and scala mashup. yuck
>>
>>69762585
what about it looks like java and scala?
>>
how do I start learning to program? I'm a complete novice with no experience, I want to use programming top make video games and such.
>>
>>69762616
Find an introductory book on Python programming with detailed guides, bone up on the programming basics with that. Once you can start writing simple programs on your own for your own needs move on the more theoretical computer science literature. Data structures and algorithms will be super helpful to understand (if you aren't going into CS worry more about algorithms and their applications instead of the implementation minutia), and start looking into how game engines work. From there you can explore Python libraries for that or you can embark on writing your own engine for some game.
>>
I made console ASCII Flappy Bird in Python. I guess it could use a bit better ascii graphics, though.
>>
>>69762737
>python
Don't do this.
Before I'm called a Cphile. Learning python gives you a horrible first impression on programming. Not only that but it's so unreadable. I started with python it took me years to get on anything else
>>
File: Untitled.png (226 KB, 1129x1192)
226 KB
226 KB PNG
>mfw pajeet c++ code that arbitrarily leaves out braces for conditionals just because there is a single line in the code block
>and in cases where there are braces they put the opening brace at the end of the first line, often just barely visible inbetween other parentheses and comments
>macros copiously sprinkled all around

it is like they want future people adding lines to the code to mess up

and there are people who think this style is more legible
>>
>>69762797
There's literally nothing wrong with that, you retard.
>>
>>69762597
String and method chaining
>>
File: 1549351854287.png (6 KB, 246x205)
6 KB
6 KB PNG
>>69762827
if ast.contains("String"):
assert language == Java
if ast.contains(Ufcs)
assert language == Scala
>>
>>69762860
Scala doesn't have UFCS dummy
>>
>>69762874
That was not method chaining either
>>
>>69762522
Of course the fedora uses Rust.
>>
File: 1547998446687.png (246 KB, 882x1025)
246 KB
246 KB PNG
>>69762893
if ! person.thoughts().is_contained(grepill_book.thoughts::<allowed>()):
assert person.tips(fedora)
>>
>>69761720
Because it's a solid language, works on everything, is easy to understand and is the basis of almost every computer language.
>>
>>69761720
/g/ does not worship C, only suckless retard boomers do
>>
File: 1532551555825.png (202 KB, 400x474)
202 KB
202 KB PNG
>>69762892
>>
>>69762820
it is very not OK
>>
working on this:
https://github.com/precla/iuvui

next goals:
- choose better font
- organize the ui layout
- add histogram for power consumption
>>
>>69763009
In what movie do they use C? Or any real programming language? Sometimes they use some shell script, but more often it's some GUI or 3D nonsense.
>>
>>69763021
>not using GTK
>>
File: literally_a_foot.png (243 KB, 1540x1067)
243 KB
243 KB PNG
>>69763051
>using GTK
>>
>>69763080
yea let's see how nuklear's filechooser looks like
oh it doesn't even exist
>>
>>69762760
lmao that's complete bullshit, fuck you

I have a degree in computer engineering. My degree used C for about 80-90% of the material. My job is 100% in C. You're just plain wrong.

If it took you years to figure out anything else other than Python it's because you're a fucking moron.
>>
>>69763095
GTK is a perfect example how C is an uninstallable, unmaintainable piece of garbage.
The only reason it's popular is because C is the lowest common denominator of any language and it has a lot of bindings.
>>
>>69763124
>uninstallable
unscallable*
>>
(linkposter here)
>>69763095
I don't need a filechooser.
Just a simple GUI to draw a few buttons and sliders.
Nuklear is single-header and quite easy to use so I went with it.
I also thought about using QT, but since I wanted to use C only, I decided to go this way.
>>
>>69763155
Use ncurses like a real man
>>
>>69762797
>ifdef instead of if constexpr
fuckin yikes
>>
>>69763155
I understand
However I was saying that GTK is better integrated in Linux desktops, it lets you be font scaling aware, makes you define a proper AppID and session and power management integrates well with gtk.
>>
>>69763184
Thanks for the information. I'll keep it in my mind.
For now I'll see how much I can get out of nuklear :)
>>
>>69762422
Thanks for the advice, m8.
I'll probably start putting more effort into eliminating distractions around my apartment (I have way too much shit I have nagging me like an IKEA dressers that I've been meaning to build for over 6 months) and going to the library would probably be a good idea, too.

I've tried programming at coffee shops, but I always end up talking to the baristas when they're not busy, getting distracted with loud people, or feeling like people are wondering why a 25 year old is at a coffee shop doing literally nothing when I can't manage to get my shit together and do work.
>>
File: foot.png (11 KB, 300x100)
11 KB
11 KB PNG
>>69763124
it is not C that is the problem with GTK, but that their developers are completely retarded
they remove features and replace them with (to borrow your tearms) features that the lowest common denominator of users MIGHT find more userfriendly

the image in the post is an example. Typing to highlight a file/directory in the filechooser, using the arrow keys to go up or down, and pressing return to recursively enter a new directory -- it worked fairly well
with gtk3 and a bit, they removed it entirely and replaced it with a feature where if you type something in the file selector, it either
>starts a recursive search for what you typed
>starts a 1 layer deep search incase you disabled recursive search
there is no way to have the old behaviour that literally every other graphichal file manager uses where the file with the prefix you typed gets highlighted
their search is even retarded in that it checks for substrings, not prefixes.

thankfully it is possible to revert the behaviour with a fairly small patch, but as the nignog in that WONTFIX-issue said:
>I dont want to add an option for this

and then there is the retarded GTK3 extra vertical padding between elements because somehow doing it separately for touchdevices is 2complex.

Also the disaster of a 10-20 year old issue with no thumbnails except if you use hacky solutions like patching it (slightly unstable) in or patching firefox to use qt (buggy)

it is as if they run the HCI usability tests they circlejerk about when closing issues as WONTFIX on a fresh install with zero configuration or programs installed, see that it works in the trivial case, and calls it a better solution for every user.
or their usability tests are defined in contrived ways that obviously favour their implementation, but the older and/or proposed ways of doing stuff get dumb assumptions tacked onto them, like the user not knowing the general layout of their directory structure.

yes I mad
>>
Are there any good websites to use to get into freelance work?
How is UpWork?

I'm still pretty new to programming, so I thought it might be a good way for me to get some extra practice while making some side money, before I land a real job.
>>
>>69763241
This shit is why I just avoid GUIs as much as possible.
>>
>>69763241
>Also the disaster of a 10-20 year old issue with no thumbnails except if you use hacky solutions like patching it (slightly unstable) in or patching firefox to use qt (buggy)
QT is so superior to GTK that it's not even funny. It should definitely be made the default
>>
>>69763124
Not only that, it's also one of the most glaring examples of feature envy.
>haha! exceptions are bloat! take that!
>u-uh, how about w-we make something like GError?
Seriously stop using C. It has no place in the 21st century.
>>
>>69763325
So would it be worth my time to pickup some freelance jobs that are directly related to what I want to do in a career field?
I'd like to get some short-term practice to help with my confidence.
>>
>>69763325
That's retarded. Experience in one field won't interfere with you entering another field. And if it did, you could just omit that stuff from your CV.
>>
>>69763236
Go build one of those dressers, anon. They honestly don't take as long as you think and getting *something* done is the first step to productivity.

I suffer from depression and anxiety that occasionally put me in a motivational black hole. I can just sit and stare at shit on TV without actually watching for hours, doing nothing, thinking nothing, feeling like shit. But the thing that always breaks me out of it is to find something smaller to complete, because it changes your mindset just a little bit. If you can allow that to snowball (TAKING BREAKS IF NECESSARY, burning yourself out will set you back to before square one) you'll find yourself moving on to the larger more complex tasks without much effort.
>>
>his language cannot repeat a function several times without calling some shitty loop or supporting function
May as well type the functions out by hand each time. Disgusting non-functional languages.
>>
>>69763435
You mean a function that does
foo . foo . foo . foo $ x
for n repetitions of foo?
>>
File: gmode.jpg (68 KB, 1280x720)
68 KB
68 KB JPG
https://www.zdnet.com/article/microsoft-70-percent-of-all-security-bugs-are-memory-safety-issues/

"Microsoft: 70 percent of all security bugs are memory safety issues

The reason for this high percentage is because Windows has been written mostly in C and C++, two "memory-unsafe" programming languages that allow developers fine-grained control of the memory addresses where their code can be executed. One slip-up in the developers' memory management code can lead to a slew of memory safety errors that attackers can exploit with dangerous and intrusive consequences --such as remote code execution or elevation of privilege flaws."
>>
File: 1548734702683.gif (258 KB, 734x490)
258 KB
258 KB GIF
>>69763527
>all those use after free
gee I wonder if there's anything that'd help us with it
>>
>>69763479
That counts yeah.
>>
>>69763466
not him, but I assume that's anything that is defined recursively
repeat x = x : repeat x
>>
>>69763592
You could even do that in Java.
private static <T> Function<T, T> repeat(Function<T, T> f, int n)
{
return n == 0 ? (t -> t) : f.andThen(repeat(f, n - 1));
}
>>
>>69763611
State of Javalets using that many characters just to repeat a function. Fucking disgusting
>>
>>69763581
the solution is crypto cpu where the data is always encrypted
>>
>>69763491
Can I be a freelance latexer
>>
Is there a function in Python that will return the "true" name of a file? Something like this:
my_imaginary_function("~/Documents/recipe.txt") == "recipe.txt"

should evaluate to True desu.
>>
>>69763491
>Just make sure that you don't see yourself having a midlife crisis in ten-odd years after working on something that has no meaning to you.
desu
>>
>>69763678
Start at the end of the inputted string, then work backwards until you can find the first symbol that represents a directory (/, in your case) and then grab the content from the point + 1 till the end.
>>
>>69763678
basename?
>>
(defparameter lst '((1 2) (3 4 5) (6) (7 8)))
(loop for x in lst nconc x)

What's wrong with this code, /g/? Keep in mind that under real conditions (with a complex actual lst rather than this example), this can cause the repl to never respond.
>>
i genuinely don't understand why we don't link everything statically in 2019
>>
>>69763678
os.path.split or something or you could just have that function return everything after the last /, but since you're using python, you're probably too dumb to do that
>>
i only know the lamda calculus. what is employable language can I easily transfer to and use that kbowledge.
>>
>>69763714
>>69763716
>>69763731
very low iq responses. i already figured out a superior solution
>>
>>69763758
Javascript
>>
>>69763730
Static linking is a Unix meme.
>>
>>69762760
this guy is trolling
>>
>>69763758
Haskell of course.
>>
>>69762820
Enjoy your goto fail, retard.
>>
>>69761720
it saves them the trouble of learning anything new
>>
>>69763760
pray tell
>>
>>69762926
>Because it's a fragile language, works on everything, is full of undefined behavior, and is the basis of almost every computer bug.
FTFY
>>
>>69763760
If you used regex you honestly need to consider suicide. If you don't know why I'm saying this, you need to skip the consider step and go straight to implementation.
>>
>>69762522
>you're not an atheist, are you?
OP here. Actually, I am.
>>
>who is kepler
>who is euler
>who is leibniz
>who is donald knuth
>>
>>69763581
Side channel attacks are not too difficult to defeat, you just have to make sure you're thorough.
https://en.wikipedia.org/wiki/Security_type_system
That's where one of these babies can help.
>>
File: 0why?.png (35 KB, 367x724)
35 KB
35 KB PNG
so this is returning 0 for the standard deviation when I do sqrt(stddev) which makes no sense whatsoever because I did a cout << stddev at that point = 1.25, which something non zero shouldn't return a sqrt of zero. I tried it with return sqrt 4 and it gave me 2, which proves its working so wtf?
>>
We /sci/ now I guess
>>
>>69763943
you need 2(two) equal signs in that if statement at the bottom, friendo
>>
File: 1522941285302.jpg (401 KB, 1200x1600)
401 KB
401 KB JPG
>Science—in the sense of real, positive and empirical knowledge—can only subsist in what is physical; and that in the non-physical there can be no science, so that the scientific method neglects it and abandons it, by lack of authority, to belief, to the dull and arbitrary abstractions of philosophy, or to the “exigencies” of sentiment and morality.
>>
>>69763758
haskell desu
>>
>>69761662
http://vanilla-js.com/
>>
>>69764105
>>69763788
No job..
>>
>>69764177
Apex cope
>>
>>69764177
no, those are frankists
>>
File: name.jpg (5 KB, 189x166)
5 KB
5 KB JPG
uber noob in js here
why does pic related not work ?
>>
>>69764197
Those are distinct object references with the same value. == and === check reference equality.
>>
>>69764197
it's probably comparing the memory addresses of the two lists instead of their values
>>
>>69764197
Because you're using the j**s' language.
>>
>>69764197
https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript
>>
>>69764215
That's (((Lisp))).
>>
Someone please make a new thread, I don't give a fuck about the bump limit this whole thread is cancer.
>>
>>69764237
if !meme<npc>.used(properly<like_you_are_supposed_to>):
assert you == commie
>>
>>69764251
it will just flow over to the new thread
>>
>>69764250
Pure cringe
>>
>>69764251
This but unironically
>>
>>69764285
>The best physicists literally know next to nothing about the universe
>so it must be the space daddy
>>
>>69764301
That's not at all what I said, learn to read you spastic
>>
>>69761586
Post Yuki next thread hopefully that prevents this from happening again
>>
>>69764207
>>69764217
dude i still dont get it, people are saying to just write multiple loops, i get that.
But what i want to know is why comparing 2 identical arrays will resolve an error ? Does the '==' operator not work with arrays ?
>>
>>69764332
I'm a PhD student you neet.
>>
>>69764314
This wouldn't happen in a Yuno thread.
>>
>>69764328
saying Christianity is better than cannibalism is not religious propaganda
>>
>>69764344
Sure you're sweetie
>>
Finish your retarded argument here.

>>69764346
>>69764346
>>69764346
>>
Why do christcucks ruin every thread they touch?
>>
>>69764357
Saying sp*niards brought modern sanitation into the Americas (fucking lol) is totally propaganda
>>
>>69764307
That's literally what you said by definition. Just because you decide to change the meaning of words so that you can pretend to have the high ground doesn't actually change the meaning of words (thankfully).
>>
>>69764378
I said that we can't know the true nature of the universe. The fact that you somehow got "lol space daddy" out of that is hilarious
>>
>>69764344
Women's studies are not an actual study, honey.
>>
>>69764337
Google "reference equality" and "value equality" until you get it, retard.
>>
new thread

>>69764415
>>69764415
>>69764415
>>
>>69764426
Retard
>>
>>69764401
You know full well that's not what you said.
>>
>>69764435
>scroll up
>reread what I wrote
Yeah no, you're still retarded as fuck
>>
>>69764470
Just because you can't cope with your incapability to think, read, or write, doesn't mean what you said wasn't said.
>>
>>69764485
You are bafflingly retarded.
>>
>>69764492
Wow, what an amazingly well thought-out reply. Phenomenal. Truly a work of art. You, sir, win the internet. What the fuck. I'm a christian now.
>>
>>69764513
I'm not even religious you fucking idiot, you clearly didn't even read what I said
>>
>>69764529
Oh no! It's retarded :(
>>
>>69764583
This is why nobody likes atheists, you're just christcucks who read 2 chapters of a physics textbook and fap to Neil DeGrasse Tyson
>>
>>69764605
>i'm too dumb to understand science: the post
>>
>>69764616
I'm actually a physicist, stop projecting and do your pre-algebra homework.
>>
Rate my deck shuffler :D
https://pastebin.com/gVJ1nbV7
>>
>>69765291
nice someone in /dpt/ is actually making something
>>
File: IMG_20190129_222405.jpg (17 KB, 295x258)
17 KB
17 KB JPG
>>69765291
it's fine except for the disgusting wretched vomit-inducing piece of garbage autistic drooling retard trash fucking nigger monkey newline-before-opening-brace style, please fix that.
>>
>>69765403
I'm just following K&R style.
>>
>>69765414
Fair.
>>
>>69765403
Shut up nigger
>>
>>69765470
who the fuck asked you retard shut the fuck up uwu
>>
>>69765403
Agreed.
>>
>00110001 = 1
>this is what programmers actually believe
>>
>>69761592
Power level status: revealed.
>>
>>69765720
Meh, it's not a big deal. The worst thing is my name is on the pretentious side
>>
>>69764337
no the == operator does not work for arrays, it doesnt work for objects either

> ['shit', 'nigger'] == ['shit', 'nigger']
false

>{ a: 'shit', b: 'nigger' } == { a: 'shit', b: 'nigger' }
false

> 'shit nigger' == 'shit nigger'
true

leave == to basic data types and use functions to compare object types (if those even exist)
>>
>>69761586
Cute conquistador.
>>
>>69761662
>>>/wdg/
>>
#!/bin/sh
if test -n "$(grep 1 /sys/class/net/wlp4s0/carrier)"; then
echo ""
else
echo "<span color='#ff0000'></span>"
fi

tell me why my script to check if I have a wireless connection is shit
>>
>>69761720
C is a language with some flaws, chief among them being it's very easy to create all kinds of memory bugs if you're not careful. The main benefits are simplicity and speed. In a professional environment, where programmers of many different skill levels and areas of expertise work, the costs of C outweigh the benefits because companies simply can't invest the money into making sure all their programmers follow the best C practices and don't fuck everything up. /g/ does not understand this because most of them are NEETs and believe that any piece of software is created by one person, and that mastering some bullshit language from some bullshit OS from the 70's makes them a better programmer somehow. The obsession with speed comes from the fact that a lot of /g/ users have decade-old laptops that need more than half the available RAM just to run X. Don't listen to /g/ when it comes to programming languages.
>>
>>69766862
Supposedly C++infinity is getting spaceship operators that are supposed to test equality of objects.
>>
>>69766862
>>69767634
Possible in D already.
>>
>>69767657
Nobody cares or uses that pajeetlang
>>
>>69767665
>pajeetlang
Actually don't think I've seen a single pajeet so for using it, but i'm sure they exist.
>>
>>69767677
It's oop. It will never be big nobody cares. Ghetto oop integration isn't even the buzz anymore. People want shoehorned lambda now
>>
>>69767702
eh, it's multi-paradigm, i actually use it like an FPL more than anything. And don't have a single Class in anything.
Going back to langs without UFCS is gross.
>>
>>69767705
can it get me a job ? be my first ever programming language?
>>
>>69767736
>can it get me a job ?
If you're in Germany and Funkwerk are hiring.
But probably not. You'd have to convert your coworkers and manager to it.
>>
>>69767746
guess ill kill myself
>>
File: file.png (407 KB, 1080x1367)
407 KB
407 KB PNG
Do you have a subservient class of programmer working under you that needs to address you as "Ms. Anon" and is generally treated like shit?
>>
>>69761586
Sounds like Rome conquering northern Europe.
>>
>>69761586
Learning vulkan currently.
>>
What does /g/ recommend to reduce eye strain. I just took lasik surgery so I want to reduce the damage my eyes while programing.
>>
>>69770591
turn down brightness.
use flux or manually change your screen's color temperature.
And there's also silly glasses you can buy, no idea if they're actually legitimate or not.
>>
>>69770617
>And there's also silly glasses you can buy, no idea if they're actually legitimate or not.
They're called sunglasses, you fucking retard.
>>
>>69770640
nah the gaymen glasses are different to sunglasses.
>>
I have this script. The system compiling it gives error saying to takes too long to compile.
Can anybody give some help on slimming it down? There must be a way not to make it look so retarded. thanks in advance.

full script is here.

but i think the actual problem with the script is in the if/else functions such as


shade(val) =>
if val<=-0.96
colorX
else
if val <=-0.9
colorY
else
etcetera
>>
https://pastebin.com/xQkpMzp3
the fuck i forgot to paste the pastebin link
>>69771206
>>
>>69771206
>but i think the actual problem with the script is in the if/else functions such as
Why not just cut 90 % of those off to see if it compiles then?
>>
>>69771477
it does compile, but i need all those colors you see there.
is there a way to optimize the code?
>>
>>69761586
constraint logic programming over finite domains
>>
>>69771488
Well, I'm not familiar with that language, but there are certainly ways to write that differently. For instance, you could save those colors in an array and choose the correct index by multiplying and rounding the value. Another way would be to simply create a loop with just one "if <= x", where x is updated every loop. And maybe there's even a switch-function. Or some distribution function. Who knows.
>>
File: unflip.jpg (296 KB, 1074x1149)
296 KB
296 KB JPG
>>69761586
What are you working on, /g/?

Last thread: >>69764346
>>
>>69761586
fuck you
>>
>>69771764
working on getting fucking jacked because nobody cares how good you are at programming
>>
>>69771599
shit man, i dont know how to do that on Pine Script.
>>
Was Terry a good programmer? Was his code of good quality?
>>
>>69772107
while you were busy worrying about code quality and reading Clean Code, Terry was writing his own compiler because he gets shit done.
>>
https://www.zdnet.com/article/microsoft-70-percent-of-all-security-bugs-are-memory-safety-issues/
>>
File: 1549734155230.png (42 KB, 189x202)
42 KB
42 KB PNG
>I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.
t. Tony Hoare

CNILES BTFO
>>
File: 1549329908398.png (56 KB, 195x217)
56 KB
56 KB PNG
The fuck is wrong with this tranny language? I just wanted to print the numbers 1 through 10 not mapM_Q_X_P_ $
main = mapM_ putStrLn $ map show [1..10]
>>
>>69772214
Security engineers and infosec people in general must be pretty grateful to the cnile retards who keep insisting that people "just code better bro, i don't make any mistakes so using C isn't a problem if you're not a brainlet!"

Cniles are singlehandedly keeping these people in well-paid jobs.
>>
>>69771764
working on getting fucking better at programming because nobody cares how jacked you are
>>
How do I escape double quotes in GNU troff?
.B "#include \"frandom_header.h\""

doesn't work.
>>
>>69772353
map(M)(_) can be composed.
main = mapM_ (putStrLn . show) [1..10]

The suffix is important. If you just used (f)map, you would have [IO ()]. Just M makes it IO [()]. M_ furthermore makes it IO (), which is the type of main.
>>
>>69772438
Why are you quoting the entire thing?
.B #include "frandom_header.h"
>>
>>69772314
to be fair, to implement something like linked lists you'd otherwise need something like ADTs, so in those simple languages null (or at least nullable) was kind of necessary
>>
Is it just me or is modbus rtu kind of dumb?
>>
I'm doing SICP's exercises so I can fit in better. SICP is in scheme but scheme is seems not to be that popular in current year.
What LISP dialect would you guys recommend?
Is common lisp close enough?
I'm also doing the Haskell course on edX but for SICP, I'm looking some something LISP like so I can brag on the internet
>>
>>69772515
that doesn't work quotes are invisible
i need quotes because if i have .BI instead of .B output is garbled without quotes
>>
guys help
I'm REAL fucking close to entering a global variable
>>
>>69772824
Nooooo my static analysis!
>>
>>69772824
nothing wrong with
>>
>>69772691
ok guys i figured it out it's
\(dq

for double quote desu.
>>
File: hating code.png (123 KB, 500x811)
123 KB
123 KB PNG
>>69772846
>>69772860
I think I figured out a better way, but that was real close
>>
>>69772860
Segmentation fault (core dumped)
>>
>>69772921
that's some serious reddit garbage right there
in fact, i think that shit is even dumb for reddit
>>
>>69772824
are global variables actually bad or is it a meme
>>
>>69772953
they shit up the namespace and make it hard to reason about them because you need to look at every possible location where the variable is used
>>
>>69772675
>scheme is seems not to be that popular in current year
Who cares, just use it to do the exercises.
Also, Scheme isn't even a language, it's just a specification with multiple competing implementations. If you want something modern, consider Guile.
>>
>>69772953
Like a lot of other criticised language constructs, they're fine if you use them where they're supposed to be used.
>>
>>69773071
Where are they "supposed" to be used then?
>>
Which is more pretentious, strong typing or no typing?
>>
>>69773110
Duck typing
>>
>>69773107
When you need a single instance of the data structure in the source file.
>>
>>69773140
Such as...
>>
>>69773110
No typing.
>>
>>69773189
Got it.
>>
File: Selection_442.png (14 KB, 120x407)
14 KB
14 KB PNG
Why aren't you working in 6502, anon? It's fun.
>>
>>69773436
>>69773462
Half this thread was deleted of that garbage, take a hint.
>>
>>69773421
ARM is more fun.
>>
>>69772107
No he is average at best. The impressive thing was his dedication.
>>
I have a piece of Haskell code that looks something like this
orphans :: Graph -> [Node]
orphans g = filter (\v -> not $ hasParent v g) (nodes g)


I would like to replace the lambda function with a partially applied function. Something in the style of
filter (not (flip hasParent) g) (nodes g)

but I can't figure out the correct syntax. Can I get some help?
>>
>>69773591
orphans :: Graph -> [Node]
orphans g = filter (not . flip hasParent g) (nodes g)
>>
>>69773591
wouldn't it just be
filter (not ((flip hasParent) g)) (nodes g)
>>
>>69773611
Thank you kindly. I'm going to try to understand why this works.

>>69773613
No, that doesn't work. Argument to not is wrong type.
>>
>>69773679
fyi, >>69773613
is wrong because (flip hasParent) g is a function.
once you realize that, it should be easy to see why >>69773611 works
>>
>>69773479
I don't really have a reason to work in ARM, I just work in 6502 to code for NES. Though I would most likely leap at the opportunity to work in ARM for a company.
>>
>>69773479
I literally hate arm so much the only based risc architecture is PowerPC
>>
>>69773707
I'm using ARM on the Nintendo DS right now. It's fun. Also scored an embedded internship at ARM in Cambridge later this year.
>>
>>69773693
I think i get it. It makes sense once I realized the operator precedence.
not . flip hasParent g

equals
not . (flip hasParent g) 

and not
(not . flip) hasParent g
>>
>>69773188
Not him, but usually the one place I'd use one is logging. It's usually too cumbersome to bring logging context everywhere with you.
>>
>>69773765
yup, function application basically has the highest precedence. $ works the way it does because it has the lowest precedence.
>>
>>69773765
Follow up question.

Can i take the expression
not . flip hasParent g
and get rif of the g, so that both g and v become implicit parameters?
>>
Any Java wizards wanna explain static to me? What does it mean? What is it actually doing to the member variables/functions?
What would be the C/C++ equivalent?
>>
>>69773932
The members are associated with the class rather than an instance of an object. You don't need an object to call it.

A static variable from Java would be implemented as a global variable in C.
C++ also has static variables and static member functions, which means the same thing as in Java.
>>
>>69773932
>What would be the C/C++ equivalent?
static

>EXPLAIN TO ME
read the free manual
>>
>>69773836
no.
open ghci, start with :t hasParent and keep adding more from your code, always checking the types.
look at the types and try to understand why.
>>
>>69773953
Explain to him.
>>
>>69773966
thanks
>>
>>69773836
I think you can do
((.).(.)) not (flip hasParent)

to get a function of type Graph -> Node ->Bool, but it's probably not going to fit in the code you got
>>
Okay, I'm trying to make the most pretentious language possible. It's functional and stack based. What obscure symbol should I use for printing instead of puts and how can I make this into a one liner?
+ = add 
1 2 add puts = main
>>
>>69773991
>((.).(.))
What's going on here?
>>
I'm in a linear algebra class, and I'm trying to write a program to do basic matrix operations in C as an exercise.
>>
>>69774002
You're not pretentious enough if you have to ask for advice.
>>
File: nani sore.png (2.44 MB, 1920x1080)
2.44 MB
2.44 MB PNG
>>69773991
>
((.).(.)) not (flip hasParent)

what the fuck is that.
>>
>>69774010
haskell tiddies
>>
>>69774018
Cool. That's a classic assignment, and kind of fun. Especially when they make you use your own matrix library for the rest of the assignments.
>>
>>69774026
takes a function of one arg and one of two args and composes them in a way such that the result of the one with two args is piped into the one with one args
>>
>>69762797
What's ever wrong with that? Are you blind to the fact that there's no closing brace on the one-liners?

I agree that having no space before the opening is cancer, though, but only because it looks ugly.
>>
>>69774044
I doubt it'll reach any real level of sophistication, I'm just doing it for fun.
>>
What are the best resources to learn AI?
>>
Does this invoke undefined behaviour?
struct Foo
{
static void bar() {};
};

((Foo*) nullptr)->bar();
>>
>>69774066
That's the best reason to do anything.
>>
>>69774081
Dereferencing NULL is undefined behavior, so yes.
>>
>>69772921
>hating the code you wrote 3 years ago
I hear people saying this all the time, but I've almost never experienced it myself. I'm starting to have some mild misgivings about the code I wrote 15 years ago, but that's about it.
>>
>>69773951
Ok... i think i get it... I guess i just gotta practice w it
>>
>>69773727
Power is like the least based RISC there is, except possible SPARC. Non-addressable link registers, speshul loop-count registers, condition codes, the world's weirdest TLB scheme are hardly based features. That's not to praise ARM, but at least AArch64 is arguably better than Power.
>>69773479
RISC-V is more fun.
>>
New thread:

>>69774177
>>69774177
>>69774177
>>
File: 1548539421808.jpg (24 KB, 446x604)
24 KB
24 KB JPG
GUI programming with wxPython
>>
>>69774189
We're not even bump limit yet, namefag.
>>
>>69774205
Yes we are, newfag.
>>
>>69774245
bump limit is 310
>>
>>69774245
bump limit is 310 you absolute actual newfag
>>
just wanted to post once more so the bump limit is reached
>>
>>69774252
>>69774257
He knows this, it's not first thread he makes. Just a fag.
https://rbt.asia/g/search/username/Jewish%20Overlord/
>>
Is there a benefit to marking parameters as const in C? I've made a habit of doing this if I'm not modifying a parameter and I don't know if it's worth the time or not
>>
>>69774282
Also for anybody curious, this is him too.
>>69749453
>>69702882
>>69681619
>>69674672
I'm not going to shit up the thread by posting it there, but he's the anti-anime fag with the shitpost images. It's very likely he made this thread too.
>>
>>69774069
This book.

Deep Learning (Adaptive Computation and Machine Learning series)
by Ian Goodfellow, Yoshua Bengio, Aaron Courville & Francis Bach
>>
>>69762797
A pointer does not inherently make NULL equal to 0. You can compare NULL to zero, but it's still not proper. One should explicitly compare pointer == (void *)0 or NULL. A weird technically that exists in C++ it inherited from C, that 0 can be promoted to a NULL pointer, but a NULL pointer is not inherently 0, nor will be converted to 0 in a non-pointer context. 99% of the time wouldn't matter, but if you're doing embedded it's worth mentioning.
>>
>>69775382
would the promotion not be performed for the comparison?
>>
>>69763527
Considering the Linux kernel has fewer than 1/10 the bugs, period, and is only written in C, it implies C++ and bad programming practices are the cause, not a use of an unchecked language.
>>
>>69772314
Null was a natural extension of the null-terminated string, and in the case of \0, the "invalid" character. It's not just important, it's necessary in a language construct which doesn't guarantee the validity of every pointer at all points in code, or a built-in safe return from invalid access.
>>
>>69775469
== is a comparison of value, so I think in theory whichever has the larger type may be preferred (an int has sizeof(int), which may be smaller or larger than the range of the pointer). I haven't seen a guarantee of how values promote, but in safe code (like MISRA), all comparison should be completely explicit, and I think a suggestion, but not necessary, is that they should be "functions" or "function wrapped", because of how often conditional errors are made (by precedence and by == vs =). e.g. isNULL(pointer) is just a macro for == NULL.



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.