[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 314
Thread images: 34

File: 1504338162071.gif (95KB, 500x384px) Image search: [Google]
1504338162071.gif
95KB, 500x384px
What are you working on, /g/?

Old thread: >>62324489
>>
File: 1502863684539.jpg (67KB, 500x375px) Image search: [Google]
1502863684539.jpg
67KB, 500x375px
>>
working on my rss feed downloader in scala
>>
Why would I ever use
 fclose();
after I'm done with the file?
>>
>>62330497
Otherwise you'll leak the file descriptor.
>>
>>62330501
Goly shit, sounds like my dream lang
>>
can someone recommend me a good anime without sexual undertones?

thanks.
>>
>>62330552
What genre?

Try Claymore
>>
>>62330552
japari park
>>
>>62330552
Nichijou.
>>
Anyone else?
>>
Is this true, dpt?

>>>/v/389736819
>>>/v/389737064
>>>/v/389737593
>>
>>62330577
Claymore was a nice anime.
>>
>>62330608
I do it occasionally when I'm not satisfied with the performance I get, mostly to check if everything is inlined.
>>
ioccc.org/
>>
>>62330552
What are you, a faggot?
>>
A futalabi clone with newer technologies as a side project to learn MEAN like dev.
>>
>>62330399
What's the best C compiler for Linux?
>>
>>62330877
g++
>>
>>62330887
But that's wrong
>>
>>62330911
No it isn't.
Proof: I said so.
>>
Is there any pics floating about with some programming project ideas?
>>
Could a good programmer code straight asm better than the compiled asm of gcc?
>>
Learning vim and C++ at the same time.

would not recommend
>>
>>62330877
clang++ ofc
>gcc
Even Google thinks gcc and libstdc++ are outdated: https://github.com/android-ndk/ndk/wiki/Changelog-r16-beta1
>>
File: 1504953336683.png (260KB, 483x368px) Image search: [Google]
1504953336683.png
260KB, 483x368px
>>62330399
>glib-rs
https://people.gnome.org/~federico/blog/how-glib-rs-works-part-3.html
>>
>>62330552
Psycho Pass
>>
>>62330956
What is that link supposed to establish?
>>
>>62330946
possibly but it would take a long time
>>
>>62330946
No, modern CPUs are too complex to be able to keep everything in mind, stuff like caches, reordering, branch prediction, register usage, etc. The only exception is small pieces of highly vectorized AVX code, but it's better to use intrinsics for it.
>>
File: 1494781833171.jpg (83KB, 756x715px) Image search: [Google]
1494781833171.jpg
83KB, 756x715px
>>62330959
What's wrong with it?
>>
>>62330497
you don't have to do that in rust
>>
>>62330977
That GCC is not longer supported by Android NKD and libstdc++ is on its way out.
>>
>>62330959
Looks like a waste of time, GTK is dying, Rust community should focus on integration with Qt instead.
>>
>>62331015
How does Rust do deterministic resource management? Constructors and destructors?
>>
>>62330399
Can I get some book recommendations on C, besides K&R I mean.
>>
>>62331032
Yes, good old RAII.
>>
>>62331029
But Qt is OOP, Rust isn't.
>>62331032
RAII
>>
Before game release
https://youtu.be/rX0ItVEVjHc
>gained weight
>emotionally stressed throughout the entire talk
>coughing
After game release
https://youtu.be/qWJpI2adCcs
>slim
>calm and relaxed
>seemingly no health issues

Why do people want to be game developers? It seems seriously harmful to your health. You hear about the crunch being stressful but I don't see people actually measuring how bad it is.

Are there any more hardcore programmers though? I watched a GDC talk from the guy who thought up Diablo 1 and he had 8 months of crunch (wake up, drive to work while eating, work until 12AM, go home and sleep too little). He almost missed his daughter's birth. Shits crazy.
>>
>>62331029
https://www.vandenoever.info/blog/2017/09/04/rust_qt_binding_generator.html
>>
>>62330399
Okay so I compiled a C program but bash isn't executing it; it only returns 'command not found', even when I am at the directory of that program.
>>
>>62331114
./
>>
>>62331114
do
./program
rather than
program


the current directory is not part of your PATH
>>
>>62331114
You need to type ./nameofprogram
If you just type 'program' it will look in a variety of environment variable set paths for the executable.
./ means current directory.
>>
>>62331133
>>62331137
Okay, thanks.
>>
>>62331064
Some people unironically like crunches, kinda like being at war, facing a great challenge, then come home and sleep for a week. That Diablo dude mentioned that he liked crunches iirc. My gamedev buddy tells me that he performs best during crunches. I mean, if you are young, healthy, capable - why the hell not?
>>
>>62331029
Actually, GTKMM is much more sane than Qt.

Qt was implemented back when C++ wasn't really "standardized" and it has a lot of hacks around the standard C++ of today. They are so deeply rooted that they have a long way to fix those and not break backwards compatibility.
>>
>>62331168
>kinda like being at war
Anon you'll look like an absolute psycho bringing up being at war as a positive ever.
But I suppose you're right in theory. And I don't remember if he liked it or not. Maybe.
>>
>>62331101
Why are you antifa?
>>
>>62331235
I'm a nazi
>>
>>62330941
Bump
>>
>>62331235
i am actually not sympathetic towards antifa. but i have to pretend i am or else mozilla fires me :/
>>
>>62331283
No fuck off, you post this every fucking week
>>
File: 1481379867417.jpg (102KB, 1124x1024px) Image search: [Google]
1481379867417.jpg
102KB, 1124x1024px
>>62330399
What's the best language to learn for beginner?
Is it C or Basic? Are they any good for understanding basics of programming?
In a long term i want to do my software for smartphones, how hard will be switch from C to Java?
What are best online literature for learning? And why is there nothing in op about learning, most of the other generals have those kind of links in their
>>
>>62331313
If you want to be an Android developer, learn to be an Android developer.
>>
>>62331161
If you want to make your life easier, add the current directory to your PATH. Usually you would add it to the front, so you can override globally installed commands with local ones.

export PATH=./:$PATH


That only works for that session, but you can add that to the end of your .bashrc so it runs every time you run a bash session.
>>
>>62331313
Basic is a complete irrelevance.
Just start off learning Java. It's as simple as it gets while still being OOP.
>>
>>62331350
>java
it has been deprecated by google. learn go, or if you want into android dev lean dart.
>>
>>62331378
Huh, I thought that's what Android was all about. What's recommended now?
>>
>>62331313
Java's poor OOP was difficult for me to understand in the beginning. I don't recommend Java anymore. C will make you feel that programming is tedious.

I actually suggest you to learn D, it's a fairly decent language in all categories and the books is very beginner friendly too

http://ddili.org/ders/d.en/
>>
>>62331378
> if you want into android dev lean dart
Don't listen to this faggot. If you wanna be android dev learn kotlin.
>>
>>62331313
I started with C, and I think everyone else should too. The majority of the most popular languages in use today are procedural languages with OOP features on top. C is the epitome of a basic procedural language. It will be easier to move to Java, or C++, or many other languages because they all inherit C's syntax for purely procedural code.
>>
>>62331313
>is it hard to switch from C to Java.
No but it requires a different mentality where you have to accept that you won't know about all the things you'd normally know in C.
Also the way references are handled can also be confusing.
>>62331378
If we're going that way isn't Kotlin what you're supposed to learn? I'm not an android dev I just hear these things.
>>
>>62331394
>A beginner should learn a language with no community or resources
>>
>>62331404
C is meant for people giving the idea that Programming Languages hasn't evolved in the last half a century
>>
>>62331394
Hi, Andrei.
>>
>>62331404
>C is the epitome of basic procedural languages
No but it's certainly a very basic procedural language. All the UB kills it a bit as a teaching tool sadly. It's all very C specific.
>>
>>62331411
>no community or resources
To be quite honest, the D IRC channel is very helpful, there is ZERO elitism unlike C++ or C
>>
>>62331426
Don't forget about the Dlang forum, they are very patient with you as well.
>>
>>62331393
>>62331401
>>62331405
android will be deprecated soon. fuchsia is its successor. it uses flutter
>>
>>62331426
>elitism on IRC
NO WAY.
>>
>>62331438
Trust me, anon. The C/C++/FreeBSD/OpenBSD IRC have given people the wrong idea
>>
>>62331437
>fuchsia
>flutter
Stop speaking foreign Steve give it to me in American.
>>
File: 1498077278672.jpg (309KB, 849x565px) Image search: [Google]
1498077278672.jpg
309KB, 849x565px
>>62331437
>android will be deprecated soon
>>
>>62331292
This is my first time posting it m8 but i saw one ages ago so they obviously exist, maybe make a mini sticky or something for the general that contains that crap if you get so pissed off and it shits up the thread so often
>>
>>62331456
>>62331457
https://fuchsia.googlesource.com/
>>
>>62331437
Flutter is a joke. A coworker of mine wasted a week on researching it.
>>
>>62331437
Stop pretending to be Steve. It doesn't not make you look smart and it doesn't help you achieve anything
>>
>>62331456
fuschia is operating system developed by Google for small devices.
Flutter is SDK that let's you develop android/ios applications with dart
>>
>>62331480
https://fuchsia.googlesource.com/modular/+/master/examples/HOWTO_FLUTTER.md
>>
File: Screenshot_20170909-154558~01.png (909KB, 1080x1346px) Image search: [Google]
Screenshot_20170909-154558~01.png
909KB, 1080x1346px
>>62331464
Which one do you want?
>>
>>62331464
Few weeks ago:
>you: has anyone got the epic programming rolle lying around?
>No
>fuck off
>you: I will post that inspire of you *posts picture*
>more "fuck off" posts
Yeah I know your pattern
>>
>>62330941
>>>/b/
>>
>>62331492
>how to flutter
>step 1: dress like a fairy
No thank you.
>>
struct with dynamically allocated char* or fixed size char[]?
With fixed size char array it gets allocated with the struct reducing malloc calls. But the structure size is bigger, could it be worse for the cache?
>>
>>62331517
not an argument. android will be deprecated soon and fuchsia uses flutter for its ui
>>
>>62331424
That is probably my only reservation. I'm kind of pissed that the community decided to go with "leave the UB in and spend god-awful amounts of time developing UB sanitizers" instead of saying "fuck the standards commitee" and making a UB-less variant of C. I mean, how hard would it be to modify something like tcc for a formal demo of a UB-less C variant? After that I'm sure Clang and GCC would implement it. SafeC is a plenty good name. It would still be able to be ABI compatible with legacy code. I truly don't understand...

>>62331418
That's literally not an argument as why it shouldn't be taught as a first language. Allowing people to see how progress is made through abstractions allows people to understand why are how those abstractions are made. Thrust them into modern (as in template-abusing) C++ and they will not learn a goddamn thing.
>>
>>62331528
Use a flexible array member if you're not keeping the structs in an array.
>>
>>62331529
>not providing C API for native GUI
It's as bad as android at this point
>android will be deprecated
even if google stops supporting android people will still be using it and developing for it, too much existing software.
>>
>>62331566
magenta is superior to linux though.
https://fuchsia.googlesource.com/magenta/+/master/docs/concepts.md
>>
>>62331554
>That's literally not an argument as why it shouldn't be taught as a first language.
When people are taught Biology, they aren't required to major organic chemistry first. Don't be a fool, there is little or no reason to make people go though the history classes of how science has evolved.

The top down approach is much more intuitive and doesn't make people loose interest
>>
>>62331608
lose*

>>62331593
Fuck off, idiot
>>
>>62331613
>he gets triggered because someone said that linux is shit
poor babby. fork and exec were a mistake.
>>
>>62331497
It's alright m8, thanks for the info. Was looking around the internet last couple days and only found other peoples projects, thought /g/'s stuff would be on everyone hard drives and not floating about
>>62331499
Nope, i have the shit now so wont ever need to ask again
Heres some advice m8, next thread just copy paste

What are you working on, /g/?

Old thread: >>
>/g/ Programming challenges available on google image search
>>
>>62331623
First off, stop pretending to be steve, and second of all stop attention whoring you pathetic fucking trash
>>
>>62331636
stay true
>>
#define NUM 50

int array[NUM];

How many elements does the array have? 50 or 51?
>>
>>62331608
>The top down approach is much more intuitive and doesn't make people loose interest
Wrong and idk, I wouldn't agree. All things are a sum of parts, if you go top-down you only understand how one thing works. If you learn bottom-up you understand the parts and have the ability to see how different combinations result.

>When people are taught Biology, they aren't required to major organic chemistry first.
I honestly wish it was. Biology is a shitfest of pure memorization. That class is what made me switch to CE. Smart people can't do much with memorized facts, they have to given understanding.
>>
>>62331666
50. From 0 to 49.
>>
>>62331666
50.
So it would be invalid to do this.
int array[50];
array[50] = 10;
>>
>>62331672
Your biology teacher was shit, that's all
>>
>>62331680
>>62331676
Right.
Wonder why elements start from 0 and not 1. What is the logical reasoning?
>>
>>62331696
Oh he was. It was also a weed-out course at my Uni. The lecture focused on phylogeny (yeah...) while the lab was on microbial classification. The book was a typical Bio 1 course book (cellular anatomy, respiration, etc.), and the exams were on none of it. I got weed-out into CE and I'm glad I did.
>>
>>62331727
pointer arithmetic. x[y] is equivalent to
*(x + y)
>>
why isn't NT unixlike
>>
>>62331727
Pointer arithmetic. First element has an offset of 0.
>>
>>62331554
You really can't paint all of UB with one stroke. Some of it is absolutely great. Like integer overflow being undefined. It allows a lot of compiler freedom. Could of course be replaced with attributes (i.e annotating that this integer can't overflow). I'm kinda split on it. There's seemingly no good solution.
Some of it like not accepting twos compliment or making it a compiler flag or whatever is just silly and pointless.
Nobody seems to build a language that's so high level and so undefined in low level detail that you can truly replace C though. That's the real kicker.
>>62331629
>just clutter the op
No. Just don't be retarded and make a basic fucking Google search.
>>
>>62331757
kek my biology lecturer was a slutty milf. No one missed her classes yet the results were not so good.
>>
>>62331812
Well her students gave her D's. I guess she thought it was fitting to give them D's in turn.
>>
>>62331848
D is distinction
>>
>>62331761
Because Unix is shit.
>>
>>62331873
This explains why NT is such a garbage
>>
>>62331866
D is dead
>>
>>62331897
So is your git repo
>>
Can someone help me with this i think it's correct but it just hangs after i input a value


