[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: 339
Thread images: 43

File: tomoko lite uses thinkpaddu.png (984KB, 1920x1080px) Image search: [Google]
tomoko lite uses thinkpaddu.png
984KB, 1920x1080px
old thread: >>60793579

What's your favorite programming beverage?
I just made a latte with instant coffee and frothed whole milk.
>>
What is it about C that that scares stupid webdev kids?

>>60799803
>>60799893
>>60799931
>>
why does go come with a http server? i seriously don't know why programming languages would come with libraries that make it easy to host http servers
>>
Anyone here use a standing desk?
If so, would you say you're more/equally/less productive/effective with it than a normal desk?
>>
>>60799997
How many shots?
>>
>>60800401
like 3, probably
>>
>>60800340
Go having an http server is probably it's only redeeming feature, it's managed to carve out a niche being an ideal language for server backend programming.
>>
>>60799997
Programming is a terrible profession. For one, you are not respected at any normal company. You're known as 'IT' or 'tech' and everyone gossips about how disgusting everyone is in the department. Every day, some Alpha who probably does nothing at his job except get his secretary to suck his dick in his corner office cucks you into doing random bitch work, and then yells at you when it's not done by the deadline despite it being impossible to complete the work requested. Not only that, the code rarely works, your co-workers are smelly Indians brought in by Tata Consultancy and connive to replace your job at all times for half the salary, and the work never, ever ends. You pollute your body with sugar and toxins, deprive it of sleep, and let it rot while you sit the majority of the day, neglecting any healthy exercise, social interaction or life goal attainment. It's like a Postal worker, but coupled with feelings of patheticness, loneliness, helplessness, rage and total hopelessness.

Women, when they hear you are a programmer, instantly remove you from the potential pool of mates as they know your earning potential is maxed early and your career over at 35. They are also instantly disgusted by you. It is far better to tell a woman you are on welfare than to out yourself as a computer programmer. It's also highly embarrassing for a woman to date or be married to a programmer, as virtually everyone knows they are the grown up version of the hopeless virgin in high school. One who never really grew up and became normal and fit into society, but rather found an environment where he could escape the reality of his situation and be invisible, able to hide the toxic shame and utter humiliation that is the programmer.

After Dentists, programmers have the highest rates of mental disorders, especially depression and suicide.

Programmers, why haven't you taken the cyanide pill?

t. can code fizzbuzz
>>
File: 888798798.gif (242KB, 447x329px) Image search: [Google]
888798798.gif
242KB, 447x329px
>>60799997
>"latte"
>instant
>>
File: dlang_chan.jpg (70KB, 349x368px) Image search: [Google]
dlang_chan.jpg
70KB, 349x368px
Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; and she's super duper cute! Say something nice about her, /dpt/!
>ywn never be recognized by andrei for the advocating of dlang-chan on an anonymous imageboard

>Tour
http://tour.dlang.org/
>Books
https://wiki.dlang.org/Books
>GC
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
https://wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes

>>60800446
Why is she so cute, anons?
>>
File: challenge.png (29KB, 732x365px) Image search: [Google]
challenge.png
29KB, 732x365px
I'm learning C# and was wondering if y'all could review one of my exercise solutions. It's from the book C# Player's Guide. The challenge is attached.

Here's my solution:

using System;


namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for(int row = 0; row < 5; row++)
{
for(int spaceColumn = 5; spaceColumn > row; spaceColumn--)
{
Console.Write(' ');
}

for(int starColumn = 0; starColumn < row + 1 + row; starColumn++)
{
Console.Write('*');
}

Console.WriteLine();
}

Console.ReadLine();
}
}
}



Thanks for any help.
>>
>>60800482
Previous Dlang-chan was cuter.
>>
>>60800501
Why did you like her so much, anon? Was it her cuteness derived from her genki tomboy plainness? Was it her happy expression as she waves in people to try out her wonderful features?
>>
>>60800523
First she wasn't stupid enough to wear high socks with sportswear.
She gave an impression of candid cheerfulness you do not notice in the current Dlang-chan. I really wanted to cuddle with her.
>>
>>60800558
While your first point is kinda stupid, I agree with the rest. I'll consult with the other gentleman that are part of the deciding D's waifu mascot.
>>
https://puzzling.stackexchange.com/questions/52415/martin-gardners-the-twiddled-bolts
>when i'm next using a screwdriver, i'll remember the 'righty tighty lefty loosy' rule - it should save me some time!

are these people fucking retarded? i'm probably a genius but even a normal person would know how to turn a screw surely
>>
>>60800578
>I'll consult with the other gentleman that are part of the deciding D's waifu mascot.
Good. This is one of my sticking points with the language. I can't endorse this as it is now.
>>
>>60800578
>your first point is kinda stupid
If you actually used programming socks you'd know how unsuitable these things are for swift movements
>>
File: nba-celtics-player-dress-costume.jpg (448KB, 1750x2500px) Image search: [Google]
nba-celtics-player-dress-costume.jpg
448KB, 1750x2500px
>>60800646
this

i would expect knee high socks at most
>>
File: garter belt.jpg (105KB, 1200x1500px) Image search: [Google]
garter belt.jpg
105KB, 1200x1500px
>>60800646
You just need a garter belt. She's probably using the kind that only connects with the center of the socks. It's really hard to notice.
You sure don't sound like you're using programming socks. What kind of engineer doesn't find solutions to be able to program on the go?

Its not even hard
>>
File: 1492746803390.png (53KB, 298x415px) Image search: [Google]
1492746803390.png
53KB, 298x415px
>>60800646
2D != 3D

>>60800672
pic related
>>
>>60800432
I've seen this pasta on /pol/ recently.
>>
>>60800432
>Programming is a terrible profession. For one, you are not respected at any normal company.
>You're known as 'IT' or 'tech'
Stopped reading. What a terrible pasta.
>>
File: 1493687575364.jpg (11KB, 236x170px) Image search: [Google]
1493687575364.jpg
11KB, 236x170px
>>60799997
>latte
>frothed milk
>instant
are you trying to trigger my autism anon?

Anyways, I usually program at night so usually a beer.
>>
>>60800723
i prefer this one

programming is an incredibly degrading job that offers 0 job security and is the vocation most plagued by ageism by a far margin. You are not respected at any normal company. Every day, some Alpha who probably does nothing at his job except get his secretary to suck his dick in his corner office cucks you into doing random bitch work, and then yells at you when it's not done by the deadline despite it being impossible to complete the work requested. Not only that, the code rarely works, your co-workers are Indians brought in by Tata Consultancy who will replace you for half the salary and you have to train them to get your $500 severance, and the work never, ever ends. You pollute your body with the caffeinenated jew, deprive it of sleep, and let it rot while you sit the majority of the day, neglecting any healthy exercise, social interaction or life game goal attainment.

It's like a postal worker, but coupled with feelings of loneliness, helplessness and total hopelessness. Programmers are too depressed to go postal, a sad state of affairs. After dentists, programmers have the highest rates of mental disorders, especially depression, transgenderism and suicide.

It gets worse. Women, when they hear you are a programmer, instantly reject you. It is far better to tell a woman you are on welfare than to out yourself as a programmer. It's highly embarrassing for a woman to associate with a programmer, as everyone knows they are the grown up version of the hopeless virgin in high school. One who never really grew up and became normal and fit into society, but rather found an environment where he could escape the reality of his situation and be invisible, able to hide the toxic shame and utter humiliation that is the programmer.

