[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: 318
Thread images: 35

File: le_lispman_XD.png (379KB, 480x411px) Image search: [Google]
le_lispman_XD.png
379KB, 480x411px
What are you working on, /g/?

Previous Thread: >>58921723
>>
First for C is a miracle of this universe.
>>
>>58928112
Lisp is the most powerful programming language.
>>
>>58928121
C is deprecated garbage. Enjoy your buffer overflows.
>>
First for race conditions.
>>
>>58928131
For something to be deprecated, something else has to deprecate it.
Tell me, what deprecates C?
>>
>>58928132
Race condition: if you are an Indian, you can't work here.
>>
>>58928138
Literally any modern middle-level language: Rust, Nim, Go, etc.
>>
>>58928156
Indians can't work on 4chan?
>>
File: 1404947307314.jpg (134KB, 1280x720px) Image search: [Google]
1404947307314.jpg
134KB, 1280x720px
>>58928177
Jesus Christ, you can't make this shit up.
>>
>>58928188
C and Lisp are the only languages worth learning.
>>
>>58928138
"deprecated" on 4chan has a different meaning. In the real world, it means "obsolete" but on 4chan it means "wahh, I don't like it. Stop using it. Wahh."
>>
>>58928201
This is the most /g/ post I've seen in a while

Completely out of touch with any reality other than working on fun projects in your mothers basement.
>>
>>58928238
>Reddit-spacer trying to talk down on others
I think you should probably kill yourself, mate.
>>
>>58928238
>fun projects
What is programming without fun?
>>
>>58928249
Software engineering.
>>
>>58928238
>not recognising a Stallman opinion on sight
>>
>>58928262
Stallman did a hell of a lot more than you've ever done.
>>
>>58928249
Wage-slavery.
>>
>>58928249
Making things to other peoples shitty specification
>>
>>58928269
"By contrast, I find C++ quite ugly.

The flaws of C++, as I recall from when I studied the matter around 1990, include syntax and semantics. As for syntax, its grammar is ambiguous, and it is gratuitously incompatible with C, which blocks the smooth upgrade path from C to C++.

As for semantics, the abstract object facility of C++ is designed around the case where the real type of an object is known at compile time. However, in that case, abstract objects are equivalent to a naming convention for functions to call. The case where abstract objects add real power to a language is when the type is not known until run time. C++ does handle that, but it seems to be an afterthought, a poor relation.

I suspect that I would find plenty of ugliness in the template library, but I don't know. That was added to C++ after I studied it." -Ricardo Stallmanu
>>
>>58928269
I'm a goddamn doctor. And not the fake, academic kind.

But more to the point, I never said otherwise; I was just pointing out that he failed to recognise an obvious Stallman reference.
>>
>>58928294
Please, just go back to /r/eddit, and take your attention whore spacing with out.
>>
>>58928306
I guess you're just trying to provoke, then. Have fun, dude.
>>
>>58928306
>out
you*
>>
>>58928294
What is a doctor doing shitposting on /g/ when he could be out saving people?
>>
File: McCoy.jpg (23KB, 300x250px) Image search: [Google]
McCoy.jpg
23KB, 300x250px
>>58928294
>I'm a doctor
>>
>>58928245
>>58928306
>Anything I disagree with is reddit

So is /g/ a safe space now?
>>
>>58928313
We get days off occasionally.

I'm the guy trying to hack user-defined disjoint types into R4RS Scheme.

>>58928320
Hells yeah. But not that one.
>>
>>58928177
>"modern middle-level" = shit
>>
>>58928131
I can't see how buffer overflows can still be an inherent part of the C language with gets() being removed from the standard library. Size-bounded functions must prevent any way of overflowing buffers. A strictly valid C program shall have no undefined behavior, hence no overflow or fatal error of any sort.

But writing strictly valid C programs is not easy. Theoretical verification is not achievable on account of the halting problem undecidability, practical verification can only help to find invalid cases, but not prove validity at 100%.
>>
>>58928324
No. Redditors format their posts in a certain way, that is very easy to identify.
If you format your post in that way, like you have, it means that you're a redditor, and you should fuck off.
>>
>>58928348
strlcpy and strlcat are still not part of the standard though.
>>
>>58928348
>A strictly valid C program shall have no undefined behavior
Any program can be strictly valid C and still not account for user input.
>>
File: AtLongLast.png (115KB, 1481x1236px) Image search: [Google]
AtLongLast.png
115KB, 1481x1236px
>>58928112
That feel when after 8 weeks of wracking my brain trying to figure out how to extract the critical data from a big report, I finally figure it out. And its so simple, it can be implemented in a function that is only 12 lines long.

Sometimes I think I might literally be retarded. Like quite literally.
>>
>>58928400
8 weeks is quite a long time. Did you ask anyone for help?
>>
>>58928400

Welcome to programming... too busy thinking about complex shit to realize the answer is easy and staring you in the face is the usual.
>>
>>58928414
Kinda-Sorta. I've asked my coworkers/boss for more information about the process and about the data we're working with, but their response is usually either "I don't know" or something along the lines of "Just do your job and leave the scripting to Engineering or IT".

I don't actually work in the Engineering or IT department. I work as the support technician. I'm not really supposed to be working with any of this. I just assist the operators.

But in my off time I've been writing utilities to automate bits and pieces of our job. One of the things I've wanted to do was replace one of their existing wizards, and integrate the replacement with the other automation utilities.

But I couldn't do that, until I could figure out how to extract the critical data from these report files. (and only the critical data; this data will serve as input for my dynamic FDA adjustment calculator)
>>
>>58928112
I quit math grad school and now I'm learning Haskell and programming language theory for fun.
Why does /g/ hate Haskell anyway?
>>
>>58928400
If you spent anything more than a weekend doing that, you might be.
>>
>>58928400
What does it do?
>>
>>58928491
/g/ doesn't

PLT is great
>>
>>58928467
>he does it for free
You better be asking for a promotion.
>>
>>58928491
/dpt/ loves Haskell, which is why it talks about it so much.

However, it's a good trolling point, so you get haters and false-flaggers fairly often, too.
>>
>>58928491
>quits math grad school
>learning Haskell
It all makes sense now!
>>
File: corrform1.gif (3KB, 394x222px) Image search: [Google]
corrform1.gif
3KB, 394x222px
>>58928501
Basically we take readings from 3 perfect phones for a bunch of radio frequencies.

Each series of readings is stored in XML form in a report file. (along with a bunch of other useless junk; the report file is structured very weirdly)

We use the measured values compared to the acceptable-threshold to calculate how far off that phone is.

We do this for all 3 phones.

Then we find the statistical correlation between the measurement-values and the FDA db Adjustment Values.

We use the statistical-correlation and the readings to generate an adjusted FDA, and we re-run all 3 phones.

When all 3 phones finally are correlated within 1 db of eachother, we use that FDA as the active FDA file.

I want to automate a lot of the grunt-work we do, but to do so, I needed to understand how to extract the values from the report file that are actually being used as inputs to the FDA Adjustment wizard.

Next, I need to plug them in to the correlation formula. (hope i've got the right one)

Then I can write the fda-adjuster, and integrate it with the other pieces of my automation utilities.
>>
>>58928594
Forgot to mention:
source for pic is this page: http://socialresearchmethods.net/kb/statcorr.php
>>
>>58928594
>We use the measured values compared to the acceptable-threshold to calculate how far off that phone is

far off from what?
>>
Need help!! I just made a guess the number game. It works great. Then i tried add "do u want to play again" option but program doesn't enter into the while loop again. What did i do wrong? Here is the java code:

  
import java.util.*;
public class gamey {
public static void main(String args []){

int num1;
int num_guess;
int num2;
int num3 ;
boolean value = true;
String answer;

Scanner scn = new Scanner(System.in);
Random rnd = new Random();

num1 = rnd.nextInt(100);
num2 = num1;

while(value){

System.out.print("Your guess : ");
num_guess = scn.nextInt();

num3 = Math.abs(num2-num_guess);
if(num3 > 50){
System.out.println("Very Cold");
}
else if(num3 > 30 && num3 <= 50 ){
System.out.println("Cold");
}
else if(num3 > 20 && num3 <=30){
System.out.println("Warm");
}
else if(num3 > 10 && num3 <=20){
System.out.println("Hot");
}
else if(num3 > 0 && num3 <= 10){
System.out.println("Very Hot");
}
else if(num3 == 0){
System.out.println("You find it!");
System.out.println("NUMBER [" + num2 + "]");
value = false;
}
}

while(value = false){
System.out.println("Do you want to play again? (Y / N)");
answer = scn.nextLine();
if(answer.equalsIgnoreCase("y")){
num1 = rnd.nextInt(100);
num2 = num1;
value = true;
}else if(answer.equalsIgnoreCase("n")){
value=false;
}
}
scn.close();
}
}
>>
>>58928615
how far off the phone's measured RF output (in decibels) is from the target value.

The target value is the median of the minimum accepted value and the maximum accepted value.

I think the min and max values are just some static value we get from the government or something. I don't really know where they get their numbers. But the RF transmission power must be within a certain threshold. The phones' deviation is based on their measurement and the median of the threshold.

And we correlate the values of 3 phones to get the ideal Frequency-Dependent-Adjustment (FDA) values that should be used to test all other phones of that model.

This is the science as I understand it. But most of this I've picked up from chatter, no one has formally taught me any of this. I don't really get much opportunity to talk with the engineering guys.
>>
>>58928664
You don't need a separate exit variable. The basic game loop should look something like this pseudo code.

while(true) {
//print shit here
if(answer == trueval) {
// set num values, perform game logic
} else if( yes == falseval) {
//Do your cleanup / exit message shit
break;
} else {
// Invalid input yell at the user
}
}


I hope that is enough to finish your homework.
>>
>>58928664
First of all, write Switch statement for all those if elses

Second, write a Method that will perform your calculation

If you set value to false and then select play again: Y you just call that method

Right now it just sets the value to true and it ends the program, it doesn't iterate again
>>
>>58928112
Best C++ textbook that people actually read? (Not the 1k pages bibles that no one actually reads pls)
>>
>>58928744
>>58928754

thank you i'll try this.
Also this is not my homework i am teaching myself how to program.
>>
>>58928762
>i want to learn to program in 100 pages
>>
>>58928138
Turbo Pascal
>>
imagine i have this folder structure
.DS_Store
├── folder1
│ ├── 1.txt
│ ├── abc.txt
│ ├── cnkjsdf3.txt
│ └── kkfgfg.txt
├── folder2
│ ├── 2
│ ├── 2_1.txt
│ ├── 2_2.txt
│ └── 2_3.txt
└── folder3
├── 12
├── dassdsad.txt
├── asas.txt
└── zaza.txt


if i put in my .gitignore something like
*.DS_Store

it will prevent DS_Sore from appearing in all folders and subfolderes, or only where it is located?
>>
>>58928765

A good thing to be conscious of is the difference between "=" and "==" the former is assigning a value and the later is a comparison operation.
>>
File: bfd7dcd1265c30d8608648b0648c9396.jpg (539KB, 1110x850px) Image search: [Google]
bfd7dcd1265c30d8608648b0648c9396.jpg
539KB, 1110x850px
>>58928294
>I'm a goddamn doctor.

That's cool I thought I was the only doctor on /g/
>>
>>58928491
lazy default makes it really hard to reason about for performance
if OCaml had HKT and type classes then people would move there (or if idris gains traction)
>>
>>58928832
Cool. What type?

I'm sure there are a couple of PhDs hanging around, at least.
>>
Post a programming challenge. Not one of the stock roll-for-a-challenge images, but a single problem for everyone to solve in different languages. Bonus points if it isn't FizzBuzz or inverting a tree.
>>
>>58928849
The medical type.
>>
Can you specifiy an empty array with a fixed size?
I want it to be of length n, but I don't want the int array to be filled with zeroes.
>>
>>58928859
Fair enough, I meant speciality.
>>
>>58928854
Write a maze in as few lines as possible

bonus: it's only vertical and horizontal lines
>>
>>58928854
Create a trainable model to judge the level of shitpostiness of any given 4chan post.
>>
>>58928854
Invert a FizzBuzz tree.
>>
>>58928865
Oh, well I don't have one yet but I'm a neurology resident.
>>
File: asdf.jpg (1KB, 203x209px) Image search: [Google]
asdf.jpg
1KB, 203x209px
>>58928854
Given two strings X and Y, write a program that determines if X is a substring of Y. Optimize for speed and space.
>>
For C#, which comes first: learning about events or learning about delegates? Trying to implement some legacy VBA script that makes subjects "dynamic" for mail merge in my C# program.
>>
>>58928883
>Optimize for speed and space.

fuck you
>>
>>58928881
Awesome. I mainly do acute medicine and intensive care (common training pathway in the UK).
>>
>>58928883
>Optimize for speed and space.
The bright folks that wrote the standard library implementations already did this for me.

I'd just call the default contains method.
>>
>>58928881
Shoulda gone into psychiatry.
>>
>>58928783
>>58928783
BUMPERINO
>>
>>58928854
Write a Quine in your language of choice.
>>
>>58928888
Yes.
>>
File: 1466559848718-fs8.png (40KB, 469x428px) Image search: [Google]
1466559848718-fs8.png
40KB, 469x428px
>>58928854
Find the 2nd smallest integer in an array of N integers. Runtime restraint: N + O(log N) comparisons.
>>
>>58928905
Bumping your post that has literally only been here for less than 15 minutes is maximum faggotry.

I was about to answer you until I saw this post.

Off yourself.
>>
>>58928924
did i trigger your autism?
>>
>>58928854
Devise and implement a data structure that can be used to hold character strings and that allows you to reverse arbitrary sections of the strings efficiently.

Example application: DNA sequences.
>>
>>58928896
That's awesome. Back then in medical school I got to shadow one of my city's most respected doctors; he was the head of my hospital's ICU and they actually named it after him. It was really intense.

>>58928902
I will, once I'm done with neurology. I want both specialties.
>>
>>58928923
What's the challenge there? You just N comparisons.
>>
>>58928953
Yeah, I got to do my elective in ITU in medical school. It was way over my head, but great fun.
>>
>>58928762
>I want to learn something without actually learning it
>>
>>58928923
ez
kek :: [Integer] -> Integer
kek = (!!1) . sort
>>
File: 1481100956747.jpg (33KB, 400x387px) Image search: [Google]
1481100956747.jpg
33KB, 400x387px
21656d6167206120676e696b616d206d2749
>>
Is chapel good c++ alternative?
Designed for parallelism
Manual memory management
It looks like way better D.
>>
How do I choose what programming language should I learn? I just want to learn programming.
>>
>>58929042
https://en.wikibooks.org/wiki/Haskell
>>
>>58929042
haskell honestly
http://haskellbook.com/
>>
>>58929042
Choose the most popular ones and adjust to your needs (scripting/gamedev/business apps etc)

So it's Java, C#, C++, Python

Choose one and enjoy infinite tutorials and books
>>
>>58929060
his needs is
>I just want to learn programming
>>
is it a silly idea to write a front-end for wget?
>>
>>58929053
>>58929055
i said programming language
>>
>>58929074
yes, then we said Haskell
>>
>>58929042
https://www.youtube.com/watch?v=LR8fQiskYII
>>
>>58929068
thanks for the idea
>>
>>58928975
So, have you been able to apply your programming ability to medicine in some way?

I'm looking for opportunities on that front. So far, they helped most when I needed to crunch numbers for papers. I feel I should be doing more. I started researching about electronic health records because the systems I used in the past sucked so bad...

I also like how many parallels exist between concepts in computer science and biology in general. Biochemistry was such a fun subject. I've always liked stuff like life support algorithms. I can't look at them without feeling that I'm some kind of medical machine executing them as a program.
>>
>>58929042
Don't learn Haskell, it's a local meme. Learn Python.
>>
>>58929042

Learn Smalltalk.
>>
>>58929042
Haskell
>>
>>58929101
I already do small talk with people
>>
>>58929042
http://www.msen.com/~clif/TclTutor.html#download
>>
Haskell is a meme
http://stackoverflow.com/questions/1604790/what-is-haskell-actually-useful-for
>>
>>58928177
>meme,meme,meme, etc
this is what you sound like.
>>
>>58929100
>Learn Python.
Absolute trash
>>
>>58929173
>tfw not an argument
>>
>>58929173
It's good as a starting point which shows the current state of modern programming: OOP, etc.

It will be useful for a bloke in many areas.
>>
>>58929042
Learn C.
It's simple to understand. It's fast. It's a great start to learn other programming language like C++ and Java.
>>
>>58929211
No it doesn't
Modern programming has moved away from OOP
Modern languages are adding lambdas (Python closures are trash), are strongly typed, encourage immutability (some of the time), etc
>>
>>58929238
/dpt/ has moved away from OOP, /dpt/ is not the modern programming. It's a bunch of retards which uses non main stream languages as a social identity.
>>
>>58929269
Didn't realise /dpt/ had the power to make modern languages add lambdas
>>
>>58928112
I don't like this cat
>>
File: 1476138812905.jpg (26KB, 600x337px) Image search: [Google]
1476138812905.jpg
26KB, 600x337px
>>58928112
I'm a complete novice when it comes to programming. Let's say I've finished this ruby on rails tutorial to make a basic website: https://www.railstutorial.org/book/beginning and I want to redesign every page to look decent when viewed at a variety of resolutions, inclduing the top 4 most common ones on this page: https://www.w3counter.com/globalstats.php

Keeping in mind that I'm a total beginner when it comes to this sort of stuff and that I'm having to figure all of this out through googling, asking for help on rare occasions, and implementations that feel more like trial-and-error than anything else, how should I go about doing this? Based on what I've read on this page and others: http://blog.teamtreehouse.com/which-page-layout it sounds like going with a fluid/liquid page layout would be best, starting by redesigning the pages for mobile first and working my way up to make them look better at various desktop resolutions. But is that actually right, or is this outdated information, or what?
>>
i wrote a password manager in rust.
the unique thing about it is that it encrypts the database with a one-time pad. this is literally unbreakable.
https://github.com/InaneBob/rustpass
>>
>>58929444
Neat
>>
>rolled brainfuck interpreter on challenge yesterday
Now I need some (large/complex) BF scripts to test it. Any recommendations?
>>
File: when the D hits you.jpg (23KB, 512x512px) Image search: [Google]
when the D hits you.jpg
23KB, 512x512px
https://dlang.org/blog/2017/02/13/a-new-import-idiom/

>In this particular case, the total compilation time dropped to ~30% of the original, while the binary size dropped to ~41% of the original.
>>
https://www.bassi.io/articles/2017/02/13/on-vala/
First for Vala is dead.
>>
>>58928762
Read the C++ ISO standard.
>>
>>58929621
>I’ve only seen a bunch of comments on Reddit about this, but nobody cares about that particular cesspool of humanity.

kek
>>
>>58929444
>https://github.com/InaneBob/rustpass/blob/master/src/crypto.rs
>one-time pad
No, that's a stream cipher built from a hash function.

If you were to update the database password(remove, add) with the same length(you hash that as well) then take the XOR between the old database and new one you would have the required section of the keystream to decrypt both.

C1 = ("oldpassword" xor K)
C2 = ("newpassword" xor K)
K = C1 xor C2
>>
>>58929705
i dont think you are qualified to talk about cryptography kiddo
>stream ciper
>hash function
>xor
confirmed technobabble. dont ever talk to me again you n00b. rustpass crypto is impeccable. i majored in computer science and have a bachelors degree in applied cryptography.
fucking kill yourself m8
>>
>>58929658
do they publish a new one every time or just amend old ones?
>>
>>58928762
>1k pages
that's not the problem, Stroustrup's faggotry I can't stand. at all.
>>
>>58929747
Whatever, enjoy your thing.
>>
>>58929705
>>58929747
fucking faggot
i pushed a database to the repo. try and crack it if you think you are the hot shit nigger.
https://github.com/InaneBob/rustpass/blob/21fd312912b15ccdafc32654ad07a1eac9e14fec/crackme.db
>>
>>58928888
pls
>>
File: brainfuck.png (27KB, 1064x846px) Image search: [Google]
brainfuck.png
27KB, 1064x846px
>>58929558
found a mandelbrot generator
holy shit it's slow
>>
>>58928112
working on seeing RMS in a bit
>>
>>58929444
>>58929747
>>58929846

InaneBob, more like InsaneBob :^).
>>
>>58929866
xdxdxdxd
>>
lel he cant crack the challenge database.
fucking kill yerself m8
>>
>>58929861

I said the same thing when I ran that program on my BF interpreter.
>>
>>58929991
I'm rewriting the whole thing with jump tables now. Let's hope it helps.
>>
>>58930052
just rewrite it in rust dude fearless concurrency lmao
>>
>>58929762
Dunno. I'd be surprised if they wrote a completely new one everytime though.
>>
>>58930062
we need C++ generals

people who know this kind of shit probably get bored here
>>
File: HolyMoly.png (7KB, 1024x768px) Image search: [Google]
HolyMoly.png
7KB, 1024x768px
>>58929598
>>
>>58930096
Make one then.
>>
File: radical centrist.jpg (101KB, 500x788px) Image search: [Google]
radical centrist.jpg
101KB, 500x788px
>>
>>58930130
>rust
>a language that will quickly die out once mozilla stops supporting it
HAHAHAHAH get real, chump
>>
>>58930130
>be rust
>insert punchline
>>
File: brainfuck2.png (49KB, 1064x846px) Image search: [Google]
brainfuck2.png
49KB, 1064x846px
>>58929991
>>58930052
jmp table implementation done. seems a bit faster already.
>>
>>58928112
Friendly reminder to keep your refuse out of agdg. Thanks /g/
>>
>>58930392
Literally nobody is going to your shitty board
>>>/v/

I honestly laughed at the prospect that someone from even somewhere as cancerous as /g/ would visit /v/
>>
File: 1475716246200.png (564KB, 603x753px) Image search: [Google]
1475716246200.png
564KB, 603x753px
I'm just learning programming by myself
Where can i go to get my programs corrected and criticized?
>>
>>58930414
It's a /vg/ and yes, your failed programmers go there to yack and argue about things with eachother that have nothing to do with gamedev.
>>
Programing baby here, since forever I've been told that goto is cancer and with good reason, but I'm seeing a handful of people on /g/ defending it/acting like it's not all that bad.
I work in C, so I just keep everything in its own function, but is there any other legit reason to use a goto?
>>58930439
Post it on /g/ lol
>>
>>58929989
Huh?
>>
>>58930448
>it's vg
nobody cares
>>
>>58930452
C's poor error handling is a good excuse to use forward gotos but aside from that not really.
>>
File: mameshiba.jpg (4KB, 184x184px) Image search: [Google]
mameshiba.jpg
4KB, 184x184px
>>58930452

http://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf
>>
>>58930574
>listening to dj "lol pajeet learn haskell instead :^)" ikstra
>>
>>58930439
Become intimate with your compiler. It will tell you secrets it will tell nobody else.
>>
>>58930489
>he thinks all generals are not the same
Keep your codemonkeys occupied so they stop trying to migrate. It's a simple request.

In fact it's a demand. Heed it.
>>
>>58930454
>>58929846
>>
>>58930392
>>58930448
>>58930633
d*
>>
>>58930595
Dijkstra was dead before Haskell became a meme.
>>
>>58930633
Too bad. Go back to >>>/b/
>>
File: dijkstra.png (44KB, 643x220px) Image search: [Google]
dijkstra.png
44KB, 643x220px
>>58930654
>>
>>58930679
Didn't know that. That's actually pretty amusing, thanks.
>>
>>58930653
>HERE I AM
Found him.
Stay here, faggot. Agdg is for gamedevs not failed programmers.
>>
>>58930706
You're so easy to spot.
>>
What are some popular programs written in Lisp?
>>
File: 1481425736558.gif (77KB, 500x416px) Image search: [Google]
1481425736558.gif
77KB, 500x416px
>>58928783
does anyone know the answer yet?
>>
>>58930711
I care so much about your obsession with me. It means a lot.

Stay here.
>>
>>58930718
Windows 10
>>
>>58930653
>>58930711
Maybe you should fuck off back to /vg/. That anon was obviously onto something.
>>
>>58930719
https://git-scm.com/docs/gitignore
>Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html".
>>
>>58930745
>Maybe you should fuck off back to /vg/
Literally the opposite of my request. Sending your dissident failed programmers to us is an act of aggression. This means war.
>>
>>58930745
In case you don't know, AGDG has a rabid shitposter who samefags constantly and shitposts about how X isn't gamedev - in this case programming.

He likes to raid other boards occasionally.
>>
>>58930734
Windows is written in Haskell.
>>
>>58930772
only 98
>>
>>58928783
>>58930719
Did you consider trying it out yourself?

Also I don't think so, try .DS_Store/
>>
>>58930772
Explains a lot
>>
>>58930757
>.DS_Store
so i only need to put
.DS_Store

in the .gitignore
>>
>>58930765
>in case you didn't know
>here's a bunch of drama i am wrapped up in on another board
I said fuck off. Maybe kill yourself as well.
>>
>>58930718
You'd be hard-pressed to find any current popular ones, I'd think.
>>
>>58930784
just rtfm. it really is not that hard to understand nigger
>>
>>58930786
this
>>
>>58930718
emacs
>>
>>58930797
git is pretty hard to understand compared to mercurial, bitkeeper or fossil

just sayin'
>>
>>58930760
>trying to refuse immigrant rights
SEE YOU IN COURT.
>>
>>58930812
https://git-scm.com/docs/gitignore
holy shit dude. rtfm.
>muh git is hard
>i dont know what a dag is
>i cant read english
>>
>>58930812
Branching? Maybe. Ignoring files? No.
>>
>>58930837
I don't think you understood me. Re-read my post.

>>58930850
Yeah, but I meant in general.
>>
>>58930867
i dont think you read the manual yet. kill yourself
>>
>>58930888
>knocking down people who are willing to learn
kys retarded faggot
>>
>>58930901
>willing to learn
>doesnt read the manual
jej
>>
>>58930901
I am not the guy who posed the original question. I'm this guy >>58930812. I already know git.

>>58930888
I have. I wouldn't have the authority to say what I said if I hadn't. You should kill yourself, you illiterate dumbass.
>>
>>58930911
sure thing bud
>>
Is there any open source chat application like Discord or Slack? I want to learn how it works.
>>
>>58930933
https://blog.okturtles.com/2015/11/five-open-source-slack-alternatives/
>>
>>58930922
Are you unironically claiming git is not the hardest SCM out there?

Let me compare it to mercurial then:

I wanna do a simple revert. On mercurial
$ hg revert


Easy enough. Now on git:
$ git reset --hard HEAD^


If you really believe the second one makes more sense, then I recommend you off yourself.

Either way, you're the only one showing ignorance here. Go away.
>>
>>58930922
>s-s-sure thing... b-baka
>>
>>58930959
This, git's a clusterfuck.
>>
File: immutable.png (26KB, 703x223px) Image search: [Google]
immutable.png
26KB, 703x223px
what is point of making strings immutable?
>>
>>58931002
Strings are immutable in Java too.
>>
>>58931002
Python is retarded and that's probably some literal modifying bs
>>
>>58931002
The strings themselves aren't immutable, it's the character that make up the string that are immutable
immutable(char)[] // which is what D does
vs.
immutable(char[])

I think Java also does this
>>
>>58931002
So they behave more like primitives.
>>
>>58931033
a list of immutable characters can only ever be extended
>>
>>58931058
Why is a primitive called a "primitive"?
>>
>>58928923
This can be done in O(n) in the simplest way.
>>
File: brainfuck3.png (42KB, 1064x846px) Image search: [Google]
brainfuck3.png
42KB, 1064x846px
Rate my brainfuck interpreter, /g/

>>> http://pastebin.com/AQdXgqmY

Specs:
max program size: 64k (excluding comments)
data area size: 64k
nested loop depth: ~32000
requires 8088 or better cpu with 192k free memory
highly efficient jump table implementation
fits in 300 bytes of machine code
>>
>>58931082
Because it's the most basic data holder.
>>
>>58931131
nice
>>
>>58931137
All of the primitives are the most basic?
>>
>>58931158
Are you trying to ruse me?
>>
I'm learning python. It's my first programming language ever and it feels comfy.
>>
>>58931161
I'm genuinely curious.
>>
>>58931188
https://en.wikipedia.org/wiki/Primitive_data_type
>>
>>58931180
Stop learning Python, it will rot your brain forever
>>
File: featured5.jpg (43KB, 842x480px) Image search: [Google]
featured5.jpg
43KB, 842x480px
do you have experience with charts.js or other tools to make online charts?

let's say I will use charts.js to make charts about data collected on a 4chan board, is it a good idea to save all the data in a single json file?
>>
>>58930968
Git is extremely simple.
With 3 commands, you cover 99% of your use cases.

Doing complex things in git like reverting requires complex commands, who would have thought?
At the very least, it's consistent and that knowledge carries over to any other complex command you might want to write.
>>
>>58931239
chart.js*
>>
>>58930959
The command
git revert

reverts and creates a new commit which keeps the revert in a history.
git reset --hard HEAD^

Moves head backward and doesn't keep in a history the fact of a revert.

Thank you based Linus.
>>
>>58931245
>revert
>complex

>>58931285
>rationalizing it
>>
>>58931002
wow

>slow as fuck language
>can't do basic shit
>>
I wish Windows APIs weren't so poorly documented.
>>
So I have a string. "Hi I am a raging Faggot", for example. I am trying to loop through it and create a new Stack for every first letter of the sentence. For example I should create a stack "H" and I would send "Hi" into it. Then a Stack "I" and send "I", then a stack "A" and send "A" and "Am", and so forth. Then I should make a linked list with the stacks and then I have to print the contents of the stacks.

I think I know how to do everything but I'm having a lot of problems how to deal with the creation of the stacks. Any ideas?
>>
>>58931338
>slow as fuck language
interpreted languages will always be more slow than compiled ones

>can't do basic shit
retard
>>
>>58931361
I don't understand what this is supposed to teach you.

Could you post your assignment please?
>>
>>58931131
>requires 8088 or better cpu with 192k free memory
fuck, time to upgrade
>>
>>58931383
Ah it was a Data Structures test I failed last semester (because I knew nothing about Data Structures).

Now I'm studying for the new test I have tomorrow and I tried to solve it again.

I think my roffessor just wanted to see if we knew how to program lists and stacks as a minimum.
>>
Any Haskell niggas out there? How do I implement scanSum? I've been struggling with it for a while, but I cannot figure it out. I guess I'm retarded. In return, have a dragon loli.
-- takeInt returns the first n items in a list.
takeInt 0 _ = []
takeInt n (x:xs) = x : takeInt (n - 1) xs

-- dropInt drops the first n items in a list and returns the rest.
dropInt 0 x = x
dropInt n (x:xs) = dropInt (n - 1) xs

-- sumInt returns the sum of the items in a list.
sumInt [] = 0
sumInt [x] = x
sumInt (x:xs) = x + sumInt xs

-- scanSum adds the items in a list and returns a list of the running totals.

-- diffs returns a list of the differences between adjacent items.
diffs [] = []
diffs [x] = [x]
diffs [x,y] = [y - x]
diffs (x:y:ys) = y - x : diffs (y : ys)
>>
File: 1393794734067.png (7KB, 227x200px) Image search: [Google]
1393794734067.png
7KB, 227x200px
>>58931232
May I know why?
>>
>>58931371
>>only slow because interpreted
>implying it's not piece of shit
>>
Okay, I'm trying to get a list of all of my friends on facebook (project I'm working on). I used requests to get the "friends" page from facebook and used Beautiful Soup to parse the HTML.