//Fucntion to calculate the absolute value of a number
#include <stdio.h>

float absoluteValue(float x){
if (x < 0){
x = -x;
}
return x;
}

//fucntion to compute the square root

float squareRoot(float x){
const float epsilon = .00001;
float guess = 1.0;

while (absoluteValue(guess * guess - x) >= epsilon){
guess = (x / guess + guess) / 2.0;
}
return guess;
}

int main (void){
float n,sqr;
printf("Which number would the like the square root of: ");
scanf("%f ", &x);
printf("squareRoot (%f) = %f \n", x, squareRoot(x));

return 0;
}
>>
>>62331895
nt turned out to be a better kernel despite the memes tbqh
>>
>>62331902
t. flustered andrei
>>
>>62331043
Pls respond (preferably with book recommendations)
>>
>>62331782
>Some of it is absolutely great. Like integer overflow being undefined.
Defining it as two's complement wrapping works well. I don't think there is a relevant computer in use that's decimal or one's complement. If there is, just don't use C on it.
Using a pointer after free: The pointer still holds an (invalid) value, the result of dereferencing it is not up to the compiler, the compiler must yield a load. The outcome is undefined, but the generated assembly is not.
Order of evaluation: left-to-right. done.

I could go on...
These decisions are the ones that most compilers already make (well maybe not the order of operations one). They just need to be codified by the retards who think C should be designed to be compatible with alien fucking technology.

