[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: 321
Thread images: 37

File: DPT.png (389KB, 934x1000px) Image search: [Google]
DPT.png
389KB, 934x1000px
Old thread: >>56619068

What are you working on /g/?
>>
Learning python as my first programming language using this website:
http://www.openbookproject.net/thinkcs/python/english3e/
So far Ive finished chapter 5 and doing fine with excercises.
I have no formal education though, anyone have any tips on things I should avoid? So that I dont end up with bad habits.
>>
>>56624545
yeah, learn scheme instead
>>
>>56624551
Not even MIT bothers with Scheme anymore.
>>
implementing a meme language in C for a uni course
>>
>>56624601

Is it a good meme?
>>
>>56624349
where x is the row?
>>
>>56624512
Doing a login system for muh LOB app, never done something similar.
>>
>>56624650
Where x is the number of columns in a row
>>
>>56624613
Yeah it''s an alright meme, it's PL/0, so it's not complicated. I might add monads to it as a hidden feature.
>>
>>56624575
not an argument
>>
>>56624650
or was it [i*y+j]?
i always get confused. you can figure it out.

also, then you don't need to maket it a pointer to a pointer.

than other anon is correct. after a little experimentation with array i am now convinced that double indexing a one dimensional array is the cause of your problem. i can't believe i didn't spot that myself.
>>
>>56624692

Do it. Everything can be solved with monads.
>>
>>56624575
If MIT got its students to jump off a bridge would you do it?
>>
>>56624719
Sometimes you need monad sans return.
>>
>>56624697
Their argument.

>Costanza asked Sussman why MIT had switched away from Scheme for their introductory programming course, 6.001. This was a gem. He said that the reason that happened was because engineering in 1980 was not what it was in the mid-90s or in 2000. In 1980, good programmers spent a lot of time thinking, and then produced spare code that they thought should work. Code ran close to the metal, even Scheme — it was understandable all the way down. Like a resistor, where you could read the bands and know the power rating and the tolerance and the resistance and V=IR and that’s all there was to know. 6.001 had been conceived to teach engineers how to take small parts that they understood entirely and use simple techniques to compose them into larger things that do what you want.

>But programming now isn’t so much like that, said Sussman. Nowadays you muck around with incomprehensible or nonexistent man pages for software you don’t know who wrote. You have to do basic science on your libraries to see how they work, trying out different inputs and seeing how the code reacts. This is a fundamentally different job, and it needed a different course.

>So the good thing about the new 6.001 was that it was robot-centered — you had to program a little robot to move around. And robots are not like resistors, behaving according to ideal functions. Wheels slip, the environment changes, etc — you have to build in robustness to the system, in a different way than the one SICP discusses.

>And why Python, then? Well, said Sussman, it probably just had a library already implemented for the robotics interface, that was all.
>>
What the fuck is a monad in programming?
All i remember is Leibniz's monads from philosophy class.
>>
why is it called /dpt/ if the thread is made more than once a day?
>>56624575
scheme is fun
>>
File: monad diagram.png (26KB, 334x358px) Image search: [Google]
monad diagram.png
26KB, 334x358px
>>56624762
>>
>>56624763
>why is it called /dpt/ if the thread is made more than once a day?
Probably because they actually were daily when it first started and changing the name now would be a hassle.
Also, "dpt" has a nice ring to it.
>>
>>56624763

It's called daily, not once daily.

>>56624762

It's something entirely different, and even then within programming, it's different. When people talk about monads here, they're talking about Haskell's monads.
>>
>>56624793

As we all know, it's pronounced 'dippy tea'
>>
>>56624763
any set that contains more than one element contains one element
>>
>>56624803
I knew you were a chav
>>
>>56624812

Nah, mate. Dunno what you're talking about.
>>
>>56624790
wtf
>>
>>56624832
Only chavs watch Top Gear
>>
>csc 101 (meme course, i know, but i have to take it because i have no credits otherwise)
>professor couldn't even compile a "Hello, World" program
>we spent a solid 15 minutes of watching the prof fiddle around with things
>all he had to do was go into command line and set path -> javac helloworld.java -> java helloworld
>instead takes the time to install jgrasp and do it that way
>we have to sit there and watch while he does this

>painfully obvious there's no lesson plans at all - we spent an entire lecture after this browsing the java documentation and the prof basically just explaining random String methods to us

kill me. i'm trying to make the best of it. I'm paying attention, taking notes, trying to distinguish semantics in terminology to make sure i get muh 4.0 gpa, but this is just awful

the thing is i could learn faster on my own, but i want to get credit for it in case i want to do postgrad work
>>
>>56624796
then what differentiates it from a general?
>>
>>56624871
>required attendance
>>
>>56624873

The name.

>>56624848

I disagree with your premise.
>>
>>56624900
Disagree all you want mate you're a chav mate your mum told me when I bought some fags off of her. Your dad's a right batty boy he was after me arse the hole time. I dunno how you put up with him he's always going on about stuff.
>>
>>56624848
Now nobody watch Top Gear.
>>
>>56624900
Mummy what should I learn after C#?
>>
>>56623759
>electron :^)
FML, I'll have to give up and use the JS meme. FML a thousand times.
>>
>>56624762
The list is a common monad.