My question is: How the heck do I go from here? I have no idea what to do.
from bs4 import BeautifulSoup
import urllib2
response = urllib2.urlopen("** FRIENDS URL **")
soup = BeautifulSoup(response, 'html.parser')

print(soup.prettify())
>>
>>58931435
Hint: you want it (or a helper function that it calls) to take two parameters, not one.
>>
>>58931442
>never implement anything!
>just import everything, everything is already written!
>import 300 external dependencies for a hello world
>people think this is acceptable

and so you miss out on having to program
and that's why so many people like python


it's syntax was supposed to look like textbook psuedocode, you could just run the examples in your book and they would work without tweaking
it lets non-programmers feel smart
>>
Question about C#; can you create a new empty integer array, but with no elements in it. Empty int arrays are usually filled with 0's, how would you avoid that, so that they have a size, but are not filled with anything?
>>
File: Izana_depressfacial.png (780KB, 1280x720px) Image search: [Google]
Izana_depressfacial.png
780KB, 1280x720px
>>58928201
Please be baiting
>>
Why aren't you guys programming apps for IOS and Android to make money?
>>
>>58931435
scanl (+) 0

>>58931442
People who learn Python as a first language are so terrible, that they end up thinking it's a good language
Most others don't think this
>>
>>58931002
so what's the python way to modify the second char of a string?
>>
>>58931435
>his language doesn't support slices
>>
>>58931534
You need to know python for cybersecurity.
>>
>>58931400
previous version only required 64k
but it's 2 hours old already, no longer supported
>>
>>58931543
import char_utils.second_char_modifier
>>
>>58929092
No, programming is just a hobby.