>>62331866
>Britcuck
>>
>>62331908
>font rendering in the kernel
kek
>>
File: pasta2.png (2MB, 1532x5990px) Image search: [Google]
pasta2.png
2MB, 1532x5990px
>>62331908
>>
>>62331915
that "modern approach" book /dpt/ likes
whats wrong with kandr tho?
>>
>>62331895
Windows is garbage, NT is not. Yes, it's impossible to use NT without the shitty Windows operating system at the moment (inb4 ReactOS), but that doesn't take away from the fact that the kernel itself is solid. The only part of NT that's shit is NTFS (although it does have a lot of good features, it's just not a good filesystem in a technical sense), I don't know why they keep abandoning plans for successor filesystems.

>>62331942
Stopped reading when they claimed the 2k source leak was a mess, virtually every group that analysed it at the time commented on how well written it was. Whoever wrote this doesn't know what they're talking about.
>look they had some banter in the comments for an internal project that nobody else was supposed to read wow what a mess!!
>>
>>62331978
just like learn c

you don't need a book. I never used a book
>>
>>62331923
>C should be designed to be compatible with alien fucking technology.
C11 proves two's complement is more alien than threads.
>>
>>62331983
>Stopped reading when they claimed the 2k source leak was a mess, virtually every group that analysed it at the time commented on how well written it was. Whoever wrote this doesn't know what they're talking about.
>>look they had some banter in the comments for an internal project that nobody else was supposed to read wow what a mess!!
I like your mental gymnastics
>>
>>62331942
most of this pertains to windows as opposed to the nt kernel, they aren't the same thing
>>
>>62332029
NT is not used anywhere, hence NT was created for and meant for windows
>>
>>62331987
me neither lol, isn't c kinda brilliant?
>meanwhile 5 c++ books from different authors are on my table right now
>>
>>62332028
The banter in the comments has nothing to do with the quality of the code itself. Go look up the source leak for yourself, that is if you actually know enough to be able to read through it. I don't place too much stock in the intelligence of people who post copypasta in image form in place of an original argument, it usually implies they lack understanding on the subject and just want to repeat what they've heard elsewhere like a mindless drone.
>>
>>62331029
>Qt
Use Gtkmm. gtkmm developers tend to prefer gtkmm to Qt because gtkmm does things in a more C++ way. Qt originates from a time when C++ and the standard library were not standardized or well supported by compilers. It therefore duplicates a lot of stuff that is now in the standard library, such as containers and type information. Most significantly, they modified the C++ language to provide signals, so that Qt classes can not be used easily with non-Qt classes. gtkmm was able to use standard C++ to provide signals without changing the C++ language.
>>
>>62332061
I'm not saying anything because the guy who wrote it (who knows probably double as much as you) explained everything in detail. Your vague claim of "oh it was good, I "read" it is not really going to help
>>
>>62332089
He made some patently false claims about the quality of the source in the leak, and then blabbed on about flaws in Windows or other Microsoft software, neither of which have any relevance to a discussion about the NT kernel. I have already acknowledged that Windows is shit, and that yes NT and Windows are closely linked, but NT as a kernel is very solid and if it were to suddenly become free software I would not hesitate to use an OS that runs on top of it.
>>
any of /dpt/ work with code bootcamp graduates? they any good?
>>
>>62332089
But that's the thing, the edgy kids of /dpt/ will inherently think that NT was a godsend. Usually it's the kids that just got into programming themselves, from my experience :/
>>
>>62332133
Unix babies are the edgy teens.
>>
>>62332129
>He made some patently false claims about the quality of the source in the leak
You keep saying that, where was he false, I see proper justification and arguments to back his claims up. You are the one who's in the mood of "make believe" ITT, really. NT as windows is inseparable, Saying that a module of a project is heavenly while the whole project is trash doesn't add up
>>
>>62332133
the edgy kids of /dpt/ have never used a non-Microsoft OS
>>
File: 837812738123.jpg (29KB, 640x600px) Image search: [Google]
837812738123.jpg
29KB, 640x600px
Has anyone here ever implemented gpu font rendering?