It's parameterized over a type.
You can "map" a function from As to Bs over a list of As and get back a list of Bs. This makes the list a functor (endofunctor, because you don't typically leave the Set category, but that's teetering over the edge of the rabbit hole - let's say functor).
You can take a single A and turn it into a singleton list of As (well, that one A). This is the monad operation called "unit" and sometimes "return" or "pure".
You can take a list of lists and make one big list. This is the monad operation called "join".
Monads are also often talked about in terms of the operation "bind", which combines the functionality of both "map" and "join".
These operations all respect the "monad laws". Presto, a monad.

Other examples of monads that you might recognize:
- most collections
- optional (nullable) types
- exceptions, in a sense
- futures
>>
>>56624942

Whatever you please.
>>
>>56625206
optionals are a collection, a range where you can have at most 1 element
>>
>>56625240
I suppose that's true.
>>
>>56624796
They were daily once.
Now they're trap mem festivals.
Some of the people posting the Himegoto OP probably don't even know it was a forced mem.
>>
get this meta outta here. traps or no, /g/homeworkhelp is technology
>>
>>56625296
what the fuck did you just say to me
>>
>>56625267

Traps are gay.
>>
>>56625324
no u
>>
Why is this thred ded?
>>
>>56625267

Some of the people posting the Himegoto OP don't even program.
>>
>>56625589
Cause people are actually busy programming?
>>
>>56625296
All generals must die.
>>
>>56625628

I know for SURE that is not the case.
>>
The thread is not what's daily, it's the programming that's daily.
It's a thread about daily programming, not a daily thread about programming.
>>
anyone know how i can transform something like
[[1,1],[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[4,1],[4,2]]
to
[AA, AB, AC, BA, BB, BC, CA, DA, DB]
in prolog?
>>
>geforce experience

>LOG IN TO YOUR FACEBOOK/GOOGLE/NVIDIA ACCOUNT

Guess I'm never updating my drivers again
Thanks NVIDIA!
>>
>>56625688
not sure
but just map [1..] to ['A'..]
>>
How do I center an absolute position div?

I don't want to ask /wdg/ anymore because they'll tell me to use jquery and/or set up some event listeners or whatever.
>>
>>56625955
heh, so you were the anon who said it was implementing C string functions to js.
Regarding your question, I can't help sry.
>>
>>56625955

>center
>absolute position

Sorry, those two things are completely opposite of each other. You need to choose one and stick with it.

If you want to center the div provided you don't want it to be absolutely positioned, just set the width to some size like 700 px and then put auto on the left and right margins which will center your div because the CSS standard is set to have te left and right margins provide the same amount of width when both margins are auto.
>>
JUST
>>
File: 1471507906706.jpg (470KB, 2264x1062px) Image search: [Google]
1471507906706.jpg
470KB, 2264x1062px
reminder that palming leftctrl only makes sense if you have manlet hands

instead you should swap capslock and leftctrl
>>
File: 1461385377717.png (220KB, 403x430px) Image search: [Google]
1461385377717.png
220KB, 403x430px
>>56626087
>not using spaces in compound operators
>>
>>56626035

Oh wait, never mind, you mean the positional attribute, not some absolute position div. Just do what I said above.

Here's some CSS to illustrate.

div#thing
{
position: absolute;
width:400px; //You need to set a value for this to work
right: 0;
left: 0;
margin-right: auto;
margin-left: auto;
}
>>
>>56626120
what
>>
>>56626120
you mean binary operators?
>>
>>56625688
Fuck, anon, it's been over 3 years since I last remembered Prolog existed.

map(1, 'A').
map(2, 'B').
map(3, 'C').
map(4, 'D').

cat([X, Y], Z) :- map(X, A), map(Y, B), atom_concat(A, B, Z).
iter([], []).
iter([H|T], Z) :- cat(H, A), iter(T, B), append([A], B, Z).

?- iter([[1, 2], [1, 3], [4, 2]], F).
F = ['AB', 'AC', 'DB'].
>>
>>56626136
>>56626152
Yes, binary, my brain is melting I guess.
>>
File: javascript_roast.png (119KB, 674x671px) Image search: [Google]
javascript_roast.png
119KB, 674x671px
who else /jquery/
>>
>>56626156
After a little more research into Prolog built-ins, I've manged to get all 26 letters in only 2 clauses. This might actually end up being your extra credit solution, so I won't post it. It was fun.
>>
File: 1001004011017909.jpg (47KB, 550x717px) Image search: [Google]
1001004011017909.jpg
47KB, 550x717px
>>56624512
Currently allowing Andrei to deliver the D to me
>>
File: 2016-09-16-031729_500x341_scrot.png (13KB, 500x341px) Image search: [Google]
2016-09-16-031729_500x341_scrot.png
13KB, 500x341px
stdout
[/code]
cc life.c -lncurses
life.c: In function 'next':
life.c:41:31: error: lvalue required as left operand of assignment
: nst[i][j] = (adj == 3);
[/code]
????
>>
>>56626838
don't use ternary like that, use an if statement instead

but it would probably work if you put parentheses around the assignments
>>
>>56626838

If you're going to use a ternary operator, use it like an expression:

nst[i][j] = (st[r+j] ? (adj == 2 || adj == 3) : (adj == 3));
>>
File: 2016-09-16-033649_961x380_scrot.png (47KB, 961x380px) Image search: [Google]
2016-09-16-033649_961x380_scrot.png
47KB, 961x380px
ALMOST WORKS
>>
>>56626964
>>56626838
you're a living meme, friendo
>>
File: Untitled.png (7KB, 539x141px) Image search: [Google]
Untitled.png
7KB, 539x141px
My Android IDE throws this every time it tries to sync with Gradle to initialize a project. IDE is IntelliJ IDEA

Any idea how to fix? I can't proceed without this step.
>>
>>56626982
at least he's not haskell posting any more
>>
>>56626982
shut the fuck up
I started c a week ago

anywyas, can you debug my prog
https://0x0.st/Swq.c
>>
>>56627004
fuck, I knew somebody would recognize me
I should never post my screenshots
>>
>>56627037
You're the only person on earth with that disgusting theme, and you went out of your way to embarrass yourself by presenting poorly written C as a feeble argument for why haskell is good.
>>
>>56627049
that was a trollpost
>>
>>56626982
y r u so mean
>>
>>56627049
let me see your theme
>>
Explain to me like I'm an idiot what a monad is and why I would find them useful.
Do not just reply with "monoids in the category of endofunctors"
>>
>>56627128
monads are something you learn by doing, not by reading on some blog
better start that haskell
>>
>>56627128
it's just a meme and they are not useful
>>
https://wiki.haskell.org/Monad_tutorials_timeline

>the fact that this even exists
not sure if funny or sad
>>
>>56627199
t. c89 programmer
>>
>>56627230
>le abstraction makes everything better man
>>
>>56627026
If you use that many ternarys you should just end it now

C is about data manipulation, not writing easy code
>>
File: ganooh.png (209KB, 679x593px) Image search: [Google]
ganooh.png
209KB, 679x593px
>>56624762

>What the fuck is a monad in programming?

First you should understand Monoids (they are the "little brothers" of Monads):

So what's a Monoid?
A bunch of objects with an operator, so that..

1. If you use two objects with this operator, you get another of those object.

2. There's a special object. If you apply the operator with this object on one side, the other object stays the same.


Example:
1. The number of all texts.

2. "Concat" is our operator, because ("OP" + " is a faggot.") = "OP is a faggot."
--> Each two texts create a new text.

3. Do we have a "special object"? Yes, the empty string:
"Hello. I'm a text." + "" = "Hello. I'm a text."


We just created our own Monoid!
So what's the differnce to Monads?

>"A monad is just a monoid in the category of endofunctors"
--> WTF?!

1. "Endofunctors" are "functors" that map a category to itself.
2. "Functors" are certain mappings, basically an abstraction of functions. For example turning "x*x" into "exp(x)".
3. "Categories" are objects than are somehow "linked" to each other (and can get linked to themselfes).


So "what's a Monad"? (..abridged..)

1. We have a bunch of objects.
2. Those objects can get mapped to each other and also mapped to themselfes.
3. Those objects have an operator: x ["operator"] y --> z
4. There's a certain object which leaves each object itself: x ["operator"] [SPECIAL OBJECT] --> x


Wow, seems like our previous text example is even a Monad !!!


On a sidenote, there are - of course - serveral mathematical details about this. For example you have to stay within the same "order".

So to """really""" understand monads, you have to be more nitpicking.. what is "text appending" anyway?

Bascially we take a bunch of letters in a certain order, "unpack" those letters and put them together again..
Think about text like a "linked list of letter". Concat takes that last letter (of the first text) and links it to the first letter (of the second text).

Cool, eh?
>>
>>56627026
>https://0x0.st/Swq.c
a) fix your indentation
b) use descriptive variable names
c) youre using way more ternaries than you need to
>>
File: 4324134231412.jpg (1MB, 1068x1136px) Image search: [Google]
4324134231412.jpg
1MB, 1068x1136px
>uni wants C not C++
>>
>>56627464

