[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: 394
Thread images: 23

File: dpt-a.jpg (194KB, 1600x1200px) Image search: [Google]
dpt-a.jpg
194KB, 1600x1200px
Previous thread >>57727976

What are you working on, /g/?
>>
What is Haskell good for?
What is Haskell bad at?

https://github.com/Gabriel439/post-rfc/blob/master/sotu.md
>>
First for getting a real job
>>
>>57736399
At least you tried
>>
>>57736397
https://www.youtube.com/watch?v=iSmkqocn0oQ
>>
>>57736413
Once again, haskell prevented me from getting a job
>>
File: 1475974780262.jpg (30KB, 375x339px) Image search: [Google]
1475974780262.jpg
30KB, 375x339px
>>57736418
>tfw to smart to get a real job
>>
>>57736445
>Delusions of grandeur.jpg
>>
finished my wow cheat in time for neo-nostalrius release
gui layout looks like shit but whatever
>>
>>57736445
>to smart
gtfo newfag
>>
Rate my blog post

http://collinoswalt.com/11
>>
As a type theory guy, I don't like Haskell users in general. Haskell is basically the Mount Stupid of type/category theory.
>>
File: neckbeard.png (92KB, 333x334px) Image search: [Google]
neckbeard.png
92KB, 333x334px
>>57736474
>WoW
>>
>>57736490
how come?
>>
Threadly reminder that it's not about good code or design, it's about making as much money as possible

>Rust
>Haskell
>Real jobs

Learn Java
>>
>>57736498
Because Haskell is a teeny tiny bit useful
>>
>>57736504
>not about good code or design
>Learn Java

>t. Pajeet
>>
File: 1477688102806.png (26KB, 946x780px) Image search: [Google]
1477688102806.png
26KB, 946x780px
When did you realize that Haskell is a meme language and finally moved on to a language that matters (Like C++)

For me, it was the moment I started programming

http://www.tiobe.com/tiobe-index/
>>
>>57736531
Enjoy that good design from inside your cardboard box
>>
>>57736498
No dependent types and partiality everywhere, yet many Haskell users like to act as if they're the ivory tower. At this point I'd put Rust ahead of Haskell when it comes to safety and reasoning power because Rust has affine types and isn't lazy.
>>
>>57736479
Is this a reference to two three threads ago?
>>
File: mfw_brainlets.png (37KB, 300x289px) Image search: [Google]
mfw_brainlets.png
37KB, 300x289px
>>57736479
>being to stupid to get my memes
>>
>>57736541
Did you start with a functional language? How many here did? Do you consider it a good start for an imperative programming life?
>>
>>57736541
>(((tiobe))) index
>>
>>57736548
> {-# LANGUAGE Strict #-}

barring safety and memory, laziness is the shit when it comes to writing programs

GHC had linear implicit params at one point, pretty sure they're getting a new linear types extension soon
>>
File: ghelp.png (23KB, 1205x396px) Image search: [Google]
ghelp.png
23KB, 1205x396px
Can anyone give me the answer? I really can't figure it out, I'll be able to figure it out when I can see what it wants me to do.
>>
File: 1408751367381.jpg (2MB, 3504x2336px) Image search: [Google]
1408751367381.jpg
2MB, 3504x2336px
Friendly reminder that Lisp is the only programming language that has been endorsed by Richard M. Stallman (PhD).
>>
>>57736589
admitted = (age >= 13)

>inb4 this isn't the same because muh dynamic typing and null
>>
>>57736589
You have to compare age with 13 and set Admitted to the correct value accordingly.
>>
>>57736589
if age >= 13:
admitted = true
>>
>>57736604
Friendly reminder that nothing relevant is coded in LISP today.
>>
>>57736589
Have you started programming 5 minutes ago?
>>
>>57736604
I didn't realise that. Best avoid it so..
>>
>>57736621


OHHHHH. Thank you so much.
>>
>>57736604
Stallman is a literal retard
>>
>>57736585
You can do lazy in Rust, it's just not lazy for everything. A lot of things in Rust are basically lazy anyway. Iterators are lazy (so you can do "infinite" lists similar to how haskell does them), vector allocations are lazy, etc.
>>
>>57736631

Yup.
>>
>>57736589
There are no grills allowed in /g/
>>
>>57736621
admitted = age >= 13
>>
>>57736589
How old are you?
>>
>>57736397
>What is Haskell good for?
smug fedora tipping
>What is Haskell bad at?
pretty much everything else
>>
>>57736673
This is the only non-pajeet solution.
>>
>>57736636
Don't let /g/ discourage you. They're bitter because
>tfw if((haskell == no job) == true){ return true; }
>>
>>57736685
If you can't get a real job with Haskell, how would you afford a Fedora?
>>
>>57736695
> == true
>>
File: 1478891433834.jpg (149KB, 485x769px) Image search: [Google]
1478891433834.jpg
149KB, 485x769px
>>57736541
>not learning multiple langauges and choose the best tool for the job
fucking pleb
>>
>>57736709
autismbux
>>
>>57736711
>bothering to point out the joke
>missing the other ones

I would chalk it up to autism, but an autist would have picked up on the other stuff.
>>
>>57736585
>>57736651
You can add laziness to a strict language very easily. A thunk is just a closure with no parameters. It's not possible to start with all laziness and get strictness, though. Strictness in Haskell is a non-standard extension.
>>
>>57736371
Thank you for posting an anime pic OP.
>>
>>57736604
Stallman doesn't even have a realistic view on software licensing. He has this weird idea of software and politics that can be described as globalist leftist anarchist. While motivating it through free market means.
He has stated that people in the west get paid too much for their work and proprietary software keeps that going. He'd rather see an open source world with less wage gaps.
While the podcast hosts aren't particularly good at asking questions and arguing here Stallman makes his point of view clearer here than anywhere else. Especially by the end when he questions one of the hosts self-interest in being paid. (iirc it was in the last ten minutes. But it has been years since I saw this)
https://youtu.be/radmjL5OIaA
>>
>>57736711
sorry, sorry, I meant:

var checkIfHaskellEqualsEqualsNoJob function(){
if((haskell == no job) == true){
return true
}
}

if(checkIfHaskellEqualsEqualsNoJob() == true){
console.log(true);
}else if(!checkIfHaskellEqualsEqualsNoJob() == true){
console.log(false);
}
>>
>>57736774
Software licensing has nothing to do with wages, though. You can support copyleft without taking his economic stances as well.
>>
>>57736660
Fuck off to /pol/?
I want programming girls, like practically any programmer without major insecurities of their capabilities.
>>
>>57736589
if(age == 0){
admitted = false;
}else if(age == 1){
admitted = false;
}else if(age == 2){
admitted = false;
}else if(age == 3){
admitted = false;
}else if(age == 4){
admitted = false;
}else if(age == 5){
admitted = false;
}else if(age == 6){
admitted = false;
}else if(age == 7){
admitted = false;
}else if(age == 8){
admitted = false;
}else if(age == 9){
admitted = false;
}else if(age == 10){
admitted = false;
}else if(age == 11){
admitted = false;
}else if(age == 12){
admitted = false;
}else{
admitted = true;
}
>>
>>57736791
Stallman wants all software to be copyleft if i recall correctly, which would mean massively less wages for everyone. As well as flat out way shittier software.
>>
>>57736797
You didn't handle fractional ages. Come on.
>>
>>57736796
i want programming traps
>>
>>57736811
Why?
>>
>>57736816
The language he's originally using is Python as well
So you need to check age isn't a string
>>
>>57736797
>else if
>;
>{
>false
>>
>>57736816
for(double i = 0; i < 13; i += 0.0000001){
if((age == i) == true)
return false;
}
return true;
>>
>>57736830
Less mechanisms for capital investment. Less people will work on software, especially very intelligent and skilled people who will find highly paid work elsewhere.
>>
>>57736830
Profit incentive = higher quality.

Look at GNU code. It's fucking terrible.
>>
>>57736862
How does copyleft lead to this?

>>57736874
That's circular logic.
>>
>>57736874
>GNU
>Nu
>>
>>57736791
Yes but his motivations are concerning.
I wouldn't accept big oils arguments for why we need petroleum cars or why alternatives are bad at face value.
And its extra important to be suspicious and careful in your examination when you find them reasonable.
That's all I'm saying. Overall I do support a lot of copyleft but if the world isn't already as he would have it his non-proprietary world simply doesn't allow for standards of living.

Something people don't consider enough is that your participation in society supports political ideology implicitly.
If you live and pay taxes in Sweden, purchase goods in Sweden. You do support their government and their position in the world politics arena. Let's limit the considerations and just consider worker living conditions.
When you buy goods from China you support everything they're doing. Including their workers living conditions, their extremely low purchasing power etc.

If you believe (as I do) that full on copyleft no proprietary software would send tons of political and economic power to countries like China you'd probably agree its bad. If you think people inhaling soldering vapors for 12 hours a day for amounts of money that barely sustains them isn't good.
>>
>>57736886
because it's much harder to make money when you make copyleft software. It's much harder to sell. All you can sell generally is support, and hope for donations.
>>
>>57736797
if age == 1 or \
age == 2 or \
age == 3 or \
age == 4 or \
age == 5 or \
age == 6 or \
age == 7 or \
age == 8 or \
age == 9 or \
age == 10 or \
age == 11 or \
age == 12 or \
False: #lmao im so random
admitted=False
else:
admitted = True

Le fixed :*)
>>
>>57736846
>Comparing doubles for equality
>Incrementing with 0.0000001

This is literally Pajeet-tier
>>
>>57736371
Getting linux 4.8 to run on a printer that's currently running linux 2.6.21
>>
>>57736886
>Circular logic

How? All the people who write good code work for companies and get paid to do it. All the people who write shit code can't get jobs and so write GNU code for free to pad their resumes
>>
>>57736886
>circular logic
More of a feedback loop than circular logic.

It's very hard to express the world as a flow chart. So if we wish to argue at this level we have to make some assumptions about how the world works right now.
Inb4
>not an argument
Yes. It isn't. But we're simply way out of reach for any actual arguments. For either side.
>>
>>57736922
I think you may be retarded because you're definitely not picking up on humor/sarcasm
>>
File: you.png (3KB, 698x1284px) Image search: [Google]
you.png
3KB, 698x1284px
>>57736959
>>
>>57736986
no anon, it actually was a joke. You literally have autism if you couldn't pick that up. Read back up the thread.
>>
>>57736986
How meta is this? Who's the retard here? Or is it all of us
>>
> he doesn't use fixed point
> In the year of our Lord, 2016
What's wrong with you?
>>
>>57736604

Richard Stallman has four honorary doctorates, but no real ones.
>>
is LISP still used today? is it worth?
i'm thinking of picking up SICP
>>
>>57737002
no hardware support
>>
>>57737038
Plenty of people use it. Not sure how many of them have jobs
>>
>>57737002
>he's afraid of what he doesn't understand
Floating point I fine. If you know how to use it.
>>
File: 1480266417485.jpg (8KB, 210x240px) Image search: [Google]
1480266417485.jpg
8KB, 210x240px
Do you program all day or only a few hours?

describe in greentext your day pls
>>
File: meta-you.png (93KB, 800x600px) Image search: [Google]
meta-you.png
93KB, 800x600px
>>57736998
>>57736999
>>
>>57737002
Rationals are better
>>
>>57737052
> It's Not That Badâ„¢
>>
any good books/resources on server architecture?
bonus if its heavy on the concurrency/threading stuff
>>
>>57737068
I love this
>>
>>57736986
Fuck me, I can't tell who is meme'ing who now. 4chan just went post-ironic.
>>
>>57736913
That accurately reflects how software actually works, though. The only thing holding up the idea that a copy of a program is worth money is copyright law that hurts paying customers more than it does pirates. If that's ever to be reformed then the software industry will need a reality check and understand that they deal in services and not goods.

>>57736928
Looking at it again maybe it's not circular logic but it definitely is irrelevant to the topic of software licensing. All that is is a correlation between programmer salary and code quality. There's no reason you can't pay someone to write open source code.
>>
>>57736816
for year in range(1,13):
for day in range(1,367):
if age == year + Fraction(day,365): admitted = False
#leap year test
if age == year + Fraction(day,366): admitted = False


if((admitted == False) and (admitted==False) == True:
admitted =True
>>
>>57737002
> needs fixed point when we already have ints
>>
I will read the sicp. It's expected that I know lisp or there is a tutorial in it? if there is a tutorial, is everything I need to know about lisp? I want to kill two birds with the book.
>>
File: lambdabg.png (32KB, 1920x1080px) Image search: [Google]
lambdabg.png
32KB, 1920x1080px
>>57737038
naughty dogs script all their game in lisp.
emacs lisp is still used plenty.
http://clojure.org/community/companies

Lispers are and always have been the Ãœbermenschen of computer science.
>>
>>57737106
you have 5 minutes to re-write this shitty ass code or you're fired
>>
>>57737002
>>57737052
>implying you shouldn't use each when appropriate
>>
>>57737066
> be anon
> get up (noon)
> read IRC
> read twitter
> read more IRC
> click some links
> play around with stuff someone else programmed
> drive to hackerspace
> hack all night
> drink stuff
> sleep
>>
>>57737121
was about to post this
i feel sorry for those poor game designers
>>
>>57737121
>>>57737038
Stopped reading right there
>>
>>57737126
Oh shit, you're right. There was a parenthesis that shouldn't be there
for year in range(1,13):
for day in range(1,367):
if age == year + Fraction(day,365): admitted = False
#leap year test
if age == year + Fraction(day,366): admitted = False


if (admitted == False) and (admitted==False) == True:
admitted =True
>>
>>57737079
Well yeah. That'd be one of the primary things to realise about computers. They're not that good.
https://youtu.be/97bxjeP3LzY
Here's a slightly damaged software engineer explaining floating point and the mindset you need to use it well.
>>57737128
The uses for fixed point is growing smaller and smaller is the thing.
>>
>>57737138
>IRC
man last time i used irc was back in like 2004 playing cs 1.6
people still use that shit?
>>
Asking again because I got no responses from last thread.

How does a beginner get started on a project, especially on github? I feel like I don't know enough, but at the same time I feel like books aill only take me so far.
>>
>>57737100
Fucking donald trump got elected by memes. If I went back to 2008 and said "memes will elect the next president of the United States" you'd all call me a newfag. We've blurred the line between irony and reality. I'm still not entirely sure the last 2 months hasn't been a big dissociating drug trip. I wake up some days wondering if I'm still in reality. Memes have transcended and we've created an autistic artificial intelligence. Pepe is the singularity
>>
>>57737052
>he's afraid of what he doesn't understand
People criticizing floating point DO understand it and understand it's flaws
>>
>>57737168
fired
>>
>>57737103
>pay someone to write open source code
>release source code online
>nobody buys your product and just compiles it themselves
>>
>>57737173
yes.
>>
File: 1479677306033.jpg (23KB, 578x490px) Image search: [Google]
1479677306033.jpg
23KB, 578x490px
>>57737175
Well put.
>>
>>57737193
>Red hat linux
>>
>>57737149
why?
>>
>>57737193
look at what Arduor does: they offer binaries for win/osx for a fee and free source code
>>
>>57737175
>He's just mad that Trump got elected.
>>
>>57737217
Redhat linux costs money for support. Not the distro.

I mean, everyone can agree. Linux is a bitch to work around. I challenge anybody to set up an email server in less than 1 hour
>>
>>57737221
>download
>compile
>put out a torrent
wew
>>
>>57737138
what do you mean by hackerspace?
>>
>>57737066
>wake up
>pounding headace
>eat breakfast and shower
>realise its this bad because I forgot the antidepressants
>take them
>get sleepy
>sleep another 4 hours
>wake up in a state of bliss
>get out of the bed and the world sucks immediately
>open computer
>navigate to dpt to see if there's replies to yesterday's posts
>respond and start arguing with dogmatic students who haven't tried more than OOP in java so they don't know any better
>close dpt
>program for two hours
>commit
>boss notices and immediately encourages me to do more (as I am the only one actually doing work)
>tell him ok
>push another prepared commit in an hour or so
>boss super impressed
>go to eat dinner
>go to bed
Remember to work out and eat at least 3 meals a day everyone!
>>
>>57737249
berniiiiiiiie
>>
>>57737169
I mean, yeah, you can throw more memory at a floating-point number and it will be able to take the place of a much smaller fixed-point number. Just because you understand the implications of using floating-point numbers doesn't mean you always want them.

>>57737193
>pay someone to write proprietary code
>release application online
>nobody buys your product and just downloads it from TPB
>>
>>57737257
see http://hackerspaces.org
>>
>>57737251
>buy proprietary software
>put out a torrent
wew
>>
>>57737177
I don't think that's the general case anon. They generally don't understand that floating point precision is entirely predicable and for every operation you do you might lose bits of information.
I hardly ever see people consider that. You'd see more
//13/24 for r32 P.X
or similar comments in code.
Hardly anyone does that. But it's extremely helpful.
>>
>>57736604
is LISP object oriented?
>>
>>57737297
Yes.
>>
>>57737066
>wake up
>sit in bed next to gf for a couple hours, reading headlines while she sleeps
>go to class
>get an energy drink on the way
>go to classes all day
>go home
>program for like 20 mins
>watch something on netflix for the 1,000,000th time with gf


Some days I have less classes than others, so I can program longer.

It takes so much effort to motivate me to program, but I've got a bunch of projects I wanna finish, but School makes me feel like everything is so pointless that I don't feel like programming anymore.
>>
>>57737287
wow, this looks really neat
>>
>>57737175
We will get thru this, anon.
Keep your wits about you.
>>
>>57737269
Not _always_. But in a large number of cases you would. Keeping your numbers stored in int is very detrimental to performance.

Of course if you don't give a flying fuck about memory or performance just use whatever you think suits your mental model.

It only really gets to be a problem when you concern yourself with that.
>>
>>57737066
>arrive at work at 09:00
>procrastinate until 09:30
>fix bugs in shitty code base | work at player framework | read programming related news articles
>go home at 17:00
>start programming
>cry myself to sleep
>>
>>57737336
>yeah the answer is wrong but I came up with it faster than you did
>>
>>57737297
not necessary. lisp being a programmable programming language, it can be everything you want.
>>
>>57737269
Yeah I guess that's why Microsoft is so poor from all the people stealing windows Oh wait

>People torrent windows
>overwhelming majority of people don't

MS makes billions

>Canonical open sources Ubuntu and gives it out for free
>begs for donations
>sells support
>revenue: <$100m

Tell me proprietary code doesn't make more than open source
>>
>>57737338
tell me more about that "player framework"
>>
>>57737351
All of that rides on anti-consumer copyright law so if you're at all interested in reforming it then you have to accept that you can't pretend software is a material good.
>>
>>57737351
most of microsoft money come from enterprise and oem.
>>
>>57737374
>anti-consumer
Fuck off TotalButthurt
>>
>>57737351
>>57737374
Also there's this >>57737376, which will continue to be possible if you treat software as a service.
>>
>>57737175
>2008.
Id buy it in 2012 though. The influence of 4chan was huge back then too. But in different places. With the growth of /pol/ there's no question that they'd spread tons of voter engagement to those groups of people.
And even though Obama was a relatively good break from terrible presidency it was already apparent the American population was sick of their system.

Those two things in combination might have swayed it.
Because you have to remember. Normal people have lives. /pol/ do nothing but live on welfare and shitpost. So if you place their efforts right they're a large force.

/pol/ is literally in the Whitehouse now.
>>
Is there any projects that are trying to create "God," in programming?
>>
>>57737294
I think the general case is people not understanding the limitations of floating point, and using it in situations that are poorly suited for it.
>>
Please make a new thread about this GNU/Open source/Proprietary bullshit.
Thanks.
>>
>>57737311
how much work do you invest in your relationship?
>>
>>57737344
>wrong
No anon again you don't understand floating point if you think that's the case.
>>57737411
Yeah. As I stated. A lack of understanding is the problem.
It doesn't help that people don't teach people floating point and Ape out about it.
>>
>>57737406
You'd have to be more specific.

Because the supernatural cannot be created within the confines of reality.
>>
>>57737420
We've been dating 3 years. She's my #1 priority, no matter what. Some might say
>whipped
But I enjoy spending time with her more than I enjoy anything at all. I don't have any real aspirations other than to be with her for the rest of my life.
>>
>>57737250
how much time it does require to setup a properly configured email server in windows?
>>
>>57737431
Just because floating-point has well-defined properties doesn't mean those properties are always desirable. Sure, I can prove that the error propagated will be no more than X% of the final result but that doesn't mean fuck all if I need the absolute error to be sufficiently small and I don't want to spend the extra memory necessary to achieve that with floating-point.
>>
>>57737352
Anti climax: it's for Android.
I got tired of all the shitty video player implementations, so I decided to write my library. The library is split up into different modules: common (interface and utilities), cast (Chromecast implementation), exo (ExoPlayer implementation) and ima (Google IMA implementation). So far, so good. All apps using my library don't crash on the video player part.
>>
>>57737455
>whipped
Stupid bullshit selfish people say.

Men are evolutionarily predispositioned to serve women. When you do it right you enjoy life.

Sure it's not the most healthy of practices because spouses can be unreliable but when it works its amazing.
>>
>>57737455
awww

you're cute, anon
>>
>>57736371
I'm solving programming challenges.
I had to google one because I got stuck.
And immediately after seeing the solution, I felt like a fucking retard.

Oh well, I guess I have more learning to do.
>>
>>57736604
good afternoon sir Stallman, can thou tell me if reading sicp will allow me to learn all necessary lisp?
>>
>>57737470
ah, nice
>>
>>57737456
On windows? idk, never tried. On linux? Psh. I still haven't did it correctly.

I do know that if you have some moolah you can pay microsoft (or maybe some other company like sherweb) to host an email server over there.
>>
>>57737487
you know why women used skirt and long hair for eons right?
>>
>>57737487
She's not spoiled either. We'll be in bed and she'll ask me to get something from the kitchen and I'll do it because why not? She tells me that sometimes she feels bad that I do so much for her but I don't mind in the slightest. When i had a job (student now), I would make and save money to spend with her. Go out to restaurants, bars, the very occassional concert. I saved some money from my summer job for the school year, but ultimately the point is to go do stuff with her.

She's from Thailand, and my next goal is to save up enough money to take us both to thailand and visit her family (probably as a graduation vacation in a couple year)
>>
>>57737499
sicp is about learn programming, not about learning lisp.
>>
>>57737457
>I don't care about speed
Ok? So why do you keep replying. I already gave you your answer. Choose whatever 'fits'. Do arbitrary precision arithmetic or whatever.

The people who have to work with actual computers and their users can't do that. So enjoy it while it lasts.
>>
I hate to be "that" guy but what the fuck at JS prototypes.

Why do they have their own functions?
Why do they even exist?
Does anyone actually use them? For what purpose?

Does a custom object inside another object make it a prototype object for the second object?
>>
>>57737536
but if I know programming will I learn lisp reading it?
>>
I'm trying add to numbers from arrays together in c, but I get the error message: subscripted value is neither array nor pointer nor vector. The array is an array of structs. I am trying to add them together like so: m = array[i].hometeamgoal + array[i].opposingteamgoal. I have tried just using the struct instead like this: m = struct[i].hometeamgoal + struct[i].opposingteamgoal, but then I get the error message expected expression before struct. I have also tried using -> instead of . Any help is much appreciated.
>>
>>57737529
>She's from Thailand
You sure it's a she?
>>
>>57737552
Yes. Early on they introduce the syntax of lisp and then quickly move to functional programming
>>
>>57737559
Paste your whole code please. *Readably*
>>
>>57737552
you will miss a lot
>>
>>57737539
If a particular use case cares more about performance and representing a wide range of values than accuracy then use floating-point.
>>
>>57737563
Repeated experiments have confirmed the theory with 100% accuracy. However, for scientific rigor I'll continue my research
>>
>>57737528
Kinda lost me. Maybe I know but I don't know what you mean.
>>
>>57737103
>That accurately reflects how software actually works, though.
none of that changes the fact of what I said. If you get paid less to make open source software than closed source, then you get to make less open source software than closed source. because people like to eat, among other things.
>>
>>57737574
but if I know functional programming then I will learn even more lisp right?
>>57737587
why?
>>
>>57737591
Well yeah. But usually you know your inputs and outputs. In fact you can measure it when you get them and choose your preferred datatype then and there.
>>
>>57737559
Your array is not an array. Check how it's declared. Did you do:

struct myStruct array;

or

struct myStruct array[100];

?
>>
File: SOS.png (57KB, 1262x464px) Image search: [Google]
SOS.png
57KB, 1262x464px
>>57737582
Ehh it's in danish but here it is. kampe is the array, it is defined as kamp kampe, where kamp is the struct, I hope you understand
>>
>>57737650
What horrid color scheme is this?

I'm not helping you until you post it with a better color style?
>>
struct myStruct array[100];
>>
>>57737650
mindreendtimaalfunc
At least do some kind of case.
That's not a single word right?
>>
>>57737601
And the only reason proprietary software makes more money to pay its programmers in general is because of shitty copyright law.

Most open source software right now is free alternatives to proprietary software. If a programmer wants to be paid more then generally they will go proprietary. If all software was open source then programmers would be paid to write open source code, it's that easy.
>>
>>57737650
What the anon above me said. kampe is not an array, it's a struct instance.
>>
>>57737650
Convert it into English and you might get some support.
>>
>>57737591
This is an interesting point, since I'd wager 90% of systems don't need the range floating point provides. So they're getting the worst of both worlds.
>>
>>57737592
with what confidence interval?
>>
>>57737650
What is kamp? did you do


typedef struct _kamp kampe



or something like that? then kamp is not an array, but a struct. you need to have

kamp *kampe


for a kamp pointer

or

kamp kampe[]


for kamp array
>>
>>57737671
>it's not a single word, stupid
maybe it is!
>>
>>57737675
>doesn't get it
If you're below a 24bit int you get the right stuff to 32 bit integer precision.
With integer you lose some remainder for every division/float multiply.
It's not about the range of numbers floats provide really. That's for people who either don't care about consistency and want approximations or people who don't get it.
>>
>>57737672
Surprise: The GPL is based on copyright law
>>
>>57737536
is sicp the best book about programming out there? i want to study something but don't know where to start
>>
>>57737672
>And the only reason proprietary software makes more money to pay its programmers in general is because of shitty copyright law.
Yes, that's exactly what I said. And getting paid more money means you can spend more time programming, it means you can pay other people do programming for you making the project even better.

I'm not arguing weather not not copying law is "shitty" or not. I'm stating the fact that software would be much worse if all software was copyleft open source.
>>
>>57737694
I was assuming func stood for function.
Ugly language.
>>
>>57737707
This. GPL is in fact a copyright licence.
>>
>>57737714
sicp can be hard if you are mathematics illiterate. if you start from scratch

take either

http://htdp.org/
https://www.edx.org/xseries/systematic-program-design-0

or

http://www.cs.hmc.edu/csforall/
https://www.edx.org/course/cs-all-introduction-computer-science-harveymuddx-cs005x
>>
>>57737714
begin with "learn you a haskell"
that's the best introduction to lisp
>>
>>57737705
>you get the right stuff to 32 bit int precision.
Sorry. I meant float. Your decimals are still constrained because you're in float but your integer portion is still OK.
>>
>>57737714
>i want to study something but don't know where to start
Please fucking use google. Plebbit has an entire fucking wiki dedicated to learning how to program starting from knowing fuckall.
>>
>>57737720
In non-english languages, composite words can work a little differently. For example "rice ball" is "Reisball" (without a space!) in german. It's one word.
>>
>>57737705
With a fixed point taking up the same number of bits, you can get the same amount of precision from division and more precision from addition. You lose speed and range, but you probably didn't need it anyway.
>>
>>57737665
Kek it's sublime
>>57737671
>>57737673
>>57737674
>>57737691
I am converting it to english, give me a moment
>>
>>57737707
It has to do with copyright of ideas and not instances of executable code so I think there's a difference.

>>57737718
>I'm stating the fact that software would be much worse if all software was copyleft open source.
Your basis for this argument assumes that some proprietary software exists though, because that's where all the good programmers go.
>>
>>57737739
([((),()), ((),())],[],[[[]]])

who /lisp/ here
>>
>>57737739
kek
>>
>>57737760
> (_)_)||||||||||||||||||||||D
>>
>>57737760
(((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))


lisp looks loike your moms pissu
>>
>>57737705
Fixed point numbers are not just integers you mouth breather.
>>
>>57737714
SICP is the best book on software design. Programming is such a wide subject. SICP will not teach you much about the theory of computation, but it will teach you about efficient algorithms, big O notation, recursion, functional design, and other stuff that's good for software design. Computer Science and Programming are very large fields. It's like saying "what's the best book to learn physics". There's lots of kinds of physics, and software design is analogous to learning classical mechanics in physics. You can use classical mechanics to create things that are useful and describe and interpret things that are usesful, like motion. But software design won't teach you much about Turing's paper on computable numbers, the entscheindungsproblem, quantum computing, and other more mathematical things, just like a book about classical mechanics won't teach you much about particle relativity or quantum anything
>>
>>57737753
>same precision
Not unless you mod out the remainder and keep it saved to match float.
>>
>>57737772
Ewww, that's asymmetric
>>
>>57737736
i'd say i'm better at math than programming
the only language i know is C and i still think i have much more to learn about it (specially data structures)
i don't know where i should go from here: sicp, c++ or c#
>>
>>57737790
'(((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))


happy now
>>
>>57737791
haskell
>>
>>57737774
See my correction.
>>57737740
>>
>>57737757
>Your basis for this argument assumes that some proprietary software exists though
well, it does exist..

>Your basis for this argument assumes that some proprietary software exists though
The majority of them yes. The majority either wouldn't work in software or spend very little time working in software otherwise. They would need to pursue other industries for their day jobs and work on software in their free time. In such a case they'd be far less good at programming because they don't practice it in their work day, and there;s a good chance many of them wouldn't program in their spare time at all and just do something else.
>>
>>57737791
try python someday
>>
>>57737809
If your argument about a fully open source software world depends on proprietary software existing then it's obviously contradictory.
>>
>>57737791
depends what kind of stuff you want to do. You might find haskell interest as a math fag. OCaml is cool too.

What kind of stuff do you want to make?
>>
>>57737830
I agree. Which is why no part of it depends on proprietary software existing. Not sure why you mentioned that.
>>
>>57737831
no real math fag will find haskell interesting
>>
File: Sad days.jpg (405KB, 480x640px) Image search: [Google]
Sad days.jpg
405KB, 480x640px
Somebody, please >>57737174
>>
>>57737838
So you're saying all the good programmers would simply stop programming if all software was open source?
>>
>>57737842
what's that red shit in otherwise a perfect face?
>>
>>57737798
i don't gedit
>>
>>57737850
>The majority of them yes.
is what I said. Can you not read it clearly the first time?
>>
>>57737863
Human flesh.
>>
>>57736371
Hello /dpt/, I need your opinion on how to implement this

I have 200 txt files. Some files may have the first line containing tags like so

tags: comma, separated, tags go, here


My goal is I want to be able to filter those text files, based on a selected tag(s) like so

sort_files -t music, life, love


That command will aggreagate all files with the tags queried by the -t flag.

Here's how I plan to do it step-by-step:

Using python:

1. Iterate over the files
2. If the first line has tags:, keep track of the filename and its associated tags
3. Through argparse, identify the tags provided by -t flag
4. Iterate over the filenames and their associated tags
5. If any of the given tag is in the associated tags, keep track of the filename.
6. Collect all the candidate filenames and aggregate and concatenate them into a temporary text file.

What do you think?
>>
>>57737805
You have to round off the result of a calculation in both fixed- and floating-point representations, the only difference is that floating-point numbers have better precision near zero that gets worse as you go outwards and fixed-point numbers have uniform precision.
>>
>>57737842
your question is to broad

>how do I start a project, especially on github

git init


Like, what are you looking for? What kind of project do you want to work on?
>>
>>57737831
i want to be able to create software with interfaces (i not even sure how these are made), become smarter or maybe just get a job lol
i'm quite interested on gamedev and microprocessors too, but these are too specific i guess?
>>
>>57737880
Why would that happen?
>>
>>57737885
do it with haskell in one line
ap (ap . (liftM2 ap .) . liftM2 (.) (.) . (.) . (.)) ((. flip) . (.) . (.))
>>
Is there maybe some kind of website or something with a bunch of practice program exercises for a beginner?
>>
>>57737900
What kind of interfaces? interfaces in the Java sense? Or user interfaces?

Too specific for what? What do you want to know about processors?
>>
>>57737169
>The uses for fixed point is growing smaller and smaller is the thing.
The one use case they will always be best at is: fixed precision over the entire range, which is always useful for things like absolute time or position.
>>
>>57736604
>PhD
What?
>>
>>57737900
C# is really good for user interfaces and games dev.

C is good for microprocessors.

C# is pretty comfy. i recommend it.
>>
>>57737941
>microprocessors
I think you mean "microcontrollers" there.
>>
>>57737915
They'd make far less income form programming. Far less job opportunities, far less demand for programmers. They'd look for other fields where smart technically minded people are needed, like engineering.

I'm sure programmers who were programming for years now would continue doing so in their spare time, but far far less people would choose programming as a career path now.
>>
>>57737941
why would you want GC based lang for a video game
>>
>>57737973
because I want to make a open map game like GTA and want to get rid of destroyed objects automaticaly
>>
>>57737973
Because GC isn't that big a deal these days. Unity uses C# as it's main scripting langugae.
>>
Python effectively replaced BASIC, right?
What will replace Python?
>>
>>57737967
>far far less people would choose programming as a career path now

When I look at all those web hipsters, it doesn't sound too bad
>>
>>57737967
>but far far less people would choose programming as a career path now.
Maybe it would be a good thing.
>>
>>57737983
>Unity uses C# as it's main scripting langugae.
and suffers massive performance penalties
>>
>>57737900
I'm assuming you mean Graphical user interfaces

Typically, in GUI design, there's a few basic principles:

1.) The layout is handled by some markup language. In web dev, UI is handled by HTML. In android development, I believe it's XML (which I think is the most used, but oldest and quickly becoming outdated, Markup language). These give you easy ways to define what some elements will look like in your application.

2.) The backend (what happens when you click a button or send some info) is handled by some programming language. Typically, this is done with something called event based programming. This means that you tell the computer "when the button is clicked, do X". In web dev, this is done with Javascript. In Android, this is done with Java. In iOS, this is a language called Swift, or another called Objective C.

You need to pick a real project you want to work on. An application that DOES something. Pick a thing to DO, and figure out how to do that, mostly through google. If you want to start a GUI project, your first google search should be

>How to make a window in [Language]
>>
>>57737932
Yes you found a use case. Congratulations.
>>
>>57737920
Are you trolling me?

Explain that code char by char
>>
>>57737986
>>57737990
I'm not saying it wouldn't be. But less good software would be produced.
>>
>>57737984
python 3
>>
>>57737984
Nothing. Python is perfectly bad.
>>
>>57737930
User interface.

Well, about processors i have a little familiarity with PIC16F877A, a friend of mine had one and lend me for some weeks, i'll probably buy one microprocessor too but i'm thinking about getting an arduino
>>
>>57738002
but it's obvious, what did you don't understand?
>>
>>57738002
>char by char
Okay!
>a
That's the letter a
>p
That's the letter p
>
That's a space
>(
That's a open parenthesis

I'm sure you get the drift
>>
>>57738017
It's not obvious, stop being a meme langage elitist.

>>57738031
You forgot the space bro!
>>
>>57737982
lol

>>57737983
>Because GC isn't that big a deal these days.
It is if it has to stop the world. The future is concurrency and garbage collection in the universal language feature sense is incompatible with that.

>Unity uses C# as it's main scripting langugae.
Key word SCRIPTING.

>>57737967
Good. Shitty programmers are born when somebody with no aptitude enters the industry because it's overpaid. If the inflated value of these low skill jobs decreases because any schmuck can fix low-hanging fruit bugs of an open source codebase, shitty programmers will mostly disappear and good programmers will fill the void.
>>
>>57738046
It doesn't. He made it up.
>>
>>57737899
Sorry I should have specified.

I am going through textbooks on C++ and Java, but I feel like working on something real would help me even more.
>>
>>57737967
>>57738048
Also, the phenomenon of people writing abnormally low quality code for job security reasons only exists because of proprietary software.
>>
>>57738048
>It is if it has to stop the world.
nope

>Key word SCRIPTING
well observed anon. you're a bright one.

>shitty programmers will mostly disappear and good programmers will fill the void.
Good programmers will leave too because they can get more pay in other fields for less work.
>>
>>57738056
Write a little shitty game for yourself. Try stuff. Fail. Try harder. Succeed. Keep trying.
>>
>>57736371
is there a /dpt/ slack?
>>
>>57737999
What did he mean by this passive aggressive comment?
>>
>>57738046
Python damaged you ability of reading elegant code bro. If you think of it as a mathematical function like in high school classes it will make sense.
>>
>>57738081
There's a discord: https://discord.gg/xcVHA2Y
>>
>>57738089
No, there isn't.
>>
>>57738098
Yes there is: https://discord.gg/xcVHA2Y
>>
>>57738086
>using dots as identifiers
>elegant

NOPE NOPE NOPE NOPE
>>
>>57737885
>>57738046
No memeing, it's easy with bash
head -n 1 $file | grep -e 'filter'
>>
>>57738076
Then there'd be no programmers left.
>>
>>57738104
No, that's just some faggot's discord that some people here unironically use.
>>
>>57738056
There's plenty of places to look up programming exercises.

Programming exercises of varying difficulty:
>https://better-dpt-roll.github.io/
>https://adriann.github.io/programming_problems.html
>http://www.programmr.com/exercises

Mathematical kind of programming problems:
>https://projecteuler.net/

Take some advice from a programming book I read:

>If you have a computer, and you have a problem, you should learn to program.

Think of something you want your computer to do that nobody else has bothered to write software for. Is there anything that you wish your computer did that it doesn't?
>>
>>57738110
you forgot to iterate over multiple files
>>
>>57738116
>Then there'd be no programmers left.
there would be some hobbyists. And some would have paid jobs making purely FOSS, but those are insanely rare.
>>
>>57738129
I'm not writing all of the code for you. Lrn2bash
>>
File: 1472432133989.png (838KB, 693x720px) Image search: [Google]
1472432133989.png
838KB, 693x720px
>>57737776
Well, then sicp its exactly what i'm looking for.
Thanks.
>>
>>57738116
No, because there still has to be some software
>>
>>57738118
Don't be salty anon. We have a grand ol' time on the discord.
>>
>>57738084
Nobody has argued that you never use fixed point and you picked the most trivial case.
It's just a fairly pointless comment.
>>
>>57738132
Sounds like a recipe for high quality code to me.
>>
>>57738143
All tripfags.
>>
>>57738136
fair point
>>
>>57738153
I agree. Just much much less of it then there is today.
>>
>>57738110
I tried this way, but not all first lines have the tags: line

with python i can atleast check it easily
>>
>>57738160
What's the problem, then?

The original argument was that a fully open source world would mean low-quality code.
>>
>>57738139
what a badass greekhead>>57738143
>>
>>57738086
I'm a C main, I happen to like python because I can spend an hour instead of a day on a problem
>>
>>57738143
discord was a mistake
>>
>In HTML the <meta> tag has no end tag.
Great, now I have to find a reader specifically for HTML.
>>
>>57738163
python

>>> for i in a:
... with i.open() as f:
... x = f.readline()
... if "tags: " in x:
... print(i)
...
/media/secrets/journal/Entries/2016/November/Entry-Nov-28-16-0418.txt

>>
>>57738178
well, the quality of certain kinds of software would be much worse.
>>
>>57738211
song related: https://www.youtube.com/watch?v=lcAzmNcdlsM
>>
>>57738211
import Text.HTML

main :: IO ()
main = do
let fileName = "somedir/"
input <- readFile fileName
let html = parseHTML5Online fileName input
either handleError doWork html

handleError killall = putStrLn "not a HTML file"
doWork dir = (print.findOldest.tail) (filter (\x -> length x == 2) html - 3)

findOldest :: [Record] -> Record
findOldest [] = []
findOldest items = foldl1 (\a x -> if age x > age a then x else a) items

age [a,b] = toInt b

toInt :: String -> Int
toInt = read
>>
>>57738211
Try XHTML. All tags must be closed in XHMTL
>>
>>57738211
>he thought HTML was XML
With HTML5 its not even SGML
>>
>>57738242
>>57738253
>>57738255
>>57738264
I just want to search for text in all elements for a given web page.
>>
>>57738226
There's zero correlation between proprietary software and quality or quantity of developers and quality.
>>
>>57738211
just use BeautifulSoup
>>
File: SOS.png (197KB, 1486x1399px) Image search: [Google]
SOS.png
197KB, 1486x1399px
>>57737671
>>57737673
>>57737674
>>57737691
>>57737754
Here is the translated version.
>>
>>57738343
post beautiful soups
>>
>>57738327
just for the sake of scientific integrity: can you please cite a study supporting this?
>>
>>57738351
it took you too long. The guy who was willing to help you went away.
>>
>>57738253
this is bait
>>
File: soup.jpg (22KB, 564x376px) Image search: [Google]
soup.jpg
22KB, 564x376px
>>57738354
>>
>>57738361
It's the null hypothesis.
>>
>>57738351
Tip of the day: you can copy and paste text into other windows.
>>
>>57738351
what i said. games in less_than_ten_goals_func is not an array. it's an instance of "game", which is a struct.
>>
USB cord was coming loose from PS4 controller so I designed a program to detect where it was coming loose. Turns out the cord was faulty, not the controller.

#!/bin/bash

# Loop forever
while true ; do
lsusb | grep -i dualshock
sleep 0.25 # stop program for 0.25 seconds
clear
done
>>
>>57738485
*claps unironically*
>>
why are all async stuff so damn convoluted
>>
>>57738485
Always start from layer 1 when troubleshooting
>>
>>57738544
should've used monads
>>
>>57738450
How would you do what I am trying to do instead then?
>>57738435
There is a lot of shit in between the images, so copy pasting would tkae up to much space.
>>
>>57738561
if you paste the code as text, i'll try to fix it. i hope you know how to find differences between files.
>>
>>57738544
>xe fell for the async meme
>>
>>57738561
check out pastebin.com btw
>>
>>57738605
how is "xe" pronounced btw?
>>
>>57738625
Z
>>
>>57738593
It's an assignment so if I were to paste it in here I would get busted for plagiarism
>>
>>57738635
danish plagiarism catchers certainly do not scrape 4chan's /dpt/
>>
>>57738625
zi
>>
>>57738625
he
patriarchy wins again
>>
>>57738658
No but their programs do
>>
>>57738635
ok, i'd take games as a pointer in that function:
> game *games
furthermore, you're passing games wrongly in main. you're pointing just past the end of the array the way you're doing it.
>>
Baroque question with a polite sage:
I ran
find /usr/include/ -type f -name '*.h' -exec sh -c 'for i; do grep "((void \*)0)" "${i}"; done' _ {} +


and this returned
 * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
#define NULL ((void *)0)
#define NULL ((void *)0)
#define NULL ((void *)0)
#define NULL ((void *)0)
#define setlocale(n, s) ((void *)0)
#define NULL ((void *)0)
#define NULL ((void *)0)
#define NULL ((void *)0)



That first line interests me. Does it say that C++ defines NULL to be an integer of 0 rather than a null-pointer like C?
>>
>>57738633
>>57738674
So, just like german people say "the"?
>>
>>57738702
NULL is weird in C++.

Practical advise: use nullptr
>>
>>57738732
Gotcha. Thanks!
>>
>>57738716
correct
>>
>>57738702
C++ cannot define it as (void *)0 because C++ doesn't allow implicit casts from void *, so code like:
int *p = NULL;

wouldn't work.
>>
>>57738732
I know that's what is recommended, but why did they want to change NULL by nullptr? What is their goal?
>>
>>57738701
Well that removed all my compiler errors except for: invalid operands to binary * (have 'int' and 'int *')
*number_of_rounds_with_less_than_ten_goals = *number_of_rounds_with_less_than_ten_goals + 1;
>>
>>57738696
be the danish hero we need and find out

>>57738702
>The macro NULL, defined in any of <clocale>, <cstddef>, <cstdio>, <cstdlib>, <cstring>, <ctime>, or
<cwchar>, is an implementation-defined C ++ null pointer constant in this International Standard (18.2).

Really NULL is 0 at the bit level in every modern system you'll use
>>
>>57738758
implicit casts from/to void* are so pretty ;_;
>>
>>57738767
>>57738758
Good to know, thanks!
>>
>>57738764
that shouldn't happen in the code you posted. something's fishy.
>>
>>57738803
Yea since I am dereferencing it this shouldn't occur right?
>>
>>57738758
Which is fucking stupid imo. Exactly what kind of error is that supposed to prevent anyway?
You 'fix' the problem by adding an explicit cast, but you're still relying on that void pointer having the correct effective type in the first place, so the cast is just useless extra typing.
>>
>>57738840
yeah
>>
RIP thread
>>
>>57738840
a few things with your code btw

games[N_OF_GAMES] is out of bounds
a[3] = {1,2,3}; a[0] == 1, a[1] == 2, a[2] == 3, a[3] == OUT_OF_BOUNDS

int j is probably intended to be incremented somewhere

in the forloop it should be i = i+6

and you're doing games[x+y] when games isn't a pointer

I think what you should be doing is make less_than_10_goals_func take a pointer to games and pass the array games into it and not a array-item

you should be doing
a = games[x].blah + games[x].blah +
games[x + 1].blah + games[x + 1].blah;

and stop at [x + 5]
>>
C# code monkey here. I'm being pressured into writing a shitload of unit tests at work and I am fighting with the notion.

I get the point. It means I can test most of my code without having to fire up the entire application every time. Makes tracking the consequences of my breaking changes a lot more easily. And it simplifies debugging a lot. But I don't know if it's worth doing systematically regardless of the scope or purpose of the project.

Basically, it requires me to re-engineer a whole bunch of shit (eg change all access modifiers to public, make all properties virtual so they can be mocked) and perpetually design my code with the presumption that it will be called externally even though that will most assuredly never be a necessity outside of the tests themselves.

Just setting up one fucking test with a senior took two hours until we had to cut the meeting short and do something useful. I'm wasting time fighting with the shitty fucking IDE and sifting through documentation just to make sure that these tests fucking work, presumably to save time, when the application itself is so simple that I can isolate any bug in a couple of minutes with some break points and debug level logs here and there.

Am I missing something obvious? Or am I dealing with morons who can't distinguish "potential" and "actual" value?
>>
>>57739065
disregard the thing about j
>>
>>57739089
i don't know how to write test correctly in C#, but you're* doing it wrong.

(* you, plural, meaning the team)
>>
>>57739145
elaborate
>>
>>57739089
>Basically, it requires me to re-engineer a whole bunch of shit (eg change all access modifiers to public, make all properties virtual so they can be mocked) and perpetually design my code with the presumption that it will be called externally even though that will most assuredly never be a necessity outside of the tests themselves.
usually this is a sign your code has design problems senpai
you've already listed plenty of reasons why testing is great, just get to it
the sooner in the dev process you deal with this the better
>>
NEW THREAD >>57727976
NEW THREAD >>57727976
NEW THREAD >>57727976
>>
>>57739065
I am doing
a = games[x+1].blah + games[x+1].blah +
games[x + 2].blah + games[x + 2].blah;
because i have 198 games to go through so if didn't increment the first x's with 6 i won't hit whats inside games[7].blah and so on
>>
>>57739166
OLD THREAD
OLD THREAD
OLD THREAD
>>
>/dpt/ is now in a circular linked list
HELP
>>
File: 8hKWkYn.jpg (559KB, 800x815px) Image search: [Google]
8hKWkYn.jpg
559KB, 800x815px
>>57739198
NO ESCAPE
>>
>>57739181
if you do games[x+1] then you skip games[0]
>>
>>57739161
>usually this is a sign your code has design problems senpai
my code has design problems because I use access modifiers properly?

>you've already listed plenty of reasons why testing is great, just get to it
that doesn't mean it warrant investing that much time

>the sooner in the dev process you deal with this the better
or the less shit you contend with the better

there is no value in saying "it's good fag do it". all this tells me is you haven't given it any consideration.
>>
>>57739233
I am not doing games[x+1] i am doing games[x+i] i starts out as a zero
>>
>>57739266
i = 0
games[1+i]
>>
>>57739266
But I did start at X = 1 so I still fucked up
>>
Where the fuck is the new thread?
>>
>>57739266
>>57739290
>>57739293
I was using x in place of i so your danish ninjas don't get you

>>57739301
not where but when
>>
>>57739301
>>57739205 apparently
>>
>>57738163
grep can also search regular expressions line by line.
Use grep on grep
>>
>>57739322
Heh, danish ninjas are fucking deadly. The program now compiles, I need to make a function that prints it now
>>
>>57739265
>my code has design problems because I use access modifiers properly?
i cant tell without looking at your code, but if writing tests requires you to make a bunch of access modifiers public and properties virtual, then yeah its a sign of design issues

>that doesn't mean it warrant investing that much time
i dont understand whats taking so long tho, explain
if its about setting up the suite itself, thats a one time thing
writing the tests themselves shouldn't take too long once you're up and running

>or the less shit you contend with the better
its up to you dude, but all i hear is "i've already listed 5 good reasons for why i should do this thing but im too lazy to do it anyway"
>>
>friend from high school who has a successful tech startup (he's about average with tech just good at business)
>messages me asking if I still do stuff with computers
>link him my github
>offers me a job on the spot £2000 a month
>all my code is just stolen, I understand how it all works and shit but I just rewrite code I find online

what do I do lads? do I turn him down? do I keep faking it and hope nothing happens? do I take this time to learn a programming language?
>>
>>57739450
Ask him 2500 pounds (or 3000 if you're courageous).
>>
int d = NULL;

printf("%d", d);

This prints out nothing, not even zero.

When I test a pointer that points to
int d = 0;
then it returns true. Does that mean that zero is not really zero?
>>
>>57739466
I could probably talk my way into 2500, I'm just worried about my first programming job to be happening at a time when I don't know how to program
>>
>>57739474
it means your forgetting something (old binary maybe)
you could add a \n and see what happens
>>
>>57739450
just take the job, the rest of the people at the company will probably be shit too, but don't expect much job security because the company could fail or get bought up
>>
>>57739508
Sure enough. Thanks. With \n it prints "0", minus the quotes.
I'm still a little confused as to the difference between NULL (as in the pointer) and zero. But thanks for your reply, it now does what I thought it should do.
>>
>>57739545
it might not have printed because it was being buffered until a newline or more input or maybe the terminal didn't print because of no newline

as for the difference between NULL and zero, effectively none but still use NULL for pointers and zero for numbers
>>
>>57739573
Okay, thanks.
>>
>>57739573
I guess I can conclude that NULL == 0 but 0 isn't NULL.
>>
>>57739617
not really, they're the same (in likely any computer environment you'll use) but NULL clearly indicates that you're dealing with a pointer and shouldn't be be used for non-pointer values
>>
>>57739720
I want to get on your level now. Why does this evaluate false:
  int *ptr = NULL;

if (ptr){
printf("true\n");
} else {
printf("false\n");
}


while this evaluates to true:
  int d = 0;
int *ptr = &d;

if (ptr){
printf("true\n");
} else {
printf("false\n");
}
? To me this means that they aren't really the same.
>>
>>57739786
if(x) on non boolean is false for x == 0 and true for x != 0
>>
>>57739854
Never mind brah. I found it. I wasn't consistent with *ptr. I never tested it... I tested ptr, without the dereference. When I test *ptr, it's false like NULL.
>>
>>57739882
I'm glad you understand.
>>
free book
https://leanpub.com/python-apprentice/c/cybermonday2016
>>
FUUUUUUCK
FUUUUUCKKKK
FFFFUUUUUCKKKK

I hate that I'm not a pajeet. If I were more stupid I wouldn't care about anything, I would happily code JSF shit without any brainwork.
I have spent a significant portion of my life programming and I still cannot decide on some basic stuff. There are too much tradeoff everywhere, too much things to think about.

FUUUUUCK!
>>
>>57738327
>There's zero correlation between proprietary software and quality or quantity of developers and quality.
There absolutely is. Open source software tends to be turds. Proprietary software tends to be of higher quality.
>>
>>57740184
>Proprietary software tends to be of higher quality
It's the total opposite anon.
>>
>>57740184
Nope. For example, OS based on the open-source XNU kernel is better than WIndows. That's the power of OSS!
>>
>>57740210
Give me a single example where this is not true
>>
>>57740267
>OS based on the open-source XNU kernel
Which OS would that be?
>>
>>57740308
macOS, obviously.
>>
>>57740117
You're just too dumb to realize how dumb you are.

Otherwise, you would have moved on already instead of wasting time on the simple stuff.
>>
>>57740344
Last time I checked that wasn't an open source OS
>>
>>57740362
But the kernel is open-source. OS can't work without a kernel, which means that XNU was a most important factor of macOS success. OSS rocks!
>>
>>57740355
Did I say that I waste time on simple stuff? No, I said that I can do the simple(and no-so-simple) stuff, but I see too many options, too many trade-offs, too many alternative ways to do the stuff. This drives me nuts.
I wish there were a single perfect language for all the tasks. But there isn't(and cannot be) one. It makes my soul bleed.
>>
>>57740475
>I see too many options, too many trade-offs, too many alternative ways to do the stuff. This drives me nuts.
Yea, that's typically the symptoms of being pretty dumb. You're not retarded, just not the sharpest tool in the shed.

Of course everyone can see the many options and trade-off, but if it's so much of a problem for you that you need to rant about it on the Internet, you need to learn to deal with it.

>I wish there were a single perfect language for all the tasks.
Then you fundamentally misunderstand the problem. The no free lunch theorem applies.
>>
>>57740530
Nice to see a man who makes conclusions without reading the whole message.
>>
>>57740636
Why don't you go "make your soul bleed" someone else, faggot?
>>
>>57740530
> Of course everyone can see the many options and trade-off
Can they?
"Programmers know the benefits of everything and the tradeoffs of nothing"
>>
>>57740697
That's a nice quote, but it's really just an opinion.
I'm sure I can find you a quote that says the contrary if you want. Programming is all about tradeoffs, from the language you use to the algorithms, libraries, data structures and the amount of corner-cutting done.
>>
>>57737885
I'm this anon, I've done my sort script.


I generate 60k+ plus journal entries (3kb - 150mb each)


******Summary******

There are 7 tags in over 5715 entries out of a total of 63767 entries

******Common Tags******

technical: (3810), sex: (3810), tags: (1905), dream: (1905), weed: (1905),

******All tags (alphabetical)******

dream: (1905)
excited: (1905)
sex: (3810)
tags: (1905)
technical: (3810)
test: (1905)
weed: (1905)

real 0m6.102s
user 0m5.256s
sys 0m0.836s



So about 1 sec = 10,000 entries

Python rocks
>>
File: SOS.png (201KB, 1486x1399px) Image search: [Google]
SOS.png
201KB, 1486x1399px
I am back with more problems. when I run the program it prints m as being 15 and never changing, do you guys have any ideas?
>>
>>57740844
>>57740869
btw it's nearing time to move over to the other thread >>57739205
Thread posts: 394
Thread images: 23


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