>>62330674
>mostly to check if everything is inlined
If you really want something inlined you can just __forceinline
>>
File: dennis-ritchie.jpg (79KB, 660x480px) Image search: [Google]
dennis-ritchie.jpg
79KB, 660x480px
>>62332155
Sure thing, kid
>>
File: 1495359317161.png (2MB, 1214x1109px) Image search: [Google]
1495359317161.png
2MB, 1214x1109px
Employed Haskell programmer here
>>
>>62332130
I'm still attending to CS.

I understand that degree isn't an indicator to programming skill and any self-thought programmer can be better than any SC graduate, in fact I have to teach myself extra programming because CS only covers basics.
But if two people are on about same programming skill level, from as far as the initial interview can tell, why the hell would anyone pick memecamp guy over CS graduate?
>>
>>62332201
Guess I'll never interact with you, I don't eat fast food
>>
>>62332158
>proper justification
>"look these comments say curse words the code must be shit"
http://atdt.freeshell.org/k5/story_2004_2_15_71552_7795.html
>>
>>62332201
>>62332242
>Haskell programmer
>fast food joke

Like clockwork
>>
>>62332250
>Microsoft programmers also take their duty to warn others seriously.
Looks like a weak defence to me, if it's a hack call it a hack (which MS did but the fanboys won't admit even if it costs their lives), we all know NT is a pile of trash. No need to dance your way around it
>>
>>62332276
Read the whole article, dumbfuck.
>Despite the above, the quality of the code is generally excellent. Modules are small, and procedures generally fit on a single screen. The commenting is very detailed about intentions, but doesn't fall into "add one to i" redundancy.
>From the comments, it also appears that most of the uglier hacks are due to compatibility issues: either backward-compatibility, hardware compatibility or issues caused by particular software. Microsoft's vast compatibility strengths have clearly come at a cost, both in developer-sweat and the elegance (and hence stability and maintainability) of the code.
>The security risks from this code appear to be low. Microsoft do appear to be checking for buffer overruns in the obvious places. The amount of networking code here is small enough for Microsoft to easily check for any vulnerabilities that might be revealed
>In short, there is nothing really surprising in this leak. Microsoft does not steal open-source code. Their older code is flaky, their modern code excellent. Their programmers are skilled and enthusiastic. Problems are generally due to a trade-off of current quality against vast hardware, software and backward compatibility.
>>
Consider the following: [[a,b,c],[a,b,c],[a,c]]
How can I transform this to: [(a,b),(a,b)]
>>
Sometimes I think about how hardware gets faster but people get worse at coding, so nothing is really won.

I even get the feeling the retardation becomes even quicker than the progress of faster hardware.

An example of this is using Html/Css/Javascript for desktop applications.
>>
>>62332295
>Despite the above, the quality of the code is generally excellent.
So excellent that you hack around your shitty programs and you have to claim othewise
>Their older code is flaky, their modern code excellent.
Another weak and vague claim
> Their programmers are skilled and enthusiastic.
Another weak and vague claim
>Problems are generally due to a trade-off of current quality against vast hardware, software and backward compatibility.
NONE of the comments say that it's due to "hardware compatibility". Don't even try to pretend that Microsoft never broke any hardware compatibility
>>
>>62332318
what's the conceptual transformation there? like why does it end up with (a,b) and (a,b) and not (a,c)?
>>
>>62332327
I feel like people get worse at coding because hardware gets better.
>>
>>62332318
You're gonna need to specify it more precisely than that

>>62332327
We're solving bigger problems now. You're going to lose a bit of efficiency by using higher-level, pure functional languages, but the improvement in software quality that generally results is worth it.