Deal with it, Anon.
>>
Should I put my answers to r/dailyprogrammer challenges on my github?
>>
>>56627464
Your uni is god-like.
>>
>>56627557
yes
>>
Can someone point me to a good example of C++ Abstract Data Types, particularly array list implementation? I literally cannot comprehend my teacher's accent and I'm scared it's cause me to fail this class.
>>
Can someone help me explain the mobile part with css?

I'm using @media currently and I can place the divs correctly depending on the display width, however their sizes along with the elements within are too small

Is customizing height and width of every element/div the right way to go for mobile or is there a more plausible way
>>
>>56627644
>>/wdg/
>>
>>56627644
what does this have to do with programming?
>>
>>56627667
>>56627698
he knows there's a thread and its inappropiate here, he's just trying to get a response anyway
>>
>>56627644

You basically never want to write CSS so complicated that you're specifying every single div's parameters. I can't think of a single time that could ever be efficient or even useful.

Do this if you want to learn CSS properly in the year 2016:

1. Just start with Sass. Google it if you don't know what that is. If you're on Mac, buy Codekit. If you're on Windows, buy Prepos. They are tools for beginners which clearly you are. I still use Codekit for short term freelance bullshit. It's a fine investment at $30.

2. Pick a library or framework. I do not recommend Bootstrap. Go with Foundation or Susy. Let the framework simplify your layout so you can focus on other things like vertical alignment and typography.

3. Pick a project. Start with a mobile layout. Then gradually design a tablet / desktop version of that layout. Use CSS breakpoints to divide your code up into partials for each device. Larger devices should overwrite specific lines of code from the smaller devices, but still utilize as much as they can.

4. Just keep fucking with it until it makes sense. Google anything you don't understand, including anything in this comment. Learning it this way will save you months of time if you're at least somewhat bright.

Take any questions to /wdg/ - web development general - because most people here are easily rustled by web developers.
>>
>>56627375

how else can I do it without the ternaries
>>
>>56627794
>Do this if you want to learn CSS properly in the year 2016:
>recommends literally who libraries and frameworks
kill yourself
>>
>>56624545

Also learning here, except Java.

Using a free course by a University in Finland, online.

I learned BASIC and Pascal as a kid. Then C in high school. Then some Ruby and JS in University (I studied Philosophy, not CS, mind you).

So I have a weird history... never really created a program worth mentioning though...

I decided to go for Java for several reasons:

1) it hides less than Python from you... maybe Python is better if you're a complete beginner for programming, but otherwise I'd say Java is a better idea

2) easier to transition to C++ or C# later on if you choose to

3) Android apps

4) relatively easy compared to C++

5) run on virtual machine so not dependent on OS

6) most job opportunities