I wack it on my CV to show that I have "well-rounded interests outside of medicine", but only because all of my other hobbies (e.g., getting drunk with my friends, playing guitar very badly) don't cut it (which is why that part of your CV is such bullshit).
>>
>>58931643
hobbies section on a CV is blatant padding, don't do that shit
>>
File: ahahahaha.jpg (71KB, 500x440px) Image search: [Google]
ahahahaha.jpg
71KB, 500x440px
>>58931588
>You need to know python for cybersecurity.
>>
>>58931588
God no
>>
>>58931590
>but it's 2 hours old already, no longer supported
kek
>>
>>58928286
my life everyday
>>
>>58931661
I wouldn't, because it's bullshit, but it's a (large) mandatory text field in speciality application forms, as well as a mandatory part of your portfolio.

Medicine is getting very cuddly of late.
>>
>>58931543
shit = "Hello World"
shit = shit.replace('e', 'x', 1)

# or

shit = ['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']
shit[1] = 'x'
>>
>>58931780
Your second example is actually a list of strings. Strings are immutable in Python.
>>
>>58931534
>>58931474
I see. The sole reason I got into Python is by recommendation from my peers. I work in a statistical demography department and Python appears to be a good solution to my coworkers when it comes to scripting. They're doing a lot of data manipulation so yeah, applied data science seems pretty fond of Python. What better language would you recommend learning to start off then?
>>
>>58931801
Yeah. To get it back as a single string you would have to do
''.join(shit)
>>
>>58931534
>python
>not a good language