Programming's father, Alan Turing, 404'd himself with cyanide because he was a programmer. Brogrammers, why haven't you taken the cyanide pill and quit jewgramming and turned to a respectable profession?
>>
>>60800754
Turing killed himself because he was pumped full of girl hormones after he was caught sucking dicks.
>>
>>60800812
>he was pumped full of girl hormones
No. Bet those chavs didn't even know what a hormone was frankly.
>>
File: 1492642918139.png (130KB, 500x450px) Image search: [Google]
1492642918139.png
130KB, 500x450px
>>60800098
>tfw programming as a hobby; engineer by career
>self taught, etc
>mainly use C and C# but also fluent in few other langs

Half the CS memers i've met were autistic and couldnt handle their major. All they really have to learn is java, python, and at most how to write a fizzbuzz in C.
>>
Producing Windows-only software is immoral.
>>
File: 1341619539905.jpg (107KB, 613x533px) Image search: [Google]
1341619539905.jpg
107KB, 613x533px
>mfw c++ needs examples of how to use the standard library functions, because the function definitions are horrendous
>>
>>60801080
Which of the three standard library is it?
>>
File: 1485743516291.png (226KB, 450x420px) Image search: [Google]
1485743516291.png
226KB, 450x420px
redpill me on generic programming
>>
File: ran_first_sip.jpg (135KB, 850x944px) Image search: [Google]
ran_first_sip.jpg
135KB, 850x944px
>>60799997
>What's your favorite programming beverage?
>>
If I wanted to write my own game engine from scratch in c++ on linux, then wanted a friend to help me who uses windows would that be a mah majoror hurdle?
>>
>>60801170
Major*
>>
>>60801170
No, use SDL/SFML/etc with a proper build system and be platform-agnostic
>>
>>60800498
Instead of doing a for loop for spaces, you can just do

Console.Write("".PadLeft(5 - row, ' '));
>>
>>60801167
You can abuse templates and/or C preprocessor macros to insert huge amounts of type agnostic code into your translation units and bloat up the size of your binaries by a considerable amount in any non-trivial software project.
>>
>>60800498
>>60801214

Ex:

using System;

class Program
{
static void Main()
{
for (int i = 0; i < 5; i++) {
Console.Write("".PadLeft(5 - i, ' '));
for (int j = 0; j < (i * 2) + 1; j++) Console.Write("*");
Console.WriteLine();
}
}
}
>>
File: jest.jpg (331KB, 753x707px) Image search: [Google]
jest.jpg
331KB, 753x707px
>tfw run out of ideas and no drive to improve existing projects because they work good enough.
>>
sims-like game i'm making.
>>
File: imafailure.png (24KB, 640x480px) Image search: [Google]
imafailure.png
24KB, 640x480px
>Teaching myself about neural networks
>Try to make a simple neural network to approximate the sine function
>Fails horribly
>Find out I wasn't normalizing my data with respect to my activation function, do that
>Still fails horribly
>Read more theory, find out how to prevent overfitting
>Specifically do the opposite
>Sometimes demonstrates somewhat nonlinear or even seemingly periodic behavior
>Still wildly inaccurate
>Try it again using an implementation from the book I'm reading
>Same shit
>That very same implementation scores about 95% on a validation set of handwritten digits from MNIST

What the FUCK am I doing wrong
>>
File: 1.png (111KB, 1202x728px) Image search: [Google]
1.png
111KB, 1202x728px
>>60801410

i am a dipshit
>>
few things in life are more infuriating than an unresponsive user interface
>>
>>60801531
>ne0ndrag0nGolden.Apples.Trans.Horses
Dare I ask?
>>
Can some loop wizards help me out here?

        For i = 1 To 2
For j = 1 To 10
For k = 1 To 10
If k = j Then
'Incorrect
Else
'Correct
End If
Next
Next
Next


I have 10 objects. Each object can be in 3 states, 1, 2, or 3. Let's look at one of the combinations like 1111111111. For that one combination, I am trying to loop through all the ways one can get 8 out of 10 guesses correct for it. The loop above does this for 9 out of 10, but I can't figure out how to make it work for 8 out of 10.
>>
>>60801548

evidently i don't know how to use secure tripcodes
>>
>>60801415
what kind of neural network is it? if it's not an LSTM, there's your problem. it has no memory.

https://en.wikipedia.org/wiki/Long_short-term_memory
>>
>>60800098

because the C family is intolerant of failure. compare to higher level languages where you can cock up a monster entirely consisting of copy/pasted stack overflow answers given by java evangelicals
>>
>>60801151
C++ eternally btfo
>>
>>60801572
>>60801600
I hope you changed your tripcode
>>
>>60801600
C is surprisingly lenient on what it will accept as valid code, much more than most languages.
>>
>>60800614
Even below-average people who have used a screwdriver more than once know how to turn a screw. What the fuck. Also who's that stupid rule meant for? It sounds like a kindergarten rhyme.
>>
>>60801606

try the old one and see
>>
Testing~
>>
>>60801607

undefined behaviour is a bitch

>>60801619

see
>>
>>60801630
So, you're a new trip user, where do you fit into the /dpt/ family? We've got already got mummy (OSGTP), daddy (Ruby) (female), and doggo (nv).
>>
File: simnus.png (203KB, 816x639px) Image search: [Google]
simnus.png
203KB, 816x639px
>>60801433
I like it.
>>
File: 2.png (62KB, 1202x728px) Image search: [Google]
2.png
62KB, 1202x728px
pic: proof i'm the dev behind the sims-like game

>>60801650
the fuck's a /dpt/

>>60801653
thankies
>>
>>60800498
>>60801214
>>60801254

Another solution in one line (you can use new String(char, numberOfTimes) to make a string of a repeating character)

using System;

class Program
{
static void Main()
{
for (int i = 0; i < 5; i++) Console.WriteLine("".PadLeft(5 - i, ' ') + (new String('*', i + i + 1)));
}
}
>>
>>60801650
>>60801678

reads thread title

i'm too fucking tired
>>
>>60801678
/dpt/ is this thread
>>
counting the number of times an element appears in a list
countElements :: Ord a => [a] -> [(a, Int)]
countElements s
= sortBy (flip (comparing snd))
$ Map.toList
$ foldr count Map.empty s

count :: (Ord a) => a -> Map.Map a Int -> Map.Map a Int
count c curCount = Map.alter update c curCount
where update Nothing = Just 1
update (Just a) = Just (a + 1)

example
> countElements "help i need somebody help not just anybody"
[(' ',7),('e',5),('o',4),('d',3),('n',3),('y',3),('b',2),('h',2),('l',2),('p',2),('s',2),('t',2),('a',1),('i',1),('j',1),('m',1),('u',1)]
p> countElements (words "help i need somebody help not just anybody")
[("help",2),("anybody",1),("i",1),("just",1),("need",1),("not",1),("somebody",1)]

probably not optimal but I'm still learning.
>>
>>60801650

i'm a c++ dev by night and js dev by day. webdev is easy but boring. also some of the shit i wrote for the game is pretty appalling and needs to be refactored
>>
>>60801574
>if it's not an LSTM, there's your problem.

Does that apply to the XOR function as well? because I'm having trouble with that as well. I'll look into this, my network is an MLP
>>
>>60801729
I don't care what languages you use, I care about which member of the family you are
>>
>>60801743

fat unloved stepsister
>>
File: hurts.png (2MB, 1280x720px) Image search: [Google]
hurts.png
2MB, 1280x720px
>>60801729
>c++ dev by night and js dev by day
>>
>>60800432
At some of the good big tech companies the programmers are treated better than others, sort of like first class citizens.