7) most resources online (#1 most popular language)


So far I'm loving it. For some reason I hated JS and scripting languages like Ruby. Maybe it's just not how my mind works. Especially JS I hated I thought of giving up programming in general because of it.

So if you ever get tired of that course don't give up programming! Just try with something else, maybe Java.

Now I'm learning 8 hours a day and it's fun! I love Java.
>>
>>56627794
>he needs libraries to manage / create his code
lmao
>>
>>56627832

What would you recommend a beginner? I use neither anymore, but Susy helped me learn very quickly. It's simple as fuck and doesn't do anything you're not aware of, unlike all the shit I found myself overriding constantly on Bootstrap.

Also, Foundation is not literally who. Probably second most popular for beginners under Boostrap. I'm not going to tell this guy to start with a JS framework like Angular or React for learning CSS, which is basically what I exclusively program in right now.
>>
>>56627862
i honestly can't tell if you're memeing or if you're actually being serious
>>
>>56627026
cluttered as fuck.

Also you're using ncurses, you can just create a second WINDOW and use double buffering instead of doing it yorself and re-allocating an x by y array every fucking step.
>>
what's wrong with learning "plain" actual CSS with flexbox or someshit?

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
>>
>>56627862
>I'm not going to tell this guy to start with a JS framework like Angular or React for learning CSS, which is basically what I exclusively program in right now.
This doesn't make any sense. Why would you recommend anything other than CSS to someone who wants to learn CSS?
>>
>>56627889
>cluttered
>>
>>56627870

I honestly can't tell if you're just jerking me around because I responded to this guy's web question in the /dpt/. I told him to start with Sass because I cannot name a single competent team in my city that does not use it, minus one that's still using less for some reason. I told him to use an incredibly simplistic and flexible grid framework (susy) that has no unintended side-effects on your CSS, and to avoid Bootstrap because it coddles you. I told him to use Google because HTML / CSS are well documented online.

Explain to me what's wrong with that advice instead of trying to backpedal out of this.

>>56627904

That's just what I assumed me meant with "literally who" frameworks. React might be the most popular library outside of JQuery right now.

And I recommended Sass because it's just CSS with better practices.
>>
>>56627911
you can start by using proper formatting with spaces and such, this isn't haskell ffs
>>
>>56627919
>>56627900
>>
>>56627920
where is it cluttered
>>
>>56627932
fucking everywhere you're not putting spaces after commas etc and you're even putting multiple statements on the same line follow some basic style guidelines jeez just auto format it in your IDE and it will fix itself
>>
File: 1513_code_quality.png (65KB, 740x258px) Image search: [Google]
1513_code_quality.png
65KB, 740x258px
>>56627911
read a styleguide, no matter if linux kernel, nasa or gnu but what your doing now is not debugable.
   srand(time(0) + clock());
int y, x; initscr();
noecho(); cbreak();
>>
Why don't you guys like Rust?

Here's the actual Option definition from the stdlib:

pub enum Option<T> {
None,
Some(T)
}
>>
>>56627962
it's not C++
>>
>>56627900
>>56627930


Absolutely nothing is wrong with that, but a lot of frameworks are compatible with stuff like Flexbox and help beginners understand layouts and build better, more functional sites at a far more rapid pace. You can pick up all of CSS's weird quirks as you go along. This isn't C++. Nobody needs to read a 500 page book to get it.

Also, he was asking about mobile web design, specifically. Clearly, he's already done some introductory CSS. Are you guys just slow?
>>
>>56627969
Yes, that's its biggest strength
>>
>>56627962
it's a worse and less widely adopted C++ with a bunch of meme shit tacked on to it. there is no compelling reason to use rust.

>>56627987
fuck off and die
>>
>>56627953
why would you do
thing();
shit();

when you can save a line?
>>
>>56627987
fuck off and die
>>
>>56627993
haskell seems to have given you permanent brain damage
>>
>>56627992
>it's a worse and less widely adopted C++ with a bunch of meme shit tacked on to it. there is no compelling reason to use rust.

this is how i know you're too stupid to use it

happy segfaults!
>>
>>56627993
nah, you're baiting
>>
>>56628012
stay delusional
>>
>>56628012
>happy segfaults!
lmao what a moron
if you did CS101 with C++ it doesn't mean you know what you're talking about
>>
>>56628005
>>56628013
ok, so how would you guys write my main()
>>
>>56628025
int main(void)
{
int y;
int x;

srand(time(0) + clock());
initscr();
noecho();
cbreak();
halfdelay(3);

while (1) {
getmaxyx(stdscr, y, x);
cpst(y, x);
clutter(50);
refresh();
next();

for (int i = 0; i < y; ++i) {
for (int j = 0; j < x; ++j) {
mvaddch(i, j, st[i * x + j] ? '*' : ' ');
}
}

if (getch() == 'q') {
break;
}
else {
clear();
}
}

endwin();

return 0;
}
>>
>>56628065
so, one per line, and group things together
>int y;\n int x;
come on, at least make it inx y, x;

and I assume for the clutter function
you'd do

void clutter(int n) {
static int thousand = 0;

if (!thousand)
thousand = n = 1000;

for (; n-- ;) {
st[rand()%y * x + rand()%x] = 1;
}
}


but im not sure about the for loop
>>
require 'mechanize'


mecano = Mechanize.new
loaded_page = mecano.get('http://www.linguee.com/english-portuguese/search?source=auto&query=holy+cow')

puts loaded_page.title
foreign = " #{ loaded_page.at('.tag_trans').text.strip}"
foreign.chomp('/f$/')
puts foreign

I'm trying to remove the "f" at the end of the string (foreign), why isn't this regex working?!?!?!
>>
>>56627026
>>56628065
you're not initializing the y and x in main
>>
>>56628123
>getmaxyx(stdscr, y, x);
>>
>>56628115
void clutter(int n) {
static int thousand = 0;

if (!thousand) {
thousand = 1000;
n = 1000;
}

for (int i = 0; i < n; ++i) {
st[(rand() % y) * x + rand() % x] = 1;
}
}
>>
>>56628115
void clutter(int n) {
static int thousand = 0;
if (!thousand)
thousand = n = 1000;
for (; n-- ;) {
st[rand()%y * x + rand()%x] = 1;
}
}

Be consistent! don't leave out optional curly braces in one statement but add them in another statement.
>>
>>56628132
unless getmaxyx is a macro (in which case it should be in uppercase) then it should be getmaxyx(stdscr, &y, &x) depending on what getmaxyx is supposed to do (it's not included in the source so i can't see it)
>>
>>56628149
>thousand = 1000; \n
>n = 1000;

why
>>
>>56628115
>come on, at least make it inx y, x;
having them on separate lines makes it much easier to see at a glance how many variables there are, it's more readable
>>
>>56628165
it's more readable
>>
am I a faggot if I like my code to pretty
and by pretty I mean
>has a nice looking structure
>is as concise as can be

meme code related that I find very pretty
import Data.List
import System.Random
import Data.Bifunctor
import UI.HSCurses.Curses

data Cond a = a :> a
infix 4 :>

b ? (u:>j) = if b then u else j
infix 3 ?

main = do
initCurses; cBreak True
(l,m) <- bimap (pred) (pred.pred) <$> scrSize
r <- rand (l,m) 1000
echo False; mloop r; endWin

mloop st = do
(l,m) <- bimap (pred) (pred.pred) <$> scrSize
mapM draw st; refresh; wclear stdScr
next <- filter (\(a,b) -> a <= l && b <= m)
. (++nextgen (l,m) st) <$> rand (l,m) 10
mloop next
where draw (y,x) = wMove stdScr y x >> wAddStr stdScr "*"

rand (l,m) n = do
g <- newStdGen
return $ take (fst $ randomR (0,n) g)
$ zip (randomRs (0,l) g) (randomRs (0,m) g)

nextgen (l,m) xs
= filter (\x -> isct x `elem` [2,3]) xs
++ filter (\x -> isct x == 3) [(y,x)| y<-[0..l], x<-[0..m]]
where isct x = length $ intersect (adj (l,m) x) xs

-- coordinate functions
adj lm yx
= map (\f -> f lm yx) [u,d,l,r,ul,ur,dl,dr]

u (l,m)(y,x) = y==0 ? (l,x) :> (y-1,x)
d (l,m)(y,x) = y==l ? (0,x) :> (y+1,x)
l (l,m)(y,x) = x==0 ? (y,m) :> (y,x-1)
r (l,m)(y,x) = x==m ? (y,0) :> (y,x+1)

fym f y m = f m . y m

ul = fym u l ; ur = fym u r
dl = fym d l ; dr = fym d r
>>
>>56628179
>haskell
>pretty
>>
>>56628183
or whatever shitlang that is
>>
Make is shit.
CMake is shit.
GNU autotools are pure cancer

Are there any decent build systems out there that aren't pure garbage?
I'm so sick of make, it's pure fucking shit, declarative build system are fucking garbage.
I don't care if it's not cross platform, I just want a build system that doesn't make me want to kill myself.
>>
>>56628179
nobody else (and you in a month) has any idea what your code does at first glance
>>
>>56628201
CMake.
>>
>>56628201
i updated to eclipse neon and just having make with no gradle cancer is heaven by comparison
>>
>>56628212
Shit.
>>
>>56628217
Some shits smell worse than other.
CMake is what we have.
>>
>>56628207
is the only goal readability
>>
>>56628201
Just use VS :^)
>>
>>56628226
pretty much