>An example of this is using Html/Css/Javascript for desktop applications.
Oh, I see what you mean.

Yeah, that's a complete waste of resources
>>
>>62332318
What did you just do?
>>
>>62332345
>>62332358
>>62332372
I'm parsing XML. I got this far: https://pastebin.com/5Jq4f33B. What I want is to create pairs of <title> and <link> for each in <item>.
>>
>>62332318
def foo(l):
return [(e[0], e[1]) for e in filter(lambda x: len(x) == 3, l)]
>>
>>62332334
And the claims in the image you posted were any less "weak" and "vague"? He just said it's a spaghetti mess held together with paperclips and pasted a few comments in a (very weak) attempt to generalise the quality of a significant portion of the entire NT 4.0/Win2k codebase. Like I said before, you are welcome to browse through the source yourself and come to your own conclusions if you don't trust this analysis - most people who've done so come to the same conclusion that it's generally surprisingly well written.
>>
>>62332398
>python
get out
>>
>>62332410
>And the claims in the image you posted were any less "weak" and "vague"?
Read the "Beyond Repair" section, that alone gives a very clear argument to back his claims up. Stop pretending to be a stupid fanboy
>>
>>62332398
This works for the test case I posted, but fails on edge cases.
>>
>>62332483
>This works for the test case I posted, but fails on edge cases.
The one test case is all information you provided.
>>
>>62332474
It has nothing to do with the source leak and is just complaints about how Windows (the operating system) handles fmaintenance.
>>
>>62332489
See >>62332393
>>
I'm working on installing a web developement stack which just works. (Just php, but also laravel)

I found Laragon, and it's pretty neet.

Xampp is using an older MySQL server which I had problems in with Laravel.
>>
>>62332493
>Didn't even read
You are embarrassing. I'll let you have the last (you) so it doesn't hurt your mindless fanboyism
>>
>>62332505
Python 3 + Django + PostgreSQL
>>
>Have problem
>Use Regex
>Have 2 problems

So, currently I have this:
appsettings\.((?!Production).*)\.json

This should match all files of the form "appsettings.*.json" except "appsettings.Production.json". However it's allowing "appsettings.ProductionFoo.json"..

Can anyone help me out?
>>
>>62332515
>django
https://www.youtube.com/watch?v=uqsZa36Io2M
>>
>>62332522
s/allowing/not matching
>>
#include <iostream>
#include <fstream>
#include <json/json.h>

int main()
{
std::ifstream arq("teste.json");
Json::Reader read;
Json::Value obj;
read.parse(arq, obj);
std::cout << "you " << obj["you"].asString() << std::endl;
return 0;
}
>>
{
"you": "is faggot"
}
>>
>>62332564
>>>/b/
>>
>>62332522
list.filter(n => .startsWith("appsettings" && n=> endsWith.(".json"))).filter(n => n.endsWith(".Production.json")).array();

Did you need a regex for that?
>>
>>62332393
wow. okay, you need to work on how you generalize your descriptions of problems, because the tuples and shit were totally the wrong way to explain it.

if you're talking about python, parse the string as xml with ElementTree and then do something like

import xml.etree.ElementTree
e = xml.etree.ElementTree.parse('example.xml').getroot()

results=list()
for n in e:
results.append((n.find('title').text,n.find('link').text))


also, i modified the pastebin example so it's all encapsulated in a single item (since you need that i think, otherwise it doesn't validate).

also, if you're consuming an api and they offer JSON, use that. it's a lot less naggy.
>>
>>62332522
Learn how to do ranges and chain functions. If your language supports UFCS that is :^)
>>
>>62332573
Unfortunately yes, it's part of a deploy script.

I wish I could use linq or plain old globing here, but shitty msDeploy doesn't support either.
>>
>>62331923
>Defining it as two's complement wrapping works well.
No you see the reason integer overflow being undefined is good is because we're giving freedom to the compiler.
For indexes you should use ints usually because you're probably not gonna aim to overflow those. And it gives the compiler the opportunity to choose what they actually use on the CPU.
This example: https://youtu.be/yG1OZ69H_-o?t=2357
(note, timestamp, the entire talk is very good but this in particular)
is something that's widely applicable and a good example of how UB helps you a lot. My suggestion would be to have special types or special attributes that let you tell the compiler that you remove these constraints (32bit overflow in this case). That'd be the saner way to implement this. He does a similar suggestion regarding shifting in C++ (which is more bonkers than i thought).
UB is on the whole a bad idea but removing what UB offers us is bad. The way I see it it's C's way to support more platforms well without effort in the spec. Not an elegant solution.
>>
>>62332592
That's no LINQ, bby
>>
>>62332592
>msDeploy
wtf why are you bringing irrelevant shit up? It's literally built-in range manipulation
>>
>>62332596
Yeah I know. I'm a C# babby.

I would totally do this as
filesToDeploy.RemoveRange(filesToDeploy.where(s =>
s.startswith("appsettings.")
&& s.endswith(.json)
&& !s.contains("Production")
&& s != "appsettings.json"))
>>
>>62332623
What's stopping you?

And please, C# doesn't even support UFCS
>>
>>62332640
>What's stopping you?
Microsoft, apparently lmfao
>>
>>62332607
The guy asked me if I need a regex instead of code.

I answered him. Yes I do because I have to pass it as an argument to a command and I didn't write the fucking command itself.
>>
>CS
>read and did all exercises in C book that was listed as course literature in C course before semester started
>course started
>professor instructs only to read selected chapters and do selected exercises

People who won't read the entire thing will miss out on so much shit it's ridiculous. Are students expected to know the language only half way?
>>
Well, I think I found a solution?
appsettings\.((?!Production).*|(Production.+)).json
>>
>>62332640
C# has extension methods, close enough
>>
>>62332699
>extension methods
No, that's not "close enough", in fact that's not anything close to UFCS
>>
>>62332655
>Are students expected to know the language only half way?
Yes. I'm sorry anon but CS for industrious people is a bit of a joke. Consider your degree a way to get a badge. I'm sure there's things you can learn from professors there but if you've read your entire book ahead of class you'll realize that class is extremely slow and they won't be anywhere close to you even in a year.
So spend your time doing well in class, should be easy given the head start you have. And make special effort to NOT get lazy because you're ahead. Consider this a start to your career. Your knowledge will be tested when you have a job. Being very good at things will help you get promoted quicker in the future.