end yourself kiddo
>>
>>58931839
Yup. I think if the index is the varying value here, I'd do:

mystring[0] + mychar + mystring[2:]
>>
>>58931500
pls respond
>>
>>58931500
Use the Nullable generic.
using System;

public class Test
{
public static void Main()
{
Nullable<int>[] pissdick = new Nullable<int>[5];
Console.WriteLine(pissdick.Length);
Console.WriteLine(pissdick[0]);
}
}
>>
>>58931917
Or, more generally:
mystring[myindex - 1] + mychar + mystring[myindex + 1:


The general version is ugly because Python strings are immutable/Python doesn't have a 'character' type.

That said, I don't use Python regularly. I had a look through the String class, and couldn't find anything terser.
>>
>>58931474
>import 300 external dependencies for a hello world
I have literally never seen this happen anywhere in any language but in Javascript. I have all sorts of issues with Python and there are plenty of reasons why Python sucks but this whole "DURR PYTON IS BAD CUZ DEE PEE TEE TOLD ME SO HERE'S SOME SHIT I MADE UP" is fucking stupid and needs to stop.
>>
>>58931995
It's true that /dpt/ used to collectively jizz itself over Python. It's only recently that "don't learn Python first, it will rot your brain" and "Python isn't a real langauge" has started.
>>
You guys do realize if you good programmers here stopped shit posting and actually worked on making an application you would make lots of money right?
>>
>>58932018
Python uses dynamic typing, do I find it hard to believe anyone could recommend it.
>>
>>58931932
>>58931500
var muhArray = new int?[10];
>>
File: 1486950269925.png (12KB, 225x321px) Image search: [Google]
1486950269925.png
12KB, 225x321px
>When it comes to code reuse, projects that used an object-oriented approach were able to take more than 70% of their code from previous projects. Subsequently, the projects that used functional design were able to take about 35 percent of their code from previous projects (McGarry, Waligora, and McDermott 1989).

OMG HOW ARE FUNCTIONALTARDS EVER GONNA RECOVER FROM THIS #REKKING?
>>
>>58932027
haha yeah ri...
>>
File: cronkite.jpg (44KB, 469x359px) Image search: [Google]
cronkite.jpg
44KB, 469x359px
Is programming an age safe field? I.e., are they going to fire you when you hit 50 for some 28 year old grad with a few years experience?
>>
>>58932095
You already posted this
>>
>>58932095
It's true /dpt/ cannot comprehend OOP so they meme it. Why do you think they all failed at programming in Java?
>>
>>58932027
If only I had a good idea for something useful to make
>>
>>58932102
No, if you didn't make it to management by 30, you will be ousted quietly.
But usually, they make you want to leave by never promoting you or never giving you autonomy.
Also, you don't get hired because your age implies high skills that they don't want to pay for.
>>
>>58931932
>>58932091
Thanks
>>
>>58931131
new version, everyone upgrade
http://pastebin.com/FMdmPYUe

> change log:
> fixed crash when reading files > 64k
> now using translation table to compile bytecode
> code size reduced to 296 bytes
>>
Lets make Java great again

How would we seriously have to redesign Java to make it the best programming language?
>>
>>58932225
Use D instead
>>
>>58932225
You make it C#.
>>
File: 1484492458206.png (558KB, 1440x900px) Image search: [Google]
1484492458206.png
558KB, 1440x900px
>>58932238
That's a funny way to spell Object Pascal, anon.
>>
>>58932213
>new paste slightly bigger than last one
getting a bit too bloated for my taste
>>
>>58932225
It already is the best, and it will get far better with Java 9
>>
>>58932225
Language that only allows classes it not sane language but it's too late to change that for java.
I don't mean that jvm is dead, no it's fucking great.
Languages that compile to jvm should be used because it's open source platform which allow many languges to easily call eachothers though the jvm.
Java might be used to maintain old libraries or to develop performance critical libraries if your jvm language is not that performant.
>>
>>58932225
Start with C#.

Identify things you prefer about Java and change C# to do those things.

Add more native functional features.

Wa-La
>>
>>58932316
>Wa-La
voilà
>>
File: 1474909869378.png (89KB, 519x396px) Image search: [Google]
1474909869378.png
89KB, 519x396px
Hey /g/, wanna hear a 5-word horror story?
>>
>>58932350
you just got memed son
>>
>>58932350
That was intended to be a bit of a joke, by misspelling a commonly used term in the way it phonetically sounds.
>>
>>58932314
What's wrong with a programming language that only allows classes?
>>
>>58932225
make everything immutable for pure OOP
>>
>>58932356
I guess you missed the memo.

You're a pajeet if you hate Java now.
>>
>>58932356
Roses are red
Volcanoes erupt lava
3 billion devices run Java
>>
>>58932407
This.

>>58932382
Classes are the cancer killing OOP.
>>
>>58932225

There's already an effort underway, anon:

https://github.com/yegor256/eo/
>>
>>58932430
explain I think classes make programming much easier to understand compared to just pure functional programming
>>
>>58932274
bloat-free version just for you: http://pastebin.com/xpFtDd67

also reduced code size to 290 bytes.
>>
>>58932449
http://www.yegor256.com/2016/09/20/oop-without-classes.html
>>
File: rms.jpg (39KB, 640x480px) Image search: [Google]
rms.jpg
39KB, 640x480px
>>58929862
it works!
>>
>>58932412
Roses are red
My balls look like guava
God help us
3 billion devices run Java
>>
>>58932356
"oracle" is only one word, dumbass
>>
>>58932520
did you call him a commie bastard and tell him you were going to make all your previously free open source software into closed source proprietary bloatware?
>>
>>58932520
Ich wünsche einen guten Tag, mein deutscher Freund.
>>
File: 0397645273ced504c32ec1c414e64218.png (805KB, 848x1200px) Image search: [Google]
0397645273ced504c32ec1c414e64218.png
805KB, 848x1200px
>>58931454
I got it, albeit ugly af.
scanSum (x:xs) [] = scanSum (drop 1 $ reverse (x:xs)) [x + sum xs]
scanSum (x:xs) ys = scanSum xs ((x + sum xs) : ys)
scanSum [x] ys = x : ys
scanSum [] ys = ys
>>
File: IMG_4373.jpg (19KB, 192x187px) Image search: [Google]
IMG_4373.jpg
19KB, 192x187px
>>58928177
>Garbage-collected Go deprecating C
>>
File: anal beads.png (2MB, 2000x2000px) Image search: [Google]
anal beads.png
2MB, 2000x2000px
>>58932539
Roses are red
It ain't Linux without GNU
Stallman ain't using Java
And neither should you
>>
>>58932553
>le "gommunism is bad mmmmkay?" meem yet again
>>
>>58932570
You should use Java if you want money
>>
>>58932561
scanl (+) 0


>>58932571
It's downright evil, but this is a bit off topic
Make a thread in another board if you want to discuss that
>>
>>58932571
Communism is bad, though.

You can just meme arrow away all of the atrocities directly related to failed attempts at implementing a fundamentally flawed ideology that is designed in such a way that humans must be fundamentally good to succeed.
>>
>>58932553
He was angry enough answering more... mundane questions, I didn't want to agitate him more

>>58932556
Guten Abend
>>
>>58932594
>can
can't
>>
websocket server in C with roleplaying functions and games
>>
>>58932595
Did he eat anything off of his feet?
>>
>>58932580
I make plenty of money using C#, though.

Comfy job, too.
>>
New thread:
>>58932628
>>58932628
>>58932628
>>
inb4 thread wars
>>
>>58932622
C# is Java
>>
>>58932621
No he just drank some tea and Pepsi
>>
>>58932633
They're quite different in practice, both in how you write them and moreso how you work with their ecosystem (frameworks, tools, integrations).
>>
>>58928762
Lippman C++ Primer
>>
>>58932641
The Pepsi logo was probably designed using non-free software. I lost so much respect for him.
Thread posts: 318
Thread images: 35


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