why would you need to save lines? you don't get any more good points just because you write """"concise"""" code
>>
>>56628201
>Are there any decent build systems out there that aren't pure garbage?
SCons

Make and CMake is shit and autotools / autoconf makes me want to kill myself everytime I use it.
>>
>>56628226
it's definitely not how many functions with 1 letter parameters you can fit on 1 line
>>
>>56628237
>good points
good boy points
>>
>>56628117
Any one knows how to remove the last character of a string in ruby?
>>
>>56628239
what do you mean everytime you use it? you set it up like once for a project and tweak a few lines once in a while and that's basically it, it's fucking nothing
>>
>>56628237
>>56628241
I'll take your advice.
I just hope I can decipher code more quickly if I adopt this style.
>>
>>56628261
>what do you mean everytime you use it?
Everytime something breaks or someone has added something new that doesn't work on all configurations or anything. It is pain to use.

>you set it up like once for a project and tweak a few lines once in a while and that's basically it, it's fucking nothing
I have to work with 15 other developers and test and debug on 10 different architectures, and this shit has to work on Windows, Linux, FreeBSD and on fucking VxWorks (we don't build on VxWorks, but it needs to compile for it).

It's fucking hell I tell you.
>>
>>56627104
>>
>>56628319
No contrast. Shit/10.
>>
>>56628201
ruby made one
>>
>>56628326
Completely wrong.
If there was no contrast you wouldn't be able to see any text or the side bar.
>>
>>56628319
i don't see how my theme is worse than yourse
I'd say they're in the same level

also, I use redshift, so that means my theme looks better under it
>>
>>56628339
Poor contrast. Shit/10.
>>
>>56628379
this
>>
>>56628379
Completely wrong.
Colors can't have a financial status.
>>
>>56628319
Jesus christ that's a horrible scheme
Do you actually program with that?

>>56628425
Completely wrong.
t bernie
>>
>>56628252

chop if you want a copy of the string with the last character removed
chop! if you want to remove the last character in place.
>>
>>56628333

Is currently making one*

Have been sidetracked.
>>
>>56628436
I can't believe you actually use ruby ruby, ruby is a disgusting OOP language.
>>
>>56628326
>>56628344
>>56628433
stay jelly fags :^)
>>
>>56628425
>Colors can't have a financial status.
In my experience coloreds are usually pretty poor in comparison to whites.
>>
>>56628201
Shake
>>
>>56628452
Completely wrong.
Jelly can't have a sexual preference.
>>
File: Completely right.png (53KB, 751x616px) Image search: [Google]
Completely right.png
53KB, 751x616px
>>56628452
Get on my level.
>>
static const auto sz = (size_t) sizeof(char);
>>
>>56628483
static_assert(sizeof char == 1, "weak b8");
>>
>>56628478
r u writing an OS
>>
>>56628447

Ruby is the most comfy scripting language, and it does OOP better than everything else -- the Smalltalk way.

>>56628483

constexpr size_t sz = 1;
>>
>>56628478
you get on my level
>>
>>56628501
How deep can you take your dildo in?
>>56628504
that code horrifies me
>>
File: 1466357488472.png (652KB, 1280x720px) Image search: [Google]
1466357488472.png
652KB, 1280x720px
>>56628501
>Ruby is the most comfy scripting language, and it does OOP better than everything else -- the Smalltalk way.
chigau
>>
>>56628478
>implying you can get any better than this
>>
>>56628226
the entire fucking point of pure fp is improved readability through lack of state
yet you fucks bastardized it so much by prematurely abstracting every single duplication that your code is worse than most stateful imperative code
>>
>>56628528
you need colors on let, if else etc etc
>>
File: snap_81.png (107KB, 1344x629px) Image search: [Google]
snap_81.png
107KB, 1344x629px
>>56628504
>>56628528
NO U
>>
File: editor.png (28KB, 659x779px) Image search: [Google]
editor.png
28KB, 659x779px
>>
>>56628547
>>56628478
where do i learn how to write kernel programs like that
>>
>>56628560
>Less than one comment per line
Poorly 'documented'
>>
>>56628529
never go full fp
>>
>>56628566
http://wiki.osdev.org
http://eudyptula-challenge.org/
>>
File: meme fizzbuzz.png (24KB, 437x388px) Image search: [Google]
meme fizzbuzz.png
24KB, 437x388px
>>56628569
it's self documenting, but only if you're not retarded :^)
>>
>>56628179
Your attempt to mimic C's ? syntax is retarded
Don't do that

It may be better to assume scrSize is a num, and use (-2) rather than (pred . pred)
don't put multiple statements on the same line in large blocks
you repeat the bimap pred pred thing, consider just writing something like

adjustedScreenSize = bimap (-1) (-2) <$> scrSize

>++
don't do this

this entire bit might be nicer as a comprehension anyway

your nextgen bit needs refactoring, it's hideous
same for co-ordinate functions, your adj function is horrifying
>>
>>56627026
so much for shooting yourself in the foot
>>
>>56628521
I do not own a dildo, Anon.

>>56628524
違わない。 ルビはとても快適、名無し。
>>
prove to me theres a single valid reason why c++ is still being used today
>protip you literally can't
>>
>>56628735
ruby is as comfortable as a bed of knives

>>56628759
performance
>>
>tried HTML, PHP, Java and Pascal (albeit when a kid)
>always extremely frustrating as one error leads to another

I just can't seem to program /g/ or I don't have the mindset for it. What can I do to solve this? I wouldn't mind trying to be something like a freelance web developer just to do on the side but I don't think I'd actually manage an IT desk job (moved to another industry) I just want to learn something to feel a bit more productive.
>>
>>56628759
Because it's the best language for writing high performance feature rich software with reasonable productivity.
>>
>>56628582
>it's self documenting, but only if you're not retarded