Also when you're at your second year or third year look for field-related work to do on the side. Look for more niched courses you're interested in and take those. Look for employment in those fields.

Don't let mediocrity keep you down. It's very easy to let your peers hold you back, even if they don't aim to.
>>
Brainlet here.
Does a semigroupoid satisfy transitivity in the same way as covariant functors do?
>>
>>62332753
>Your knowledge will be tested when you have a job
I should also say that in a year you're likely at the level where entry level jobs will feel under you. That's what it was like for me. Same thing applies, look higher.
>>
File: 1467520163537.png (365KB, 421x403px) Image search: [Google]
1467520163537.png
365KB, 421x403px
>tfw too much of a brainlet to wrap my head around lambdas and streams.

It's too much.
>>
>>62332754
only in a homomorphic category
>>
>>62332753
getting a job is for people who struggle at CS
>>
>>62332817
you're talking about Java right? Lambdas should be easy to grasp if you've ever seen the "implementing an interface with an anonymous class" idiom
>>
>>62332753
>>62332767
Thanks for advise. Guess I should start looking in to next course as soon as I'm 100% sure I'll do well on C exam
>>
Scanner input = new Scanner (System.in);
System.out.print ("Enter your value: ");
double price;
price = input.nextInt();
System.out.println("your value is" + " " +price);

why cant i use rational number with this code?
how do i fix this?
>>
>>62332754
Uh... of course not? Their covariant defunctors always evaluate left to right, so the coharmony is ALWAYS incomplete for such a class of monoids.
>>
File: 1464502830153.png (87KB, 285x285px) Image search: [Google]
1464502830153.png
87KB, 285x285px
>>62332753
>And make special effort to NOT get lazy because you're ahead.
>>
>>62332393
This seems to work:
       elem 
\ "channel"
\ "item"
map(item => ((item \ "title").headOption.map(_.text), (item \ "link").headOption.map(_.text)))
foreach(_ match {
case (Some(title), Some(url)) => println(s"$title $url")
case _ => // empty
})

>>62332580
muh mutability
>>
>>62332845
You'll learn so much more at work if your goal is being a developer.
Naturally if your goal is to just go into academia you're better off just studying more.
>why would you go into CS if your goal is being a developer?
Ask anon and CS students. It's not their fault. And most well accomplished people go that route actually so it's not that bad really.
>>
>>62332859
if you're in a homomorphic category it doesn't matter which direction they're evaluated in because they're iso-equivalent
>>
>>62332883
CS teaches you the background knowledge and theory you need to become a truly great developer. If you don't have it you'll remain mediocre.
>>
>>62332900
Delusion anon.
Have you seen CS courses? They don't teach you what you need to learn. You learn that when doing your research.
>>
>>62332900
t. graduate of the Dhaka Institute of Technology
>>
>>62332817
In C++?
>lambdas
Functions defined locally with special syntax to capture local variables in the scope you define them in. Just a convenience feature.
>streams
Frankly they feel like a demo for operator overloading. They don't have much genuine use and there's no consistent theory.
>>
>>62331190

There's a non-retarded backend for Win32? GDI+ is a no-go
>>
>>62332924
>>62332909
.t memecamp burger flippers
>>
>>62331313
LISP
Then C
>>
>>62332948
Elaborate on what you learned that helps you in your day to day when developing new isolation technology for amazon?
>>
>>62332975
ML
then Haskell
then Idris
then Scheme
>>
>>62332948
I'm a CS undergrad, but 4chan rapes my inferiority complex every day.
>>
C++2020
UFCS
MODULES
RANGES

OH BOY PLEASE LET THIS BE TRUE
>>
File: understanding c++.png (116KB, 584x346px) Image search: [Google]
understanding c++.png
116KB, 584x346px
>>62332996
>ufcs
now your sepples will be even less readable
>>
>>62332996
>MODULES
>RANGES
>UFCS
Woooah dude it's like the future perceived from the 90's man. Rad.
>>
>take the occasional CS course alongside my maths courses
>lecturers are obsessed with corporate and constantly refer to passing job interviews
>>
>>62333015
kek
>>
>>62333014
>function reference
void foo(void)
{
std::cout << "Niggers" << std::endl;
}

int main()
{
void (&fref)(void) = foo;

fref();
}

I didn't even know this was a thing, what the fuck
>>
>>62333014
hey. HEY, FUCK YOU
Enjoy writing thousands of lines of useless code that could be implemented in a few lines
>>
>>62331313
Read SICP--this will teach you Scheme along the way.
Then read 'The Little Schemer' and 'The Seasoned Schemer' to nail down your Scheme intuitions.

Then read K&R to learn C and imperative programming.
K&R is dated, so follow it up with 'C Programming: A Modern Approach'.

Then you should learn, if you so desire:
Haskell using 'Haskell Programming from First Principles', for a purely functional language
Python using 'Automate the Boring Stuff with Python', for an interpreted scripting language
C++ using 'C++ Primer', for an object-oriented language

You need a good grasp of algorithms and data structures, so read 'Introduction to Algorithms' by Cormen and/or 'The Art of Programming' by Knuth. You could do this alongside Haskell, Python or C++.

Finally, read 'The Pragmatic Programmer' for general good practices.

I say "finally" but you should keep reading. Look for recommendations on Stack Overflow and in /dpt/, and make sure they're backed up by good reviews on Amazon.
>>
File: Screenshot_2017-09-09_09-17-44.png (182KB, 941x560px) Image search: [Google]
Screenshot_2017-09-09_09-17-44.png
182KB, 941x560px
Working on a script to convert HEVC stuff to h.264 because it won't play on my streaming box without stuttering.
>>
What is wrong with F# users?