At any rate, in this job market, as a competent developer you can't be treated worse unless you're shit at finding jobs or a shit programmer.

It's usually not that hard to find an easygoing CS job.
>>
/g/, someone just posted this shit on /a/. I have no experience with programing and none of this shit makes sense. What am I looking at here?

>>>/a/158243680

https://gist.github.com/anonymous/b9b1a4699bfc1039bd067fca78d7a6a5
>>
オナニー
>>
File: 15822597.jpg (5KB, 370x334px) Image search: [Google]
15822597.jpg
5KB, 370x334px
Rate this
import std.conv;
import std.stdio;
import std.range;

void main(string[] args)
{
immutable max = (1 < args.length)
? args[1].to!size_t
: 0x4000;
size_t count = 1; // we have 2.
// flags[i] = isPrime(2 * i + 3)
auto flags = new bool[(max - 1) / 2];
flags[] = true;

foreach (i; 0..flags.length)
{
if (!flags[i])
continue;
auto prime = i + i + 3;
foreach (k; iota(i + prime, flags.length, prime))
flags[k] = false;

count++;
}
writefln("%d primes", count);
}
>>
File: fhtagn.png (67KB, 387x420px) Image search: [Google]
fhtagn.png
67KB, 387x420px
>>60800826
>tfw autistic as a birth condition; CS memer by major
>self taught, etc
>mainly use C and Ruby but also fluent in few other langs

Half the me I've met is autistic and can't handle my major. All I really have to learn is everything.