Not commenting on your code, but it's amazing how often I see this mentality.

Obviously, it doesn't matter on something as trivial as a fizzbuzz, but people will leave 8 lines of very unique code uncommented, and when they come back to it 3 months later, they won't be able to immediately tell you what it does or why it exists.

Technically, comments are not required at all if there are no "magic numbers", because anyone sufficiently versed in the language could sit down and take the time to follow all of the pathways throughout the code base. However, the main point of commenting code is to explain oddities and give the viewer a brief summary of the 'Why' and 'What'.
>>
>>56628797
>they won't be able to immediately tell you what it does or why it exists.
That's often the case when you comment unique blocks of code too. Often i come across comments and find it's easier just to read what the code does because the comments don't explain the thing that I find hard to understand, or they are outdated because the code was changed 5 times since the comment was written.
>>
>>56628792
If your biggest issue is errors, then C#+Visual Studio would be a great language for you.

Errors are generally very easy to understand, or at the very least easy to google, and the debugger is extremely easy to work with so you can figure out exactly what's happening in your code.

Obviously, many other languages have great documentation and IDE/debugging support, but C#+VS is really easy to plug-and-play and learn.
>>
>>56628797
you don't write haskell though
>>
im in my first programming class, and my first assignment is to

"write a program that stores the integers 62 and 99 in variables, and stores the sum of these two in a variable named total."

i wrote this, but there's an error, and im not quite sure what I did wrong. any assistance would be appreciated, thanks!

oh, im using dev c++.

#include <iostream>
using namespace std;

int main()
{
//input define vars
sauce = 62,bread = 99,pizza = total;

//processing
//Calculate number
pizza = sauce + bread;

//output
cout << "The number is << pizza << endl;
system("pause")
return 0;
}
>>
>>56628894
>pizza = total
>>
>>56628894
You need to declare what types of variables they are. C++ doesn't automatically assume the data type.

Do this:

int sauce = 62;
int bread = 99;

int pizzaTotal = sauce + bread;

cout << "The number is " << pizzaTotal << endl;
>>
>>56628794
this
>>
File: anal beads.png (9KB, 423x275px) Image search: [Google]
anal beads.png
9KB, 423x275px
>>56628894
Look at the colors.

You tell me, anon.
>>
>>56628894

1. Variables need to be declared with their type.
2. You assign pizza to the variable total, but total has not been declared previously.
3. You don't actually terminate your strings. You needed an extra quote after "is" in the cout statement.
4. Get rid of the system("pause"). It's useless, non-portable, and it actually introduces a security vulnerability to your program.
>>
Does anyone here have experience with Elm? Can you compare it to React/Angular?
>>
>>56628975
>>56628927
>>56628918
>>56628911
thanks you!
>>
If your APIs don't have a WSDL, you're probably a cock-sucking faglord.
>>
What's the fastest option for getting started on a c++ application, meaning an ide + compiler that doesn't take ages to download like visual studio?

I don't need a lot of features, just wanted to test some things in c++.
>>
File: 1471298710935.jpg (85KB, 640x580px) Image search: [Google]
1471298710935.jpg
85KB, 640x580px
How easy is it to crack a 25mb programm with a 7 day trial? I can't program, but am willing to pay 200$, is there any place where I could go?

(Someone from the stupid question thread told me to come here)
>>
>>56629090
WSDL is dead. Long live GraphQL!
>>
>>56628792
Who are you quoting?
>>
>>56629106
It's just one standalone .EXE or what?

Just use ILSpy or one of those disassemblers.
>>
>>56629121
He wasn't quoting anyone. That was a "green text story", which has been a common way to share anecdotes on 4chan in a succinct manner.
>>
>query taking 4 minutes
>add index to table
>query takes less than 2 seconds now

I'm starting to into database, and this is actually pretty neat.
>>
>>56629159
>query taking 4 minutes

How much of a mess is the table for you to get that?
>>
>>56629165
The query used 12 tables, and one particular table was extremely large with a foreign key to the base table's primary, so adding a nonclustered index on that key made the join faster by orders of magnitude.
>>
>>56629159
It's amazing what proper indices and statistics can do...
>>
>>56624512
I just wrote an minimalist state manager for use with ReactJS (eventually I hope to abstract away the dependency on ReactJS) and put it on NPM

I'm interested in anyone willing to take a look at it and make suggestions.

https://www.npmjs.com/package/minimux
>>
>>56629202
>>>/g/wdg
>>
>>56629209
Thank you. First time in /g/ and saw this thread at the top. Didn't realize there was a more appropriate one.
>>
>>56629130
>It's just one standalone .EXE or what?
Yes

>Just use ILSpy or one of those disassemblers.
Like I said, I never coded anything, is it complicated?
>>
File: 1472599063222.jpg (533KB, 1000x1062px) Image search: [Google]
1472599063222.jpg
533KB, 1000x1062px
Free kiss for anyone who tells me how to access OpenGL in a program without using GLAD
promise legit awoo and not austistic neckbeard
>>
>>56629308
Something like ILSpy will show you a representation of the code in the program.

If you don't know the language, it's not going to help you much.

What exactly are you trying to do? Why are you trying to "crack" this program?

Even if you did see the code, whatever the authentication method may be could rely on server communication, which would be very difficult to work around unless they wrote it very poorly.
>>
>>56629322
>Free kiss for anyone who tells me how to access OpenGL in a program without using GLAD
GLEW
But yeah, there's a wiki entry on it.
https://www.opengl.org/wiki/Load_OpenGL_Functions
>>
>>56629363
Is GLEW better than GLAD?
My definition of "better" is "not python scripting with no installation instructions anywhere on the internet".
Also, is the reason why I'd use GLEW rather than that example code because GLEW covers multiple platforms?

Actually, that makes me wonder if GLFL + GLEW means I already have something that works on the three major operating systems.
>>
>>56629322
>free kiss
loli kiss?
>>
>>56629411
>Is GLEW better than GLAD?
You shouldn't use either considering how simple it is to load the functions.
Yes it is better.
>>
>>56629435
So I should just program it in per-platform?
Not that I'd mind including GLEW if it's really lightweight.
>>
>>56629411
>My definition of "better" is "not python scripting with no installation instructions anywhere on the internet".

>include a header
>link a library
>5 lines of initialization and basic error handling
You now have access to OpenGL in its entirety.
>>
should i learn c before c++ or just jump in
>>
File: monads.png (13KB, 360x230px) Image search: [Google]
monads.png
13KB, 360x230px
https://github.com/KitFreddura/Kinder