https://github.com/Microsoft/visualfsharp/issues/3440

>We have been asked to by a community member to change our license from Apache 2.0 to MIT

>the MIT license only gives you access to the Software that you received but you must agree to pay royalties to Microsoft for any patents that they lay claim to.

>Back when this was Apache 2, Microsoft were giving you the rights to the patents too. And if you file patent litigation against Microsoft claiming that this software infringes your patents, then you lose the rights to the Microsoft patents and have to pay Microsoft to use them
>>
File: 1502979998460.png (283KB, 512x512px) Image search: [Google]
1502979998460.png
283KB, 512x512px
>>62330608
>compile
>objdump
>directly modify binary with a hex editor
I can't be the only one
>>
File: 1504490675287.jpg (188KB, 730x1945px) Image search: [Google]
1504490675287.jpg
188KB, 730x1945px
>It's another weekly "let's shit on Go episode"
>>
>>62330399
dumb anime poster
>>
I've just started learning to code (C#).

Other than 'comment the shit out of your code' what other tips could you give me so I can learn to do things right from the very beginning?
>>
>>62330608
only once in a while to make sure the compiler does a certain optimization i have in mind
>>
>>62333647
Yes. Learn a better language.
>>
>>62333647
Make sure comments are relevant and meaningful.
>>
>>62333647
Test the shit out of your code. But most of all: have fun.
>>
File: 1498654016382.png (153KB, 400x457px) Image search: [Google]
1498654016382.png
153KB, 400x457px
https://web.cecs.pdx.edu/~fliu/project/sepconv/demo.mp4
Oh my, there is a huge undiscovered world around there
>>
>>62333611
go really is pretty shit tho. internal use at google? sure, they can do whatever they want. but if you're going to try to shove it in everyone's faces, people are going to criticize it.
>>
Customizing my bash_profile, but am running into a weird error with ls:

When .I use it normally, there's no problem, but I get the following error when I do
 ls -d */ 

 => ls -d */
ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]


I checked, and I don't really see any aliases for ls anywhere... Any thoughts on what I'm doing wrong?
>>
give me a fun project
>>
>>62333830
a c compiler
>>
>>62333830
Your own Lisp using the Hindley-Milner type system.
>>
>>62333847
>>62333853
fucking nerds give me a FUN project
>>
>>62333873
What do you consider fun? Manipulating audio/video? Networking? High performance computing?
>>
>>62333780
I'm not all too familiar with neural networks or their inner workings.
Does the fact that it's a neural network mean we'll have to train a neural net for each and every video we want to interpolate? Or is the neural net to achieve almost-optimal "coefficients"?

This is a cool video regardless!
>>
>>62333830
Rain sound synthesis
based on a configurable 3D scene
with different materials such as metal, stone
High-quality reverb and dampening
>>
>>62333873
https://www.youtube.com/watch?v=sWblpsLZ-O8
>>
>>62330430
It works, but...
Some filenames are too long for Java to handle. What would be a good alternative? Generate a hash of the filename?
>>
>>62334139
>Some filenames are too long for Java to handle
what
>>
>>62334159
I get a FileNotFoundException with the message 'file name too long) for names like: (サンクリ61) [しすいシスターズ (しすいきょうこ)] Kuroneko (俺の妹がこんなに可愛いわけがない).
>>
 
switch
case(1): statment1; break;
case(2): statment2; break;

or
switch 
case(1):
statment1;
break;
case(2):
statment2;
break;
>>
>>62334264
stop using shitlangs with automatic fallthrough
>>
Visual Studio has an extension called Atomineer that lets you easily create doxy style documentation.
Is there a linux alternative?
>>
>>62334264
if(foo == 1) {
statment1;
}
else if(foo == 2) {
statment2;
}
>>
>>62334246
That's probably because path to the file including the filename is too long. If you are on windows then the maximum path length is 256 characters.
>>
>>62334434
BTRFS (the file system I use on Linux) has the limitation.
>>
>>62333791
Okay now I have no fucking clue what's going on...

Looks like
 ls -d */ 
works in some folders, but not others. What the fuck?
>>
>>62334544
And proof I don't have any aliases on ls:

>>
>>62333791
whereis ls

This is really odd anon.
>>
>>62334571
Planning on asking SO in a bit... Not that this is a crippling issue, it's just kind of weird

bin/ls
>>
File: file.png (77KB, 311x340px) Image search: [Google]
file.png
77KB, 311x340px
>>62330399
>>
>>62334591
Your hdd is failing.
>>
>>62334571
He should try
which ls
instead which will actually tell him if it's aliased or not.
>>
>>62334759
=> which ls
ls is /bin/ls


Worth a shot
>>
File: Captura de Tela (5).png (650KB, 789x563px) Image search: [Google]
Captura de Tela (5).png
650KB, 789x563px
Learning VIM and feeling stupid
>>
>>62334856
Be smart and learn Emacs
>>
In a C header, do I have to define structs within structs before the main struct itself?
>>
File: 1459179996701.jpg (14KB, 238x192px) Image search: [Google]
1459179996701.jpg
14KB, 238x192px
> 2D<arrays
>>
>>62334990
No, you can declare structs inside of structs.
struct Outer
{
struct Inner
{
int x;
} inner;
}
>>
>>62335006
oh shit thanks senpai
>>
>>62334990
You cannot reference something that isn't created.
Don't know exactly what you are confused about.
>>
how would you do the simplest update notification system for desktop? I'm thinking a text file with version string hosted on github that the program gets at startup and compares with its version. nothing could go wrong, right?
>>
>>62334571
Okay, found the problem!

From SO:
The problem is in how * works in the shell.

Some people think that when you write ls * the shell will run ls passing the wildcard and that command will list all the files. But actually it is the shell that expands the * into a list of all the files and passes them to ls.