Guys how do I do the thing. I refuse to settle for being a lousy piece of shit just because I was born autistic. I am COMPELLED to do something with my life and this is what I've chosen. But I might be too autistic to do it. What do I do.
>>
>>60801694
this is a bit better
countElements :: Ord a => [a] -> [(a, Int)]
countElements s
= sortBy (flip (comparing snd))
$ Map.toList
$ foldr (Map.alter (Just . maybe 1 (1 +))) Map.empty s
>>
>>60802032
>import std.stdio;
Absolute garbage. I'm not even going to bother reading the rest of that.
>>
>>60802047
You did bother enough to reply
>>
>>60802032
>>60802047
>std.stdio
Literally why.
Why not just std.io.
Fuck, D-chan's designers have problems.
>>
>>60802067
You can have your own uLib instead of std
So you can go uLib.module etc
>>
>>60802076
Wow.
That seems only rather distantly connected to what I just said.
>>
>>60799997
what os do you use kirie-poster
>>
>>60802084
You can also have your own std.eio
>>
Can anyone here into AVRs? I'm trying to get sven's nrf24l01+ blogpost working
(http://gizmosnack.blogspot.com/2013/04/tutorial-nrf24l01-and-avr.html)

With auto acks, the transmitter always sends till MAX_RT is set. The receiver interrupt never fires. I put caps across vcc and ground since that looked like a common problem. Also they're right next to each other.
>>
>>60802076
To clarify, what I'm asking is, if stdio is already in std, why did they have to call it stdio. The std is implied by the fact that it's in std. They could've just called it io. And then, as you say, if someone wanted a different io, they could just do uLib.io instead of std.io. On the other hand, uLib.stdio wouldn't make any sense, because then stdio wouldn't be in std, making the term "stdio" a misnomer.
>>
>>60802032
prime could be made immutable.
you should also use std.concurrency
>>
>>60801932
its just a filter to block a potential malware domain
>>
>>60802109
What if there is a new uIO in the std in future?
>>
>>60802147
Then that problem is the responsibility of whoever put it there. You shouldn't be putting things in std unless you're a developer of the language itself, and if you are, you should know it well enough not to create naming conflicts like that.
>>
Does anyone here like Lisps?
>>
>>60802147
Theres a DIP in review right now for a @future in relation to its counter @deprecation
>>
>>60802109
d has some wonky shit.
Another example is this gem for win32 stuff
import core.sys.windows.windows;
>>
>>60802245
>import core.sys.windows.windows;
Ree.
>>
Is it even possible to write a program people will use without relying on pure luck? I swear I've come up with original ideas, only to find they're already actively developed. It's like mathematics: even if you come to a realization all by yourself, someone has already written the proof for it 5 hundred years ago.
>>
>>60802255
For the most part though, its std is pretty straight forward . But re-doing some module names is pretty low priority.
>>
>>60801550
>>60801550
>>60801550
Anyone?
>>
>His language still doesn't have CTFE
>His language still doesn't have modules
>>
>>60802295
>tfw using the proper c++
Im glad i finally escaped the sepples hell
>>
>>60802262
of course it is, you don't even need to do it better, just offer a decent alternative to w/e
>>
>>60802262
Yes, it's possible by studying your ass off. What you're talking about -- coming up with something that really is original, and really is the first ever mature, developed idea proposed to solve some previously unsolved problem, no matter how small -- is hard these days, as you allude. In fact, it's so hard that it's the whole idea behind the title of PhD.
>>
>>60801574
you dont need a lstm to approximate a sine function you fuck
>>
>>60801733
>I'll look into this, my network is an MLP
Fucking bronies. I thought they'd all gone extinct. Go clop somewhere else ponyfag
>>
>>60802179
lisps are inferior to haskells
>>
>>60802347
haskells are inferior to cs
>>
File: learnc.png (2MB, 1058x1600px) Image search: [Google]
learnc.png
2MB, 1058x1600px
>>60801694
>>60802044
Two other ways:

countElements :: Ord a => [a] -> [(a, Int)]
countElements s = sortBy (flip (comparing snd))
$ Map.toList $ foldr inc Map.empty s
where inc c = Map.insertWith (+) c 1

countElements' :: Ord a => [a] -> [(a, Int)]
countElements' s = sortBy (flip (comparing snd))
$ [(head l, length l) | l <- group s]


>>60801733
How many layers does your network have?

Because both the sine function and XOR can't be represented as a linear combination of the inputs. On the contrary, a linear classifier can actually do very well on MNIST. Specifically, you can get to like 93% apparently, which is kind of around what you said.
>>
>>60802366
>
[(head l, length l) | l <- group s]

what the fuuuuuuuuuck
>>
>>60802388
Wear your skirt every day and you'll write code just like that
>>
>>60802388
It makes perfect sense. You just don't understand it because you're dressed like a boy.

Go ahead and change and come back.

I promise I haven't hacked malware onto your machine that gives me remote access to your webcam.
>>
>>60802366
Well it has 3 layers, mine and the book implementation, so it should be able to do it by that universal approximation theorem
>>
>>60802405
>>60802410
when did the g in /g/ stop standing for gentoo and start standing for gay
>>
>>60802437
How new are you? Sissy faggots have always been a very loud and obnoxious minority.
>>
>>60802366
>>60801694
count x = length . filter (== x)
counts xs = nubBy ((==) `on` fst) (map (\x -> (x, count x xs)) xs)
>>
>>60802459
I actually am one of them. I was falseflagging as a hater.

I saw an opportunity to take a crack at someone and I took it. To hell with taking sides.
>>
>>60802366
Kek'd at pic.
>>
File: baka.jpg (55KB, 555x720px) Image search: [Google]
baka.jpg
55KB, 555x720px
>>60802417
Yeah, I agree. All I can tell you is, it's failed on problems which require the slope of the output neuron to change and are thus not linearly classifiable (sine, XOR). It's also succeeded on MNIST, but only to the extent a linear classifier can (maybe a tiny bit better). And in addition, in the image you attached the output is monotonically increasing the entire time (even though the slope almost becomes 0).

So, I can't really tell you what the bug is, but I would use that as a basis for looking for problems.

>>60802437
Liking feminine penises isn't gay.
>>60802478
Exactly, shitposting is great
>>
File: shiggy.jpg (5KB, 200x200px) Image search: [Google]
shiggy.jpg
5KB, 200x200px
>>60802483
>>
>>60800498
I was just playing with python padding today


string = "*"
pad = 10
for x in range(5):
print("{:>{pad}}".format(string,pad=pad))
string += "**"
pad += 1


any python tips on this challenge?
>>
>>60802388
>>60802366
>
[(head l, length l) | l <- group s]

it doesnt work
sissies confirmed for inferior
>>
>>60802388
map (\l -> (head l, length l)) (group s)
>>
>>60802534
I ran the code and the output's the same lol. Beat it normie
>>
File: 1480974118479.png (518KB, 974x974px) Image search: [Google]
1480974118479.png
518KB, 974x974px
>>60802545
>>60802534
>>60802388
>>60802366

import Data.List (group, sort)
import Control.Arrow ((&&&))

count = map (head &&& length) . group . sort
>>
>>60802562
Can you explain this to me?
>>
File: rare.png (25KB, 640x480px) Image search: [Google]
rare.png
25KB, 640x480px
>>60802495
>And in addition, in the image you attached the output is monotonically increasing the entire time

What exactly is the implication of the output being monotonic? Here's another example run
>>
>>60802557
> let countElements' s = sortBy (flip (comparing snd)) $ [(head l, length l) | l <- group s]
> countElements' $ words "the no the no the"
[("the",1),("no",1),("the",1),("no",1),("the",1)]
>>
>>60802605
You forgot to sort before applying group
>>
>>60802581
group will put all of the same elements together - but only if they're consecutive >>60802557


so i just sort before doing that
(head &&& length) is
\x -> (head x, length x)
>>
>>60802614
I ran the code as specified here
>>60802366
>>
Is github the worse thing to happen to western society? All chinks do is look for lab projects on github because they're too lazy to think about it for themselves.
>>
>>60802623
countElements could be made more efficient by using a strict left fold instead of a right fold.
>>
>>60802534
Of course sissies are inferior, you can tell that much just from looking at them. They're soft, smooth, curvy, fragile, and naive. That's kind of a big part of what makes them cute and fun.
>>
I'm trying to learn to code for fun, and I cannot read any more fucking documentation, or do any more cutesy little controlled examples. I need an actual project, but I can't think of something I'd want to do that's in my skill range, or just far enough outside of it that I wouldn't just be going right back to reading documentation to even hope at starting. Any suggestions?

Also, half-related, I've been learning Java because it's the meme, but I'm willing to shift if there's a better language for beginners. I'm not trying to rush headlong into things so I'm alright with it being not immensely useful outside of being a tool for learning.
>>
>>60802562
Also, that code doesn't build on my machine, but I don't have the latest GHC either.

>>60802605
Aw, you got me. Yeah, I should have sorted first. I guess I need to wear my skirt a little shorter.

>>60802603
I was just suspicious, since monotonicity is a feature shared in common with linear classifiers. Since that data's a counterexample, it's not the case, although if it's rare as you say, it could be statistically the behavior which defines your accuracy.
>>
>>60802667
Your own basic utility program, like a music/video player etc.
Or, even though /g/ will ree about it, make a game, or a library to make games and other media things with.
>>
>>60802667
>but I'm willing to shift if there's a better language for beginners
D!
http://tour.dlang.org/
>>
>>60802701
D is absolute garbage, though.
>>
>>60802676
>Also, that code doesn't build on my machine
why not?
>>
File: 1492485272667.jpg (939KB, 2048x1365px) Image search: [Google]
1492485272667.jpg
939KB, 2048x1365px
What are some ideas for projects to put on my gitbub? Can't come up with anything
>>
>>60802709
Prove your assertion, memelord.
>>
>>60802731
import std.stdio;
>>
dont try to reason with shitters, less faggots using my language the better
>>
>>60802701
The problem I see with learning a language like D isn't about it's design, it's that it's not popular enough for it to have that wide repertoire of beginner questions on stackoverflow. Not that everyone's learning style needs that, but for me it was indispensable.

>>60802714
Ambiguous type variable ‘a0’ arising from a use of ‘group’
prevents the constraint ‘(Eq a0)’ from being solved.
Relevant bindings include
count :: [a0] -> [(a0, Int)]
>>
>>60802749
I think at some point NoMonomorphismRestriction became enabled by default

It's complaining I haven't explicitly stated
count :: Eq a => [a] -> [(a, Int)]

but if you look at the message you can tell it can infer that, it just isn't bothering
>>
>>60799997
>What's your favorite programming beverage?
Binary. Because I'm not a coward
>>
>>60802749
Beginner questions are mostly language agnostic, and D's community is quite helpful. Plus, you shouldn't be relying on stackoverflow as much you're implicating you are.
>>
>>60802709
>tfw your language collects itself
>>
>>60802733
Not that its even a real issue, but you can do this
void main()
{
import io = std.stdio;
io.writeln("butts");
}

>>60802749
It has nice documentation and a book.
>>
>>60802766
Not a programming language
>>
>>60802781
>It has nice documentation
It's fucking garbage. I've literally had 404 links on their official documentation.
>>
>>60802785
It is if you're not a PUSSY
>>
File: interrupt_routine.jpg (285KB, 544x645px) Image search: [Google]
interrupt_routine.jpg
285KB, 544x645px
>>60802347
Ok, listen little faggot. Have you ever written a compiler? Have you ever written an interrupt routine, you little faggot? You ever written an interrupt routine? You little faggot. No, you haven't because you're a faggot. Okay. Why don't you go write an interrupt routine faggot. Haskell? You're fucking in the ocean with some nigger in the deep ocean. Got no clue what's underneath you, you little faggot. Why don't you go write an interrupt routine?

This is an interrupt routine. I wrote my own compiler. It has an interrupt keyword. Does Haskell have an interrupt routine? Can you write an interrupt routine in haskell with an interrupt keyword? Huh? Can you write an interrupt routine in haskell? Do you know what an interrupt is, you little faggot? Everything you know about haskell is something I know about interrupt routines. How about them? How about them apples? Huh? Everything you know about haskell or lisp, I know about interrupt routines. Fuck yourself nigger
>>
>>60802766
>Calling machine code "binary"
Binary is just a number base, you fucking retard.
>>
>>60800098
You should be telling them to learn Rust, and they know it.
>>
>>60802781
>It has nice documentation and a book.
Very true. In fact this book, which is free, http://ddili.org/ders/d.en/index.html regularly gets updated too. It's an introduction to both programming in general and D.
>>
>>60802809
he's right, you know
>>
>>60802801
link?
nothings perfect though.
And between already knowing a C-like, their tour their docs, and the book, theres not much else you really need desu
>>
>>60802804
Check out this hello world I wrote in binary:

01110000 01110010 01101001 01101110 01110100 00101000
00100010 01001000 01100101 01101100 01101100 01101111
00100000 01010111 01101111 01110010 01101100 01100100
00100010 00101001 00001010
>>
>>60800482
This is spam
>>
>>60802830
He's just shitposting, anon.
>>
>>60802809
go drink some more shasta
>>
>>60802842
good thing were programmers who could do a simple regex filter
>>
>>60802775
The problem is for a beginner, questions are NOT language agnostic. It's not the way a beginner programmer who's never seen a different language thinks at all. An answer in C++ is useless to them. They don't have the skill to analogize between syntax and semantics of languages since they don't even fully understand one of them yet, let alone two.

Also, I don't use StackOverflow that much anymore - I'm saying back when I was in that learning phase, I relied on it heavily to understand error messages.

>>60802765
I see. I had a feeling that was what it was, but it's been a while since I last used Haskell so for some reason I didn't try it. Is there a quicker way to make it sort in reverse order like the previous samples did? I'm still trying to wrap my head around this.
>>
Consider a 5-bit floating-point representation based on the IEEE floating-point format, with one sign bit, two exponent bits (k = 2), and two fraction bits (n=2). The exponent bias is 2^(2-1) - 1 = 1.
Fill in the table (pic related is already filled in).

e: The value represented by considering the exponent field to be an unsigned integer.
E: The value of exponent after biasing
2^E: Numeric weight of exponent.
f: The value of the fraction.
M: The value of the significand
2^E * M: The (unreduced fractional value of the number
V: The reduced fractional value of the number
Decimal: The decimal representation of the number.


I don't get it at all. If someone has got time to kill, would they mind explaining how to just at least do the second entry, 0_00_01?
>>
>>60802856
Hes not wrong though, ive ran into 404s myself but i report them.
>>
>>60802861
>I see. I had a feeling that was what it was, but it's been a while since I last used Haskell so for some reason I didn't try it. Is there a quicker way to make it sort in reverse order like the previous samples did? I'm still trying to wrap my head around this.
You could use sortBy like the other anon did
>>
File: scruffy.jpg (11KB, 200x200px) Image search: [Google]
scruffy.jpg
11KB, 200x200px
Iced tea. Lightly sweetened. Lemon wedge on the glass, old southern diner style.
>>
>>60802870
Yes, he's not wrong, but he's being hyperbolic about it.
>>
>>60802897
Of course, /dpt/ likes to shitpost d just like haskell and every other language.
In fact, if your language of choice isnt getting shit on, its probably an issue.
>>
>>60802882
(reverse . sort)
>>
>>60802911
i think he means sort by the number
>>
>>60802909
>In fact, if your language of choice isnt getting shit on, its probably an issue.
My god, you're right.
>>
>What's your favorite programming beverage?
python.

why? because every programmer i work with wants complicated language with super important feature xyz, but when they try to actually use it, they shit all over themselves and make horrible silos of complexity. just. fucking. python. and don't make it trash. is how you make decent software.
>>
>>60802932
>dynamic typing
language rejected
>>
>>60802932
fag
>>
>>60802882
Oh, duh. I'm an idiot.

>>60802866
The second entry is one of the tricky ones since it's a denormalized float.

It's kind of hard to see the pattern when you have only 2 exponent bits (easier with 3). When the exponent bits are 0, instead of the exponent being E=(e+B) where B is the bias which in this case is B=-1, E is B+1. (in other words, the exponent is the same for e=0 and e=1) The reason this is is because in that last segment where e=0, denormalized floats happens. This is to ensure a smooth set of steps from the smallest normalized number (where e=1) to the actual floating point value 0.

The other consequence of denormalized floats is that since you're trying to actually get close to 0 without changing the exponent, the "invisible first digit" is now 0 instead of 1, which is why you that the mantissa is less than 0 if and only if e=0.
>>
File: 2stronk.png (33KB, 552x328px) Image search: [Google]
2stronk.png
33KB, 552x328px
>>60802971
which is why you see that*
>>
>>60802809
>get pissed that Turing machines are inherently imperative
>build a Turing-complete alternatively structured computer that isn't a Turing machine but is functionally equivalent to one
>new storage model is designed for efficient recursive and associative access instead of efficient iterative-serial access
>physical realization of a linked list, not even array-based anymore
>processor works functionally instead of imperatively
>no more "instructions" or "opcodes," no more "binary," only dependent types and ad-hoc-polymorphic lambdas all the way down to hardware level
>no garbage collection necessary due to the way the storage devices have been reinvented
>because the resulting computer hardware is of a kind that's never been seen before, you have to write your own drivers and compilers
>because this is basically a "haskell machine," the first compiler you write is for haskell
>implement rest of languages in haskell, and also the os
>haskell is now the lowest level and highest performance compiled language possible on your machine
>languages like c now represent a much more significant abstraction over your fucked up functional "assembly" than haskell does
>it becomes implausible to write a compiler, interrupt routine, or os in c or any other imperative language, and much more efficient to write such things in haskell or lisp
>people like the man i'm quoting look upon your invention and cry
>>
>>60802987
import Inline.C
>>
>>60802987
>no garbage collection necessary due to the way the storage devices have been reinvented
What are you on about?
>>
how did you guys learn haskell, just want some differerent ideas other than the haskell site
>>
>>60803051
Tried to configure xmonad
>>
>>60803037
Data would no longer stored serially. It would be stored associatively at hardware level. Symbols and references would stop being abstractions over numerical addresses, because addresses would not be numerical. The way memory was allocated would change completely, due to the fundamental change in the nature of the hardware involved, and these changes would make explicit deallocation unnecessary.
>>
>>60803058
>tried

what happened?
I was thinking of doing the exact same thing
>>
>>60802984
data Gender = Boy Gender | Girl Gender | Trans Gender | End

ruby = a girl (boy)
where boy = Boy End
girl = Girl
a = id
>>
>>60803068
Wouldn't that be inefficient though? I mean binary addresses are as compact as you can get. So your "symbolic" store would provide a smaller address space for the same address size.
>>
>>60803082
You seem to be thinking about it in terms of the symbolic storage system being an abstraction layer over a normal hard drive or ram device. That is not what we are talking about here. I'm talking about something like a 256-ary particle network in a box.
>>
>>60803073
I ended up learning Haskell.
>>
>>60803124
you learnt haskell but you never configured xmonad?
>>
File: cadr_top_small.jpg (13KB, 253x184px) Image search: [Google]
cadr_top_small.jpg
13KB, 253x184px
can we please appreciate lisp machines for a sec while we're talking about haskell hardware
>>
File: kanna nani.png (118KB, 404x404px) Image search: [Google]
kanna nani.png
118KB, 404x404px
Is it safe to overwrite null bytes on on a string that's currently being tokenized with strtok()?
I don't want to create a second string and I'd like to untokenize the string as I work through it.
>>
>>60801694
In Lisp, this is just
(defun count-elements (xs)
(remove-duplicates
(mapcar (lambda (x) (cons x (count x xs))) xs) :key #'car))
>>
>>60803151
I think so. strtok keep an internal pointer of where it's up to, so I don't think it's reliant on that byte being null.
>>
>>60803150
Massively parallel HPC running LISP operating system with hardware level GC when?
>>
>>60803158
>O(*n^2)
>>
>>60803221
I really doubt there's a short solution that is efficient.
>>
>>60803075
data GI = Boy | Girl | Trans
data GenderF a = GenderF (Maybe (GI a))
data Fix f = Fix { unfix :: f (Fix f) }
type Gender = Fix GenderF
>>
>>60803255
*Maybe (GI, a)
>>
>>60803248
>iterate though list
>keep map in memory
>increment map for each character
>>
>>60802866
e = 00 -> (−1)^s * 2^0 * 0.f
e = 01, 10 -> (-1)^s * 2^(e-1) * 1.f
e = 11 -> fuck my shit up

0 00 01
s = 0
e = 00 = 0
f = 01
-> (-1)^0 * 2^0 * 0.01 = 0.01 = 0 * (2^-1) + 1 * (2^-2) = 0.25
(you move the dot of the fractional 0 spaces to the right)
>>
>>60803261
>implying that's efficient
>>
>>60803158
>defun
gets me every time

"defun" should be off-putting to any first or second language english speaker
>>
>>60803272
keep writing those O(n^2) algs buddy
>>
>>60803275
reagent for clojurescript has defonce which is horrible if you're a native french speaker

for like a month i wondered why the name for it was the french word for "ram"
>>
>>60803248
python

<code>
from collections import Counter
print(Counter(x))
</code>

i'll show myself out
>>
>>60803255
w-what is this?
>>
File: akari desu!.png (216KB, 380x364px) Image search: [Google]
akari desu!.png
216KB, 380x364px
Quick write a program that reverses a number and leaves no leading zeros!
Here's mine
#!/bin/sh
echo $1 | fold -w 1 | tac | paste -s -d '' | sed 's/^0*//g'
>>
>>60803286
kek

https://en.wiktionary.org/wiki/défoncer
>>
File: 1488929856629.jpg (88KB, 1032x720px) Image search: [Google]
1488929856629.jpg
88KB, 1032x720px
>>60803303
now you can use generalised cata and ana morphisms on gender
>>
>>60803307
python

''.join(ch for ch in str(number)[::-1]).lstrip('0')
>>
>>60803307
main = interact (dropWhile (== '0') . reverse)
>>
>>60803336
wtf did i just do am i retarded

i mean all you need is
str(number)[::-1].lstrip('0')
>>
>>60803337
weirdly this doesn't seem to work
I guess it's reading a newline or something before the number
>>
Fucking straight-up energy drinks. I don't fuck around.
>>
>>60803307
(defun maki ()
(loop as n = (reverse (read-line))
until (string= n "")
do (print (parse-integer n :junk-allowed t))))
>>
>>60803272
It's the most efficient, dumbass.

O(n) is the best you can do. And if the set of elements is limited the memory usage is constant (e.g. if the input can only contain the letters a-z then you can get away with an in-memory array of fixed size 26, otherwise you may need up to O(n) memory).

https://en.wikipedia.org/wiki/Counting_sort
>>
>>60802932
>wants complicated language
Python is a complicated language. Way more complicated than any language I'd consider using.

Just because you don't know the language and implicitly limit yourself to a small subset doesn't mean it's simple.

A simple language would be something like Lua.
>>
File: 1471520802412.jpg (29KB, 476x543px) Image search: [Google]
1471520802412.jpg
29KB, 476x543px
>>60803380
>>
>>60799997
>What's your favorite programming beverage?
Soda, Tea.
>>
File: cult_of_maki.png (228KB, 892x590px) Image search: [Google]
cult_of_maki.png
228KB, 892x590px
>>60803397
Eat shit, you rotten tomato.
>>
>>60801550
no clue.
>>
File: 1483367149998.jpg (156KB, 720x720px) Image search: [Google]
1483367149998.jpg
156KB, 720x720px
>>60803406
not me
>>
File: 1438656068852.jpg (60KB, 600x600px) Image search: [Google]
1438656068852.jpg
60KB, 600x600px
>>60803413
>>
>>60803347
type(number)(str(number)[::-1])


Casting to int/float/whatever implicitly drops leading 0s and this way you return the same type you received as input to the function.
>>
>>60802932
>python
>a beverage
>>
File: AAAAAAAAAAAAAA.gif (337KB, 640x360px) Image search: [Google]
AAAAAAAAAAAAAA.gif
337KB, 640x360px
>2am
>noodling around in C
>don't pay attention and type
>gcc -o source.c prog
>whole program is deleted
>>
>>60803307
main = getArgs >>= (putStrLn . dropWhile ('0' ==) . reverse . head)
>>
>>60803396
the standard library is batteries included, but idk what you're talking about, the language is dead simple. maybe not as simple as lua, but compare to any other popular language

https://docs.python.org/2/reference/grammar.html
>>
>>60803442
That this is why you use version control and build systems.
>>
File: 1477922731908.jpg (21KB, 599x334px) Image search: [Google]
1477922731908.jpg
21KB, 599x334px
>>60803442
>>
>>60803499
STAY AWAY FROM HER YOU FRIEND
ONLY I CAN PLAY WITH AKARI-CHAAAAAAN
>>
>>60803442
>2017
>manually typing build command lines
>>
File: akari come with me!.jpg (63KB, 600x800px) Image search: [Google]
akari come with me!.jpg
63KB, 600x800px
>>60803491
>>60803491
>>60803450
>>60803369
Please stop sexualizing my wife thanks.
>>
>>60803442
>using -o
>not just compiling every program to the default a.out
>>
File: 1461287051162.jpg (57KB, 350x386px) Image search: [Google]
1461287051162.jpg
57KB, 350x386px
>>60803524
>kiss marks
SEND YOUR ADDRESS RIGHT FUCKING NOW YOU RAPIST
I'M GOING TO KICK YOUR ASS
FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU
>>
>>60802528
WTF? why would you dedicate a whole string to 1 character?
do:
 char a = '*'; {/code]
but however you do that in python.
>>
>>60803544
alt+c, lad
>>
>>60803307
int reverse(int x)
{
int r = 0;
while(x != 0)
{
r = 10 * r + (x % 10);
x = x / 10;
}
return r;
}
>>
>>60803544
what is a character? there are no characters only strings
>>
>>60802724
in ascending order of difficulty.
>"hello world"
>a string parser
>whatever fits in this range of difficulty
>a game (game engine allowed)
>a bot
>a file reader
>a game (no game engine)
>an encryption algorithm
>a genetic algorithm
>a compiler
>your own OS
>Your own AI
>>
>>60803593
>a bot harder than a game
????????????
>>
>>60802837
you very likely just copy-pastad from a text-to-binary converter.

Write a faggot emoji (rainbow) in binary, fag.
>>
>>60803544

Python, like Ruby, does not have a character type, only a string type. Regardless of whether you are running Python 2 or Python 3, this:
type("hello"[0])


Will spit out <type 'str'>
>>
>I have not been a professional software developer long. But it pains me to see how people go about learning to code. There is no simple trick or secret save for this: most developers write scripts not programs. Knowing the basics is literally all you need in the professional world ( ie an actual company).
Very few corporate developers write entire programs. Those are the elite among even the employed developers. What 'noobs' dont understand is that companies have large code bases and working programs that often need maintained or improved by the 'basics'. This requires fixing it with an often small amouny of code to actually make work since the framework already exists. This framework is (roughly) called the architecture, and is the design and implementation of software. That is a whole new beast.
Once you know the basics then you know what you need to know to be an entry level developer. This is hard for the 'noob' because they feel like that cant be all there is. Well to bad. It is. Writing larger programs is still just stringing multiple smaller scripts into a larger file to hold it all in one place.
O and did i mention that i had a relatively unreleated degree (bs and ms in mathematics) when i was hired to be a developer? I learned from the same websites and books as everyone else when i got here.

is this true?
>>
>>60803593

A compiler is easier than making a game engine from scratch. Unless you are counting a complete compiler backend.
>>
>>60803307
>>60803380
>loop
(defun f (x)
(string-left-trim "0" (reverse x))
>>
>>60803255
>>60803075
>>60802984
I wander. Is gender a float or an integer?
I would assume an binary integer set since it can only be in 2 actual states: 0, and 1. but according to feminists the value is (pardon my mathematical imcompetence) an floating point vlaue with an infinitesimal range between 0 and 1 which approaches 1 but never quite reaches it. (1 being men because it looks like a dick).

so non-queer pseudo-male trans-transitional cis male = 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 which more or less equals cis male (1.0).
>>
>>60803670
There are only 2 genders.
>>
>>60803593
>a file reader
Really depends on the type of file. Either doable in 15 minutes or impossible
>>
>>60803686
[citation needed]
>>
>>60803686
Yeah. There's man and there's wrong.
>>
>>60803599
*scale not to scale
i haven't done bot's so i'm assuming a basic bot is quite easy to do.
>>60803636
I was referring to making a compiler from scratch.
>>60803688
Really depends on the type of file. Either doable in 15 minutes or impossible
i suppose. you couldn't really parse from a .jpeg in the same way as you would parse from a .txt

I have no clue what an actual file reader does, so a meant a literal file reader (a program that parses a file to look for a specific section).
>>
>>60803686
There's actually three, shitlord: male, female, and lisp.
>>
>>60803686
there are 1/INF genders according to some sources. I was just wandering how it would be represented numerically, cause god help you if you have to write and constantly update an array of gender type strings.
>>
>>60802809
What's an interrupt routine, anon?
>>
>>60803608
01010010 01100010 01101100 10011010 10010010
01000010 10100010 01100100 01101101 11000000
>>
>>60802724
a program that ranks truetype fonts based on the total arc length of a (You)
>>
>>60803686
There are 0 genders. Believing anything to the contrary is a terrible mistake.
>>
>>60803804
Everyone is genderless amorphous blob
>>
>>60803804
This.

Gender is a concept made by a pedophilic child molester named money. It has no basis in biology. The correct answer would be that thre are only 2 sexes. Know the difference my friends.
>>
>>60803846
I don't know what gender you are, but I'm sure you're a massive faggot.
>>
>>60799997
When should I stop working through exercises and start trying to create my own stuff? What all do I really need to know?
>>
>>60803922
When you find something you want to make.
>>
>>60803922
Enough
>>
>>60803922
There is no golden road. Though gradually pick up data structures and algorithms as you go along.
>>
>>60803922
Your goal shod be to create stuff as you practice. Challenge yourself with S.M.A.R.T goals for programming, like i did with making an arithmetic program (which took 3 hours to do since im a newbie to java).
>>
What's the best programming language to learn right now? I want to make webapps
>>
>>60803992
C
>>
fatal error: sys/cdefs.h: No such file or directory


I'm using gcc and get this error, but don't know what it means. Google says it's a matter of 64 vs 32 bit architecture. What does /dpt/ say?
>>
>>60803992
Javascript
>>
>>60803992
Java, Python, Ruby, Javascript, Haskell, Lisp, PHP, Scala, take your pick

anything but C and C++ essentially
>>
>>60804007
>sys/cdefs.h: No such file or directory
Wow, so cryptic.
>>
>>60804007
$ touch sys/cdefs.h

that should fix it
>>
>>60804024
Give me the .exe so I can install it, senpai.
>>
I dislike following tutorials - I feel like I'm not actually learning and just copying/pasting.
How bad of an idea is it to just go through the list of basic ideas like Hello World, parsing, etc by Googling anytime I get stuck instead of following a carefully made tutorial?

I can follow tutorials just fine and can understand the basics but it just bothers me since I feel like I'm not learning and literally just copying down what some guy says. Kinda like following a diagram to build a lego house instead of doing it yourself.
>>
>>60804037
>.exe
AHAHAHAHAHAHAHAHA
Fag
>>
>>60804031
Will that just create an empty file? I assume cdefs.h should contain actual information, no?
>>
>>60799997
What's the basics of programming?
>>
>>60804057
https://docs.oracle.com/javase/tutorial/
>>
>>60804007
Google it, it's literally the first result
>>
>>60804042
When following tutorials, I always type the program by hand, never copy paste. I do agree that doing projects on your own is better than tutorials, though.

Pick a lofty goal and build the simplest version of it you can imagine. Then keep improving on it.
>>
>>60804007
jesus anon how can you even get any programming done if you can't solve this easy problem
>>
>>60804057
read this book honey
http://www.ccs.neu.edu/home/matthias/HtDP2e/
>>
>>60804042
read a full C++ book

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
>>
good fortran and cobol resources?
>>
>>60804087
The problem I had with a community college programming class was that the teacher wanted us to copy his code, type if obviously but just copy it.

It bothered me because it was less "I need to make the text entered into numbers to do math, how do I do that?" and more "enter this code and you can now get the percentage increase"

I'll look into doing things myself then, thanks, anon

>>60804111
Kinda dumb question but assuming that with books they're based on old version of languages, good or bad idea to read them anyway? Bceause one issue I came across for C# was that most of the guides were for VS from 2013 or earlier.
>>
>>60801600
>C family is intolerant of failure
Web dev languages - JS, for example - are almost universally in the C family, you idiot, and the C family is known for it's weak typing and procedural code which allows the end user to basically type random tokens from the language and get valid code.
>>
>>60804123
with C++ it's probably best if it's written with C++11 or newer in mind but i'd say it's generally ok to read an older book and you'll be able to pick the newer features up quite easily
>>
>>60804123
It depends on the language. C has K&R, which is still a great manual after 30-odd years, but if you picked up a book on something more recent, like Python, you'd be shit out of luck.
>>
>>60804123
When doing the copy-by-type thing, I will have these ideas like "ah ha! what if I rewrite it like this? is that equivalent?" or "oh ho! how can I modify this code to do ___?" Following up on these thoughts almost always leads me to good learning experiences.
>>
I'm working on a markup interpreter in C++. Starting with JSON (easiest); it takes a haml-like syntax and outputs valid JSON.
>>
test my terribly buggy 4chan python ncurses client

https://github.com/yottu/yottu
>>
Hi again internet. I feel asleep after those bong rips earlier so i'm going to be doing some catch up. I woke up and turned on some beatles and by the A Day in the Life I'm super lonely. We need more girls in here. I'm going to put in a bid to get some more girls roaming through here. I'll see what I can do.

Oh yeah, snack and a drink on me.


So I'm currently going to be working out of java but I might make a chat room engine in unity.
>>
My favorite is python

import os, binascii, time, subprocess, keys, base64, shutil, hashlib

pw = base64.b64decode(keys.password).decode("utf8")
gen = hashlib.sha256(os.urandom(512)).hexdigest()

static = time.strftime('%d-%m-%Y')

zippity = '"C:\Program Files\\7-Zip\\7z.exe" a -t7z -m0=LZMA2:d64k:fb32 -ms=8m -mmt=30 -mx=1 -- ' + \
static + '.7z "c:\\test"'

opensesame = '"C:\Program Files (x86)\KeePass Password Safe 2\kpscript.exe" -c:AddEntry "' + keys.database + \
'" -keyfile:"' + keys.keyfile + '" -pw:"' + pw + \
'" -Title:"Backup for ' + static + '" -UserName:"' + \
static + '" -Password:"' + gen + '"'

encrypt = 'gpg --batch --passphrase ' + gen + ' --output ' + static + \
'.backup --symmetric --cipher-algo AES256 --digest-algo SHA256 ' + static + '.7z'

subprocess.Popen(zippity, stdout=subprocess.PIPE, shell=True).communicate()

subprocess.Popen(encrypt, stdout=subprocess.PIPE, shell=True).communicate()

os.remove(static + '.7z')
shutil.rmtree('__pycache__', ignore_errors=True)

# Decrypt gpg --batch --passphrase INSERT --output backup.zip --decrypt
# FILENAME.BACKUP
print("Complete")
>>
How do I add 2 integers in javascript?
I have a variable i and when I add 1 it concatenates 1 to the number instead of adding.
>>
>>60804236
you mean your favorite is batch?
>>
>>60804236
>>>/trash/
>>
Hello guys, i have stupid question.

I'm programming script in python that exports excel files to propiertary format. I have made that i get excel files from dir listing and problem is how to make new file for every excel

heres example.

exceltosomething(excel, "filename.meme")

so how to make that filename.meme would be like data.xls.meme automatically.

sorry broken english
>>
>>60804345
oops. i mean

like in multiple files that it makes from data.xls to data.xls.meme and data2.xls to data2.xls.meme
>>
>>60804345
Get excel file name, store in variable. Call it something like filename. Then:
exceltosomething(excel, filename + ".meme")
>>
>>60804345
>>60804373
this is one of the great unsolved programs in computer science
>>
Ok, so I need to create multiple drop down lists for my webpage, but only after given how many I need in an input box. Just need some sample code or a link. I can't seem to find a good example anywhere.

I am using html/css/js
>>
>>60804237
What is the code?
>>
>>60804414
if (!(arr[i] % 2))
return i + 1;
>>
>>60804263
I would use pure python library and a 7z library if i could. same with keepass if they had a library for it.
>>
>>60804414
#2=(#1=(t . #1#) . #2#)
>>
be honest with me senpaitachi

is it too late to get in to Machine Learning?
is it too late to get into software engineering?

can a lazy brainlet like me make it? Or am I doomed...
>>
>>60804454
yes, and yes. however, it is not too late to get into [spoiler]networking[/spoiler]
>>
>>60804472
what is "networking"? (not him)
>>
>>60804454
You can do anything you want, if you actually work at it.
>>
>>60804472
>>60804490
who's right?
>>
>>60804454
Machine Learning is a fucking meme
>>
>>60804422
>>60804422
If i is an integer, that should work. On the other hand, you're treating that modulo expression as a Boolean when it returns an integer; meaning so long as the expression's evaluation is > 0, it will be true.
If you're testing for even numbers, I think you would want arr[i] % 2 == 0.
>>
New thread
>>60804534
>>60804534
>>
>>60804396
Thank you very much! You made my day.
>>
>>60804500
both of us desu.
>>60804485
like network admin. It's such a great field, and just too fuckin easy to get into. The whole thing runs off of certificates, degrees don't even matter.

You can get all the study materials you need offline easily, and can just go take a cert test when your ready. If you fail you will know what to study more and can go do it again and again, just costs money. once you get the first couple certs you could be makin 40-50k.

After you get those you want to work of gettin job exp along with more certs over time, and with the money you made you could just go to school to get the next certs on the list. 4-6 years later you will be makin 6 figures son.

Your job: Find network issues in a companies network/tell a company how to layout their labs and what cables, pc's, routers ect they will need to accomplish their goals while staying in budget.

It can be a lot of staring at a pc, but also a lot of cash money.
>>
 teamRepository.findAll().stream().map(Team::getName).sorted().collect(Collectors.toList()) 


Noob question
Can anyone explain me what each method does after the findAll() ?
>>
>>60804635
>It's such a great field, and just too fuckin easy to get into.
It's probably because I'm a codemonkey but every networking class I've taken was a nightmare.
>>
>>60804889
>stream
puts everything into a stream, to do all these other cool operations on
>map
takes every object in the stream and "maps" it to another object, based on the function inside. It can use a lambda operator, or in that case, a function based on a namespace. This maps a stream of Teams to a stream of their names
>sorted
sorts them based on either custom comparator as input, or in your case default comparator
>collect
puts the stream into something useful. In your case it uses a built in collector called ToList, which puts the stream into a list in the same order.

So your thing takes your team list, and returns a sorted list of their names.
>>
>>60801223
Retard spotted.
Generics don't bloat up the binary.
>>
Can I approximate the Linux kernel with an LSTM net?
>>
>>60804042
I'm the same way but i've found that some tutorials can be pretty nice, just the sheer volume of exercises will get you a decent baseline at least. Also there do exist tutorials that don't do all the work for you, CS50 is a pretty good one where every exercise I encountered required critical thinking and problem solving. It tells you what you need to know but it leaves you to implementing it.
>>
>>60803593
>>a compiler
>>your own OS
I personally think writing a compiler is harder than writing an OS.
>>
>>60803686
Wrong
>>60803714
There's -1/12 genders.

please rate my code, I gave fizzBuzz a try. It was pretty hard but I got it working finally, i think. im pretty sure its right, but if someone can check for me that'd be great. am i ready to start applying for software engineering jobs yet? I'm self taught but i'm very disiplined and have been practicing 7 hours a day every dayfor the last 3 years.

Print("1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz")
>>
>>60805396
an OS can be much larger in scope than a compiler
>>
>>60805569
CAN be.
But it can also be much smaller in scope.

A simple compiler will often be more complex than a simple OS.
>>
>>60803714
>1/INF genders
So 0 genders?
>>
>>60800614

It's way easier to remember "righty tighty, lefty loosey" than to comprehend the direction of angular momentum.
>>
>>60805698
if you're intelligent enough it just comes as naturally as anything, as natural as up/down/left/right, x/y/z, 1/2/3/etc, riding a bicycle, once you've learned it it's automatic

do you need mnemonics for tying your shoelaces, finding sin/cos/tan in a right-angled triangle, or for figuring out what 2+2 is?
>>
>>60805825

No, but I personally have very bad spatial cognition, and when I'm using a screwdriver at a funny angle or upside-down or just somewhere I can't see well, it's very easy to close my eyes and repeat the mantra.

But you miss the point. For the truly intelligent, the value of a mnemonic device is in easing the transmission of knowledge to others. You fucking faggot.
>>
>>60805825
I like how you say it comes naturally and then list a bunch of shit that has memory tricks to. Nice meme post.
>>
>>60805846
>he learns things by rote
t. burgershart/pajeet
>>
>>60805846
Not sure where that extra to came from, ignore that.
>>
https://www.youtube.com/watch?v=DbvTO2Msf50

this is how retarded you are

can you remember which way to turn the pedals on a bicycle?
>>
it takes more effort to memorize some shitty string of words than to just internalize the concept intuitively
>>
>>60805910

You're right, it takes more effort for me to read your shitty string of words proving you're a fucking idiot than it takes to just internalize the concept that you're a fucking idiot.
>>
>>60805960
"how many X does it take to screw in a lightbulb" is a joke because screwing in a lightbulb is one of the most trivial tasks you could possibly do
>>
>>60805981

Some people say cucumbers taste better pickled.
>>
>>60805988
you're an idiot
>>
in the western world we read and write from left to right

the number line is drawn from left to right

in a side scrolling video game you move from left to right

it's absolutely intuitive that to turn in a screw you turn it clockwise (to the right, looking at the upper side of the screw)
>>
and you turn a volume knob clockwise to increase the volume

you turn the temperature dial on an oven clockwise

many such examples
>>
Lemonade
>>
your mom's pussy juice
Thread posts: 339
Thread images: 43


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