Rust is getting monads.
We are you going full meme.
>>
>>56629515
Why not just move the box with the balls around the big stupid contraption? It's the same on both sides, innit?
>>
>>56629511
just jump in, they're two different languages, learning C first would be a waste of time and could cause problems with getting stuck in the wrong mindset if you want to learn C++
>>
>>56629578
thank you, sir
>>
>>56629515
>KitFreddura
>Freddura
>Fedora
>>
>>56629467
That's for a single platform though; and without testing (which would be hard), I can't be sure it works because I always fuck up my code.
>>
>>56629528
Check the color of the box on the right, it's slightly different.
A monadic bind just replace the box you don't like.
>>
>>56629511
I would start off with C then move to C++ so you get an understanding of what stands under the surface of some C++ constructs.
Learn to appreciate that C is clean, than move to C++ to get more tools and a more complex environment with them.
>>
Want to try c++, but visual studio is to big for me to download with my third world connection. Any suggestions?
>>
>>56629654
http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/neonr
>>
>>56629139
Thank you, fellow Reddittor. I'm new here and still getting comfortable in my bearings. I did not intend to offend anybody.
>>
File: Installer.png (217KB, 975x671px) Image search: [Google]
Installer.png
217KB, 975x671px
>>56629654
>>
>>56629654
Emacs, Vim, Sublime, Atom, VS Code, or any of the other bazillion editors out there, and a couple of plugins.
Literally just take your pick and google "whatever editor c++"
>>
>>56629696
download size?
>>
>>56629711
well under a gig
>>
File: Capture.jpg (31KB, 503x540px) Image search: [Google]
Capture.jpg
31KB, 503x540px
>>56629696
what sorcery?
>>
>>56629654

Vim or die.
>>
>>56629754
Vi Vi Vi is the editor of the beast.
>>
QUICK!

I have a C# interview in 3 hours.

I'm mostly a web guy but I started out doing vb and c# when I was in high school.

Summarize all the important concepts of C#/.NET.

I'll get started
Async programming: threads, background workers, makes your apps run without freezing up. semaphores, locks, mutex.
>>
>>56629741
https://go.microsoft.com/fwlink/?LinkId=733434

It's a recent thing they did that allows you to just install specific to your needs.

https://blogs.msdn.microsoft.com/visualstudio/2016/08/22/visual-studio-15-preview-4/
>>
>>56629795
LINQ, LINQ, and LINQ
>>
>>56629798
I see, thanks.
>>
>>56629795
buzzwords, buzzwords and buzzwords
>>
>>56629795
LINQ, NUGET, aspnetcore and maybe stuff like mono if it needs porting over to non-windows environment.
>>
File: v%.gif (14KB, 306x108px) Image search: [Google]
v%.gif
14KB, 306x108px
>>56629780
>>
>>56629810
LINQ? OK.

what else?
>>
>>56629795
tell them you have used c11 futures because they are better
>>
File: viB.gif (21KB, 306x108px) Image search: [Google]
viB.gif
21KB, 306x108px
>>56629840
>>
>>56629844
LINQ
>>
>>56629848
thanks, its all coming back to me now
>>
>>56629840
Yes, what?
These are baby-tier features that every self-respecting editor has.
>>
File: vi'.gif (10KB, 268x91px) Image search: [Google]
vi'.gif
10KB, 268x91px
>>56629851
>>
>>56629654

MinGW-w64 as your compiler toolchain.

For your text editor... really, whatever you are comfortable with. Many beginners start with Notepad++ on Windows.
>>
>>56629862
LINQ? OK.
what else?
>>
>>56629795
Having to worry less about runtime errors and memory leaks.
Easy package management for external dependencies via NuGet.

The language is explicit and verbose, but allows you to be implicit and succinct if you want to. It's statically typed, but you can do dynamic typing if you want to. It has a GC and code is "safe", but you can write unsafe code if you want to.

Like Java and other object-oriented languages, has many features to encapsulate, abstract, and manage visibility of methods and data throughout your program.
>>
File: ggVG.gif (24KB, 268x143px) Image search: [Google]
ggVG.gif
24KB, 268x143px
>>56629871

Yes, those are basics.
But you gotta start somewhere..
>>
>>56629879
WPF (MVVM), ASP, dependency injection, ect...
>>
>>56629897
These are baby-tier features that every self-respecting editor has.
>>
>>56629879
anything here https://www.dotnetperls.com/
>>
Thanks 4chan your a cool guy.
>>
>>56629795
C#.NET has a massive standard library that means you have access to a buttload of things without having to bring any 3rd party libraries with you.

That being said, libraries are easy to get with NuGet, and easily embeddable into a standalone executable with Costura.Fody.
>>
>>56629873
>>56629897
>>56629873
Where can i find tutorials that explain this kind of things? The vim wiki is too vertical.
>>
File: 1401673558080.webm (649KB, 472x560px) Image search: [Google]
1401673558080.webm
649KB, 472x560px
>>56629897
>>
Also, what C# tech is deprecated ? I dont want to mention old stuff and look like a retard.
>>
>>56629908
Completely wrong.
Editors can't have self-respect.
>>
>>56629964
>what C# tech is deprecated
anything that intellisense doesn't autocomplete
>>
>>56629984
Emacs has achieved Self-consciousness
>>
>>56629984
stop trying to force your shitty meme
>>
File: anal beads.png (39KB, 673x433px) Image search: [Google]
anal beads.png
39KB, 673x433px
>>56629964
Linq-To-Sql has been widely replaced by Entity Framework.

WinForms is old and dusty, but is still needed for maintenance and based cross-platform applications. WPF is the most recent non-Store Windows-GUI framework. Now there's UWP (Universal Windows Platform) that will run on 10, XBone, windows tablets and phones.

I can't think of any C# or .NET-specific tech that's really just not used, because there's plenty of applications to be maintained.

You might also want to be familiar with .NET, C#, and ASP versions.
>>
>>56629897

Ah, messed up the title..

It's "visual mode block selection", you start it by pressing [ctrl]+v

Anyway, real cool commands are:

:14,$!sort
(sort lines 14 until end of file)

:% g/del/m$
(move all all lines that contain "del" at the end of the file)

]p
(insert buffer, but align with the line where you insert)

5>>..
(Indent 5 lines three times)


5 [ctrl]+a
7 [ctrl]+x
(increment number under cursor by 5, decrement by 7)