TL;DR; you have a directory name that starts with -! (I think that it is named just -). So when you run ls -d */ it is expanded to something like ls -d -/ bar/ muz/ .... You can see the actual expansion with echo ls -d */

Solution: write ls -d -- */. The -- will tell the command not to interpret any further command starting with - as an option, but as a file name.
>>
>>62335149
Thanks for telling me. I'll remember this.
>>
Is little endian the white man's encoding? Big endian was developed by arabs for RTL text, so logically little endian should be the most fitting for LTR text.
>>
>>62335308
>where is MSb
It's not relevant to higher level representations.
>>
>>62335002
but seriously, what is the point of making 4d, or higher, arrays?
>>
>>62335364
You have a higher dimensional association of data. What should guide your datastructure choices is their use in algorithms though. 4D is quite rare.
>>
>2017
>Not accessing arrays with the happy face operators

#include <stdio.h>

int main(void) {
char string[] = "I am a string";
printf("%c%c%c\n", string<:2:>, string<:5:>, string<:7:>);
return 0;
}


What, do you want your programs to be sad to look at? :>
>>
>>62335364
Time, X, Y, Z
>>
>>62335417
what the fugg
>>
>>62334650
Are you picking a fight, you son of a bitch?
>>
File: 1496912214190.jpg (108KB, 762x613px) Image search: [Google]
1496912214190.jpg
108KB, 762x613px
Fact: If Go was made by someone other than Google, then nobody would use it.
>>
>>62335475
Go is the best language for a beginner.
>>
>>62335483
Scheme (learnt through SICP) is the best language for a beginner. If you struggle with SICP and Scheme, you have no place in programming.
>>
File: 146195366088.jpg (71KB, 599x600px) Image search: [Google]
146195366088.jpg
71KB, 599x600px
I have an R function that takes 2 parameters X and Y and returns a value Z

If I know I want an output Z of a certain value, how do I find what the parameters for X and Y should be?

Basically what you can do with the Excel solver.
>>
>>62335586
use the inverse relation

seems trivial to me
>>
>>62335596
I don't think this works since it does some calculations and it isn't possible to work backwards from Z to find X and Y. What I need is more of a brute force type approach where it iterates over possible values of X and Y until it find the correct Z.
>>
>>62335586
dumb frogposter
>>
>>62335752
>I don't think this works since it does some calculations and it isn't possible to work backwards from Z to find X and Y
yes it is

it might not be possible to build an inverse function, but I'm sure you can build an inverse relation. then it's just a matter of choosing one element of the set it maps your Z to. easy, the rest are implementation details.
>>
>>62335586
retarded frogcuck
>>
>>62335498
This

It requiring some working math knowledge is a good thing
>>
File: 1504455671813.jpg (21KB, 420x420px) Image search: [Google]
1504455671813.jpg
21KB, 420x420px
>>62335790
frog website
>>
>>62335841
that's reddit
>>
File: 1504901560952.png (646KB, 1200x1000px) Image search: [Google]
1504901560952.png
646KB, 1200x1000px
>>62335841
No, this is an anime website.
>>
>>62335149
>this is what linux nerds have to worry about
>meanwhile windows just werks
>>
>>62335882
The default shell on windows is awful and powershell is just too object oriented for me.
>>
File: dpt-programming-cheatsheet.jpg (586KB, 4020x1449px) Image search: [Google]
dpt-programming-cheatsheet.jpg
586KB, 4020x1449px
Are you ready to become a master programmer, /dpt/?
>>
>>62335965
green is my pepper
>>
>>62335965
what does the pepper do
>>
>>62336024
Focuses your mind
>>
>>62336024
allows you to make nice posters
>>
quick rundown on c# pls
>>
>>62335426
That's a tuple
>>
File: 1498883863414.png (405KB, 1968x1200px) Image search: [Google]
1498883863414.png
405KB, 1968x1200px
>>62330552
Seriel Experiments Lain, Grappler Baki, Akira, anything from Ghibli
>>
>>62336292
Voxel v[time][x][y][z]
>>
>>62336244
It's Java but with a sepples-like obsession on adding useless new features
>>
>>62330428
javascript is functional
>>
>>62336358
that would make sense, since it was made by microsoft as a response to java, and MS has its hooks in C++
>>
Ok guys, I'm in big trouble. I need a job in 2 months top and since helpdesk jobs are satured as fuck in my country, I'll need to go for programming jobs.
Problem is it's been nearly 4 years since the last time I touched a code back in high school, so I barely remember the basics of the following languages; PHP, CSS, JavaScript, C#, etc.
I need to relearn them really fast, like in a month. I'll spend all my waking hours study them just so I can get the basics and rush for a job, but I need some directions (I could use some MySQL knowledge too).
Please help me.
>>
Is there a book that teaches with example programs (like C Primer Plus) for Common Lisp?
>>
Regex help please.

I want to get:
49:"8A"
49:"4B"

from:
49:  ShowChoices(strings("8A","4B"),5)


How do I do this using grep or another command line tool?

I can get the quoted text using for example
grep -Po '".*?"'
>>
>>62336348
+1 for Akira, watched the film a few days ago and currently reading the manga.

Can anyone suggest some more cyberpunk anime/manga? I've already seen Lain.
>>
>>62336576
There's a pdf in the current book thread of lainchan dot org's lambda board, btw.
>>
>>62336639
GitS.
All of the different GitS media are quite different, but I like the first film best.
>>
Building a documentation generator for my small embedded kernel
>>
>>62336730
comfy design senpai
>>
File: 1504557444828.jpg (30KB, 412x281px) Image search: [Google]
1504557444828.jpg
30KB, 412x281px
>Starting my second year at uni and most of the class couldn't write fizz buzz in Python
>>
int
*cracks knuckles*
>>
New thread:

>>62336769
>>62336769
>>62336769
>>
>>62336244
cargo cult clone of java, misses the point of java, it's shit, just use C++ and/or java if you aren't obligated to use C#
Thread posts: 314
Thread images: 34


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.