But the power are not the single commands, the power is that once you can chain those pieces together.

Once you have an intermediate powerlevel on Vim, you don't even have any competitors anymore (in terms of speed and productivity).
>>
>>56630029
:qa!
>>
How would I go about just using a straight text editor and compile with gcc?
I used to use visual studio or codeblocks or something but I kind of wanna go down this route. I'm on linux right now but I don't have any experience with this kind of stuff.
I know theres makefiles and stuff but surely I wouldn't have to write one for every project I make right? They seem really tedious to make. I don't know what's standard. I don't know really. What should I do?
>>
>>56629942

First do the vimtutor a few times until you are fluently.

(--> just go to linux command line and type "vimtutor")


Then learn Macros - you can record your actions and replay them, like here:
>>56629946


Then learn some cool "Visual Mode" commands to immediately select the part you want, like here:
>>56629851


When your powerlevel is over 9000, you won't even use visual mode or macros anymore. They are the "intermediate tools". But they are already pretty powerfull.

Basically you learn Vim like C:
1. Get the basics
2. Apply what you have learnt until you can use it fluently.
3. Investigate some fancy new ideas/functions, choose what works for YOU.
4. Goto "2."
>>
>>56630087
why are you making you're life harder?

if its for educational purposes i guess you would learn how the code compiles but other than that, why wouldn't you just use an IDE ?

are you trying to be edgy?
>>
>>56630112
No I just really like things like sublime text. What should I use for linux then?
>>
>>56630132
Vim, just map 'make' or 'gcc -Wall ...etc %' to a key like F5 and you should be fine.
>>
>>56630132
>muh linux
you're trying too hard
>>
>>56630132
Notepad++
>>
>>56629329
Oh, well where would I find someone to do that?

>What exactly are you trying to do? Why are you trying to "crack" this program?
The price is a rip off, I paid for it for a few months and then got scammed by the owner, there is not really an alternative and I got used to using it

>Even if you did see the code, whatever the authentication method may be could rely on server communication, which would be very difficult to work around unless they wrote it very poorly.
I would be willing to pay more if it was that difficult obv.
>>
>>56630146
how is this better than mapping 'run' to a key like F6 in an IDE?
>>
>>56630164
It's not. What's your point?
>>
>>56629942

Here:

>http://vimcasts.org/episodes/archive/
>>
>>56630112
>>56630132
dont get caught up with this nonsense.
I suggest you first learn how to get shit done and then worry about this trivial ricing edgy shit.

>>56630146
this is not me.
>>
>>56630112
>straight editor+terminal is now edgy

has /dpt/ gone downhill or is this guy an outliar?
>>
new thread when ? :3
>>
>>56630197
If you have to ask like OP, then yeah its considered edgy cuz youre trying too hard
>>
>>56630231
Trying too hard at what?
>>
>>56630239
OP + linux + makefiles
yet he has to ask how do i ....
>>
>>56630087

gcc --help

Or
man gcc


Seriously, it's not that hard to learn a command line tool.
>>
>>56630270
Have you ever met someone having the know how about that stuff just after being born?
Are you retarded?
Why are linux and makefils tryhard?
Are you some kind of refugee from the web dev general?
>>
>>56630301
I guarantee there is a higher percentage of linux users in /wdg/.

Web servers are literally where linux shines.
>>
>>56630087
Just use QT creator, it's a pretty decent ide with a way to enable vim-like keybindings. It also creates qmake files.
>>
>>56630301
> Why are linux and makefils tryhard?
I just told you why, are you fucking autistic?
In OPs context, YES its considered EDGY.

shit man I know most of us have aspergers in this profession but holy shit try not to reinforce the stereotype.
>>
File: sides.jpg (92KB, 360x240px) Image search: [Google]
sides.jpg
92KB, 360x240px
>>56630301

>Are you some kind of refugee from the web dev general?
>>
>>56630339
You don't make any fucking sense, ill go back to whatever i was doing.
>>
>>56630373
you tried.
>>
>>56630301
linux with straight text editors in the terminal is for super leet haxorz, if you have to ask to get spoonfed instead of figuring things out by yourself and with google you're obviously not leet enough
>>
File: Capture.png (19KB, 1166x156px) Image search: [Google]
Capture.png
19KB, 1166x156px
>>56629363
I just realised something I really should have asked because you're probably asleep.
The OpenGL tutorial I'm using tells me to do this to access OpenGL, and this function contains glfwGetProcAddress.

Does it replace any of the code in that link?

Also, I don't understand all the address fetchings in that code. They all require a name, which I do not know.

I also don't know if loading the library opengl32.dll is something I should have to alter for 32 bit and 64 bit machines.
>>
Actually I'll just go with GLEW I guess because I'm a newb.
Unfortunately, I'm so much of a newb that I don't know why CodeBlocks can't see glew.h.

glfw.h, which can be seen, is in CodeBlocks/GLFW/include/GL/glfw.h
GLEW cannot, and it is in CodeBlocks/GLEW/include/GL/glew.h

I guess I could just put it in the same folder as glfw.h but that seems like bad management.
>>
i dont java very often

is there a better way to take in 2 user inputs without using 2 buffered readers? in c++ i would just use fputs or something which i think looks a lot cleaner

        BufferedReader IPFromUser = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter an IP: ");
String IP = IPFromUser.readLine();

BufferedReader PortFromUser = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter an port: ");
int Port = Integer.parseInt(PortFromUser.readLine());

>>
NEW THREAD:

>>56630658

>>56630658

>>56630658
>>
>>56630644
can you read from the same one twice?
>>
>>56630644
buffered readers are reusable
>>
>>56624762
A functor is a type constructor f which takes a type a and returns a type f(a), and has a higher-order-function fmap which allows you to translate a function from a to b to a function of type f(a) to f(b).

Lists are a great example. For any concrete type such as int or float, you can also define a list of ints or floats. In that case, fmap takes a function (say, foo) from ints to floats and returns a function fmap(foo) from lists of ints to lists of floats. What fmap(foo) does in that case is just to apply foo to every element of the list you feed it.

A monad is a functor f, along with two extra functions called pure and join, which allow you to convert a variable of type a to a variable of type f(a), and of type f(f(a)) to f(a), respectively.

Now, properly grokking monads can take a few days since it is usually a new concept that has to sink in, but if say, you were able to learn what objects, classes, and inheritance are, you should easily be able to grok what a monad is in a similar or smaller amount of time.
Thread posts: 321
Thread images: 37


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