[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 21
File: DPT.png (389 KB, 934x1000) Image search: [Google]
DPT.png
389 KB, 934x1000
Old thread: >>55459573

What are you working on /g/?
>>
working on first post
>>
working on freaking about because i don't know what to do next. should i program, should i read, should i sleep or should i jack off? i've been stroking my peepee for like an hour
>>
File: Programming Shelves.png (952 KB, 2100x1400) Image search: [Google]
Programming Shelves.png
952 KB, 2100x1400
Explain arrows (category/haskell) to me /dpt/

>>55468148
masturbation is a sin
>>
>>55468148
watch animemes

ultimate neet life is program anime and fap
>>
>>55468132
Finally learning C with K&R. I have no idea why I'm doing it however, I don't have any plans to use C.
>>
4th for Elm
>>
>>55468148

All of them at the same time.
>>
>>55468171
arrow is a bloated abstraction that requires too many things of its instances

But you can use this cute quasiquoter as arrow syntax https://scrambledeggsontoast.github.io/2014/09/28/needle-announce/
>>
>>55468207
>hopefully this is a lot clearer
>>
>>55468157
>Is this like a more refined version of the IO type in Haskell, and/or the free monad over coproducts of effect DSLs?
that's kind of one of the goals eventually, but the idea behind this is encoding the behavior of lots of different types (not necessarily IO). for example, you can describe something similar to the State monad with a behavioural type:
μa.{read:a, write:a} is State that can be written to/read from an infinite number of times, but
μa.{write:a, read:ε} can be written to repeatedly but once it's been read you can't use it anymore (which lets you implement shit like linear type systems). you can also trivially formulate types like "this reference must be altered before being read again", etc.
another useful example i saw is behavioural file descriptors.
i haven't really experimented with doing an actual effect system in terms of behavioural types but it's an idea that's been tossed around in some papers and it seems only a step away from being part of an effect system.
>>
Iċ bidde ēow notaþ Haskell.
>>
>>55468337
ic biddie to you too my friend
>>
>>55468320
look at Idris
>>
>>55468346
Hwæt?
>>
Hey /dpt/! I always forget which 4chan boards are which, so I wrote a C program that gives you the description of a board passed as an argument. Here it is: (1/2)

#define _(__, ___) case __: s=___;break;
#define c(h,_a,n) if(1[a][0] == h && 1[a][2] == _a){s=n;goto t;}
#define j(x) printf("%c", x);
#define print char *d = "Ermqi$*$Qerke\0Verhsq\0Ermqi3Gyxi\0Lirxem3Epxivrexmzi\
\0Igglm\0Jpewl\0Xiglrspsk}\0Lirxem\0Sioeom\0\0[ietsrw\0\0Qigle\0Xverwtsvxexmsr\
\0Xverwtsvxexmsr\0Tlsxs", *e = "\0Ehypx$Viuyiwxw\0Wi|}$Fieyxmj\
yp$[sqir\0Xsvvirxw\0]yvm\0Zmhis$Keqiw\0Ermqi3[epptetivw\0Teversvqep\0]esm\0\0"\
,*o= "\0\xE\x15 39?JQXYabhw|", *p= "\0\1\x10%.3?P[`a", *f =
#define ___(_) ;if(strlen(a[1])==1 && *a[1]!='3'){if(*a[1] > 0160){ t(e +(p+(\
*a[1]-113))[0]);j(0xA);}else{t(d+(o+(*a[1]-97))[0]+ z) ; j (012 ) ; } } else{\
char *s;c('m','p',"Tsr}") c('p','l',"Tspmxmgepp}$Mrgsvvigx") switch( x(a[1]))\
{_}t:t(s);j(10);}}}
t(char *p){int i;for(i=0;i<strlen(p);i++){j(p[i] - 4);}}int count;
char x(char *p){int i;char r=p[0];for(i=1;i<strlen(p);i++){r^=p[i];} return r;}
main(int b, char **a){if(b != 2){t("Yweki$1$");printf("%s", a[0]);
t("$_fsevha$1$hiwgvmfiw$8gler$fsevh2\xE");}else{int z=(*a[1]==0160)?10:0;


print "Hello World!"



https://ghostbin.com/paste/g7cxm
>>
(2/2) let me know if this utility is helpful to you! :)

___(
_(0x11,"Zmhis$Keqi$Kirivepw") _(0x63,"[svoweji$KMJ") _(0xc,"Gsqmgw$*$Gevxssrw")
_(0x2,"Xipizmwmsr$*$Jmpq") _(0x34,"Wlmx$8gler$We}w") _(0xa,"Evx{svo3Gvmxmuyi")
_(0x13,"Xvehmxmsrep$Keqiw") _(0x74,"Hs$Mx$]syvwipj") _(0x6d,"Ehypx$Gevxssrw")
_(0x10,"[epptetivw3Kirivep") _(0x8,"Jssh$*$Gssomrk") _(0x79,"Wgmirgi$*$Qexl")
_(0x72,"Lmwxsv}$*$Lyqermxmiw") _(0x4,"Vixvs$Keqiw")/*p*/_(0x5,"Lerhwsqi$Qir")
_(0x1f,"Tetivgvejx$*$Svmkeqm")/*g*/_(0x6e, "Syxhssvw")/*yt*/_(0x20,"VSFSX=445")
_(0x73,/*mo*/(*a[1]==0141)?"Ehzmgi":"Mrxivrexmsrep")/*honis*/_(0xe,"Gyxi3Qepi")
_(0x3,/*oty*/(*a[1]==0163)?"Wtsvxw":"Kvetlmg$Hiwmkr")/*ameme*/_(0x7b,"Jmxriww")
_(0x62,/*ki*/(*a[1]==0141)?"Epxivrexmzi$Wtsvxw":"Xs}w")/*lan*/_(0xb,"Levhgsvi")
_(0x68,/*ns*/(*a[1]==0147)?"Ehypx$KMJ":"Gswtpe}$*$IKP")/*guag*/_(0x70,"Xvezip")
_(0x76,/*is*/(*a[1]==0161)?"Uyiwxw" : "[svoweji$Viuyiwxw")/*e*/_(0x7,"Jewlmsr")
_(0xf,/*1qt*/(*a[1]==0141)?"Ermqepw$*$Rexyvi":"Gyvvirx$Ri{w") _(0x18,"Qywmg")
_(0x1a,/*3.*/(*a[1]==0147)?"Lmkl$Viwspyxmsr":"Sxeoy$Gypxyvi")/**/_(0x1d,"PKFX")
_(0x71,/*14*/(*a[1]==0142)?"Fywmriww$*$Jmrergi":"Pmxivexyvi") _(0x33,"7HGK"))


https://ghostbin.com/paste/g7cxm
>>
>>55468364
i've used Idris before a bit, but it doesn't really have the features I'm looking for here (plus it's really buggy). i was thinking of using Agda or Coq to start out with, but the main goal here is to perform compile-time optimizations based on this (it seems possible to do some JIT-style profiling statically and find hot paths before the program is run based on static behaviors) and to do that I really need my own language to work with.
>>
>>55468337
>>55468346
>>55468373
what language is this?
>>
>>55468148
Did you snort adderall or something?
>>
>>55468458
Old English. something like "please (you all) use Haskell" i guess
>>
>ywn program this bot
https://twitter.com/_rapcandy
>>
>>55468457
Oh, is Idris buggy? That's a shame, I was thinking of trying it out.
>>
>>55468320
Oh - that sounds really powerful! So you could enforce that file handles are never used again after being closed, and things like that? I imagine that sort of information could also be used to help the GC.
>>
>>55468380
i'm kinda curious but i don't feel like setting up a vm and i don't have one with a linux arch around to copy
>>
contemplating whether the remainder of my life is worth living and also working on an expired contest problem.

Are contests and challenges worth it for learning purposes? If your education and experience is not in programming, does it look good to put challenge bullshit on GitHub and link it on your resume to display some kind of proficiency? Or is it radioactive autism?
>>
Studying for interview real soon. Wish me luck!
>>
File: screensh.png (165 KB, 753x989) Image search: [Google]
screensh.png
165 KB, 753x989
>>55468589
>>55468396
>>55468380

Here's the output
>>
>>55468592
Challenges are nice to train, but I think employeers would like more a working project(s) instead a bunch of those challenges.

>>55468609
/g/luck!
>>
>>55468592
If I were interviewing you, I'd want some indication that you can program.
>>
>>55468613
Well shit.

Why is it so obfuscated?
>>
>>55468613
what did u program that for you maniac
>>55468609
what do u think they're going to ask u
>>
>>55468548
it's a good experience to use, but there's still a lot of bugs (https://github.com/idris-lang/Idris-dev/issues). i'd say to give it a try because i think it does do a lot of things nicer than Haskell, but it's also very clearly incomplete (and im not really sure there are any plans to ever actually complete it). but i wouldn't write real code with it because there's just so much missing and so many bugs to work around
>>55468572
yeah, it's quite cool and I'm surprised it's yet to be explored thoroughly, really. here's a cool example for dealing with file handles like that: https://github.com/kayceesrk/code-snippets/blob/master/behavior.ml#L111-L161. anyways, i think it might be possible to incorporate some of Rust's lifetime system into this in order to fully verify a linear reference type (which would mean you could eliminate the garbage collection entirely) but that seems like a lot of work. for now, my goal for optimizations is mostly analyzing the types (so an unbounded recursion for a certain behaviour would mean that most likely executes more than something that's bounded) and trying to optimize based on what's more common (like JITs). admittedly I don't know very much about those kinds of optimizations so i'm not sure how well i'll be able to implement any of that.
>>
>>55468632
Why not?

>>55468633
To see if I could, anon. I really hope someone else has the balls to compile it, it really does work with every board.
>>
When do I use references in C++?

Shit's confusing
>>
>>55468619
Thanks! final round so I'm nervous.

>>55468633
Not sure. I'm reviewing up on DP, trees, and graphs. If they ask me about systems I'll be on /g/ really quick for a really long time.
>>
>>55468677
A reference is like a pointer that can't be null
>>
>>55468699
Like when do I return references to things and use them as argueents rather than just straight up declaring everything in a straightforward manner
>>
>>55468730
>return references
Only do this for a member method or a global

>arguments
When you want to avoid copying, either mutably (T&) or immutability (const T&)
>>
>>55468750
*immutably
>>
>>55468750
(and not all member methods should return references)
>>
>>55468681
do interviewers usually ask about data structures like that? i'm thinking most programming jobs don't need them. although if i was an employer i wouldn't want someone who can't do bfs around. i don't know how to do bfs i don't know if i ever did
>>
>>55468619
I only have one project on there from school. I have another that is a bit closer to my heart and don't know if i want it hosted on GitHub. It's a text-based adventure written in R. I feel like posting the process of making it would kind of ruin it, especially since I'm learning and might make fundamental changes to how it works anyway.

As far as training I have definitely learned a lot through challenges.

>>55468621
what if it's not the principal duty for the position? Like "programming experience is a plus" in the job description? I want to think that posting R scripts for silly challenges will at least beat out the kids that say they know R on their resumes but only know how to run a linear model function.
>>
>>55468793
trees, graphs, dictionaries, and linked lists
are evidence of knowledge, without which a programmer invites horror and despair into the world
https://www.daniweb.com/software-development/cpp/threads/440954/cant-fix-error-in-my-program
>>
File: 1404947307314.jpg (134 KB, 1280x720) Image search: [Google]
1404947307314.jpg
134 KB, 1280x720
>>55468876
>
// new averaging system
float pp;
float x;
float xx;
float xxx;
float xxxx;
float xxxxx;
float xxxxxx;
float xxxxxxx;
float xxxxxxxx;
float xxxxxxxxx;
float xxxxxxxxxx;
float xxxxxxxxxxx;
float xxxxxxxxxxxx;
float xxxxxxxxxxxxx;
float xxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxxx;

Every time.
>>
>>55468750
So why should I return for example &<vector><string> rather than just the <vector><string>
>>
>>55468876
>>55468930
Do you think this was done on purpose?
>>
>>55468949
generally you shouldn't return references outside of references to members during a member method
>>
>>55468793
80-90% time yes. Some companies will ask scalability and systems questions or pair programming.
>>
File: invaders.webm (376 KB, 888x440) Image search: [Google]
invaders.webm
376 KB, 888x440
I wanted this to use a variety of invaders and it became a disgusting mess so I left it with one invader
>>
Rate
int factorial(int n) 
{
int a = n;
int b = a - 1;
for (int i = 0; i < n; i++) {
a = a * b;
if (b > 1)
b--;
}
return a;
}
>>
>>55469089
Doesn't work for factorial(0)
>>
>>55469089
>Not recursive
>>
>>55469118
It is though
Uses goto to recur
>>
Hey I know this is "what you are working on" thread, but I would really really like to learn Python, but I am an utter and complete beginner when it comes to programming. I just briefly studied javascript and java and some html. I understand what an algorithm is, and what functions and variables are and how they play out in a code, but thats really the extent of my knowledge. Any good resource suggestions for learning Python for extreme beginners? Learning the fundamentals and working from the ground up? Thanks appreciate it.
>>
>>55469171
Python is trash, don't learn it
>>
>>55469171
>utter and complete beginner when it comes to programming
Python is good to get started, but moving to faster languages like C or C++ might be a problem with how Python does almost everything on its own. For utter beginners, I don't have much help. Maybe pic up Zelle's Python book that has an introduction to computer science. I started with C++ and am happy for it since moving to other languages at first was easy. Really, if you master any language, then it's very likely you'll be able to pick up another quickly.
>>
>>55469171

https://docs.python.org/3/

The python docs are very good, easy to read, and have a good tutorial

http://learnpythonthehardway.org/book/

Probably gonna get shit for suggesting that but it's not terrible especially for someone who is brand new

The author is pretty self-righteous and a little abrasive in regards to his ideas on programming. Try to separate his nonsense from the lessons.
>>
>>55469099
good point tbqh. Fixed pretty easily though.
>>
okay dumb question

I know for a fact that python has ciphers already included into the syntax but I can't find any info in the documentation, any help would be appreciated.
>>
>>55469154
W-wait, it is recursive? I'm the fag who wrote the program and I honestly can't wrap my head around recursion yet.
>>
>>55469241
I guess that was more of a request than a question.
>>
>>55469248
Not in the traditional sense
>>
File: py.jpg (68 KB, 555x305) Image search: [Google]
py.jpg
68 KB, 555x305
Hey /g/,

I'm tutoring a kid in Python and he'd like to create a game.
Something like a 2-D game.
Any Suggestions on libraries?
>>
>>55469287
boost
>>
>>55469227
Yes I've heard Python is an easy language to learn initially. I don't intend on learning this as a job skill, just general knowledge and hobby. I'm very interested in creating plugins for a particular video game and noticed that Python is a supported language for it. Programming something that interests me and I find fun seems the best way to learn the language.
>>55469229
Thank you very much.
>>
>>55469309
That other anon is right on the docs, but for fuck's sake don't pick up that horrible book. It's disgusting.
>>
>>55469229
>>55469309
>Learn Python the Hard Way
>Anything by that hack, Zed Shaw
Don't even post that shit is jest.
>>
>>55469118
>implying this isn't more efficient
>>
>>55469406
>is
in*
>>
I hope when summer's over all the snekfags leave
>>
>>55469331
May I ask what's wrong with it? Or a good alternative?
>>
>>55469171
Derek Banas' new How to Program series with Python is pretty good.

https://www.youtube.com/playlist?list=PLGLfVvz_LVvTn3cK5e6LjhgGiSeVlIRwt

Also the book "Automate the boring stuff with Python" and its accompanying videos are nice as well.
>>
>>55469554
Going to check that out immediately.
I'm going through the Python docs, but they're as dry as sandpaper. They also seem to suggest some previous programming knowledge going into it. But I will continue reading on of course.
Thanks again to everyone for the suggestions/recommendations.
>>
>>55469431
hercules beetles represent
>>
>>55469287

Pygame.

>>55469299

Boost is C++ and doesn't even do graphics. If you want 2D shit in C++ you use SFML or SDL.
>>
File: file.png (305 B, 210x30) Image search: [Google]
file.png
305 B, 210x30
/g/ this is driving me insane, I’ve been trying to get this right for an hour

The red and green boxes are right-aligned spans as big as their contents in the blue right-aligned span as large as the two spans combined, plus padding. The two red/green spans, together, should not exceed a certain width. If they do, the text inside them should be truncated with ellipses. Under no circumstances should one box appear under the other

How the fuck do I do this? I’ve googled my ass off, tried a hundred solutions, and I just can’t get it to work.

The closest I’ve gotten, the two spans truncate properly, but the blue span/div is much wider than its contents no matter what I do.
>>
File: QUgtRuw.png (273 KB, 540x363) Image search: [Google]
QUgtRuw.png
273 KB, 540x363
/dpt/

I'm a C++ fag that doesn't know anything about Java but I need to use it for some stuff.

Is there something thats the same as a std::vector that works on primitive types in Java? Like, from what I understand I can do this:

ArrayList<Byte>

but not this:

ArrayList<byte>

And a 'byte' is just one byte whereas a 'Byte' is an actual object and who knows how big that will be (1 byte + java object ref stuff idunno)

I mean I just want a dynamically resizeable array with primitive types.
>>
>>55469844
there are no primitive types in java
>>
>>55469844
I'm not sure, but I think the primitive wrappers in Java have unique instances? If it's true then each one will be pointer size and you won't be paying for more than one actual object in memory use
>>
>>55469760
I was joking you fucking tripcode using twat
>>
>>55469875
thats absurd though because a pointer will be 8 times the size of a single byte

>>55469866
so what happens when I do
public void Hello(int x)
{
Log.v("",x+5);
}
>>
>>55469866
yes there are
>>
>>55469897
I think there is a type for vectors of bytes, dunno though
>>
>>55468171
'Arrows' is another name for the morphisms of a category.
>>
>>55468171
>if it's not hard, it's bad!
>>
Do OpenGL textures have to be bound to a texture unit?
Am I able to upload all my textures just once and then bind them to texture units as I need them?
>>
>>55467987
I'm not sure if you're still here 5 hours later but:
The problem with curried value constructors is that they are functions, and matching functions means obtaining some notion of "function equality", which can be extremely vague if not undecidable.
You run into problems such as
data AB = A Int | B Int

--# matching against constructors
thing :: (Int -> AB) -> Int
thing A = 1
thing B = 2
thing _ = 3

--# sometimes it's easy to handle
let f = A in thing f --> 1
let g x = A (x + 1) in thing g --> 3

--# sometimes it's not
let f x = A x in thing f --> 3? even though f is (eta) equivalent to A
let g x = if True then A x else B x in thing g --> what do? we could simplify but...
let h x = h x in thing h --> shit!


At the end of the day, it's usually not worth it to allow curried value constructor matching; the use-cases are extremely rare and could likely be redesigned.
e.g. the following works just as well without turning pattern matching into a shit-show.
data ABCtor = ACtor | BCtor | Other (Int -> AB)

getCtor :: ABCtor -> (Int -> AB)
getCtor ACtor = A
getCtor BCtor = B
getCTor (Other f) = f
>>
Travis-CI is pretty damn slow. What can I do to speed it up?

There doesn't seem to be a way to cache the packages I need.
>>
>>55470123
Which of those languages are hard, anon?
>>
>>55468380
Here
#!/bin/bash
curl --silent "http://www.4chan.org/" | grep -Eo 'org/$1/".*title=".*"' | sed -E 's/^.*title="(.*)"/\1/'
>>
File: wat.png (664 KB, 1920x1080) Image search: [Google]
wat.png
664 KB, 1920x1080
Well this is an inconsistent error...
>>
>>55471121

Okay, so... I remove this from the constructor:
std::cout << "start constructor" << std::endl;
if (!splash_texture.loadFromFile(SPLASH_IMAGE))
throw std::runtime_error("could not load splash image");
std::cout << "splash texture loaded" << std::endl;
splash_sprite.setTexture(splash_texture);
std::cout << "splash texture set" << std::endl;


And this from the update method:

win.draw(splash_sprite);


And it will draw the window properly, but without showing the image. Until I close the window, and then it will core dump again.

Is this a bug in my program or SFML?
>>
And now the bug isn't occurring at all after reseting my code to the initial conditions that caused the bug!

What the hell!
>>
>>55471121
>>55471170
>>55471202
No one fucking cares.
>>
>>55471269

I don't care that you don't care, Anon. It is my right to shitpost all over /g/ and use DPT as my blog to talk about weird shit like malloc failing somewhere in the middle of libsfml. Go cry somewhere else.
>>
Chip8 emulator in rust project is pretty completed.

I'm trying to decide on the next project.
>>
>>55471360

Compiler for a higher level language to Chip8.
>>
>>55471402

-_- Basically doing the same thing I did for the emulator but in reverse with parsing / tokenization added to it?

It couldn't be anything complex. Maybe a small lisp / pascal / basic style with few features. The memory restrictions on a chip 8 are pretty tight (4 kilobytes of ram with 512 reserved for the interpreter).
>>
>>55471448

C compilers have been made for even tighter restrictions. Arduino only has 2 KB of RAM... although that didn't include the space for the program ROM.
>>
>>55471499

Just not feeling it. A compiler project that outputs chip8 virtual machine code just doesn't seem interesting at this point.

It'd also take forever considering I'm only putting aside around 15 minutes to 30 minutes a day to work on the project.

I'd have to start with a chip8 assembler (easy) then the compiler (Optimizing / painful) for the high level language, and a linker of some sort.

Was hoping for a small project to get more comfortable with the language (1,000 to 2,000 lines of code or so at most).
>>
>>55468132
I've made a portable Quick-Launch toolbar for Windows 7
Now I no longer have to click 100 times to restore my Quick-Launch toolbars after reinstalling Windows and the icons no longer magically rearrange themselves
>>
>>55471621

Understandable. Compilers are not exactly the easiest of projects. 1k to 2k lines of Rust...

How about a Tetris game with Rust-SDL2?
>>
>>55471820

Hmm, that's a pretty good line of thinking perhaps a small game.

I've been looking at nphysics for a while now (https://github.com/sebcrozet/nphysics).

Thanks you've given a possible route / idea for the next project.
>>
>>55471890

Sounds fun. Enjoy, Anon.
>>
Anyone have experience with the new-ish Haskell sdl2 library? If so how is it?
>>
>>55471890
Make a random level generator for Wolfenstein, or if you're really ambitious; Doom.
>>
>>55472051

Honestly, I wasn't that big of a Wolfenstein / Doom fan.
>>
>>55471302
>>>/soc/
>>>/facebook/
>>>/tumblr/
>>
File: aaazzz.png (43 KB, 1044x336) Image search: [Google]
aaazzz.png
43 KB, 1044x336
How should I structure my search/API?

I'm thinking for the search on the website itself, it should only use parameters in the input box like:
>Nichijou 01 width:720 audio_language:jp subtitle_language:en
So no other input/radio/checkbox/dropdowns, just a the single input.

And for the API it should be
>/api/?query=Nichijou 01&width=720&audio_language=jp&subtitle_language=en

Also, one of the pieces of software that use my API uses
/api?q=...
which then resolves to
/api/?q=...

Is it worth opening an issue on Github? It seems like its doubling the number of requests
>>
>>55472158

/soc/ is gross, and I don't have a Facebook or Tumblr account. 4chan is pretty much the only social media I use. I've been on this site since 2006, so unless you've been here for longer, get the fuck off my lawn, cunt.
>>
>>55472188
how do you keep up with friends?
>>
File: 1465793495393 (1).jpg (20 KB, 377x331) Image search: [Google]
1465793495393 (1).jpg
20 KB, 377x331
>>55472188
>4chan
>social media
>>
File: ruby browny.png (47 KB, 955x497) Image search: [Google]
ruby browny.png
47 KB, 955x497
>>55472239
He doesn't have any friends, that's why he's a tripfag
>>
>>55472188
No one cares, tripfag. 4chan is not your social media.
>>
>>55472178

>So no other input/radio/checkbox/dropdowns, just a the single input.

i would personally much prefer some kind of 'advanced search' option that brings up checkboxes and additional input fields so that i am not forced to remember identifiers like audio_language or subtitle_language

but then again, if i really cared for specific searches i would probably remember that shit
>>
Does this guy using returns bother anyone else?

https://www.youtube.com/watch?v=7D9GE3-o54o
>>
>>55472239

Skype, Steam, SMS, and good old regular phone calls.

>>55472256

We mainstream now. Sadly.

>>55472266

Nah, I have real friends. My friends don't judge the fact that I have a $300 commissioned plushie of a background pony.

>>55472270

You seem mad.
>>
bitches aint sh*t
>>
>>55468876
i don't know that doesn't sound useful. i can imagine a mathematician being really good with that stuff (say, some graphs specialist that learned a bit a about hash functions and pointers) but being bad writing code in general. i think asking stuff about software engineering or best programming practices would be better
>>
>>55472555
unless of course, it's a company that's building data structures from scratch or uses trees and graphs a lot otherwise, but i think that's not the case most times
>>
Prelude is shit
>>
File: 234234.png (2 KB, 81x45) Image search: [Google]
234234.png
2 KB, 81x45
which law allow me to do this?
>>
>>55472602
What does the _ mean
What's the rest of the expression?
>>
>>55470123
This picture looks a bit biased towards Python but it's perfectly valid, if you're doing something very simple (e.g. putting up a shelf or making a small/simple project), then something like choosing python over C is a no-brainer. It doesn't imply that other languages are bad.
>>
>>55472367
>Skype, Steam, SMS, and good old regular phone calls.
Fucking normie

>not irc
>not mail
>>
>>55472629
It's B*C + ~C, the result is B + ~C
>>
>>55470426
I haven't touched OpenGL in years but I'm pretty sure this is correct, you usually have a very small number of texture units avaliable anyway
>>
>>55472709
i think i fuckd up somwehre

BC+~C = ~(~B+~C)+~C=(~B+~C)C=(~B)C+(~C)C=(~B)C=~(B+~C)

what. i don't do this stuff since like 4 years ago
>>
>>55472602
Distributivity.
I've notices that you've asked a few Boolean logic questions on here lately. Why don't you do your own CS or EE homework?
>>
>>55472752
no of course. fucked up slightly, it's okay

BC+~C = ~(~B+~C)+~C=~((~B+~C)C)=~((~B)C+(~C)C)=~((~B)C)=~(~(B+~C))=B+~C
>>
>>55472666

I use IRC with some online friends, but none of my normie friends use it. I tried to introduce some people in another thread I hang out to to IRC, but they appear to be retarded and can't understand how to work a fucking IRC client.
>>
>>55472785
Talk about taking the long way.
B.C + ~C
(B + ~C).(C + ~C)
(B + ~C).1
B + ~C
>>
what mingw to use in Windows?
>>
>>55472555
What?
Those are some of the most useful data structures? Sure some interview problems are trivial, but they're about finding an optimal solution. Like in general programming itself.
>>
>>55468132
>can't connect to Shodan.me
Suffering
>>
>>55472804
i dont know how you went from 1 to 2 but fuck you anyway
>>
>>55472862
AND distributes over OR, just like multiplication distributes over addition
2.(3 + 4) = 2.3 + 2.4

A.(B + C) = A.B + A.C

The slightly unintuitive thing is that OR also distributes over AND, which isn't the case for addition over multiplication
A + B.C = (A + B).(A + C)


Did they really not teach you this shit?
>>
Please tell me if I understand this correctly. I'm learning signal analysis.

So an FFT returns a signal split to components.
So if I want to make a filter with FFT I just discard some of the components and add them together to get a filtered signal?
>>
>>55472904
>them
I meant >the rest
>>
>>55472897
they did, a long time ago. i don't do boolean algebra since 2009 or so. fuck you
>>55472823
sure, but i don't think it'd be good for a company to reject someone because they can't balance a tree on command, unless they actually need people balancing trees
>>
>>55472897
>they both distribute over each other
beautiful
>>
>>55472923
That's a simple function. If they can't do that, what /can/ they do?
Obviously I'm talking from the viewpoint the person has little/no experience.
>>
>>55472923
>fuck you
Why are you getting so defensive?
How the hell am I supposed to know that you're shit?
>>
>>55472804
thanks, that's the answer
>>
>>55472953
no you are shit
>>
Why is my globalvariable set to my default value in the new block?

http://paste.debian.net/779549/
>>
Gentoo in Docker as a build environment for C++ — good idea/bad idea?

In the end I need to build/run on Ubuntu but I don't want to go through extra mile of adding new packages to Ubuntu. Right now I'm using bash scripts to download and build dependencies but it feels hacky and has heavy impact on build times in CI.
>>
>>55473243
Actually, nevermind, dockerized Gentoo images most likely will be HUGE. I'll probably should just manually pack deb packages or something.
>>
>>55472897

This is only reliable in some languages though if you're actually implementing it. You cannot reliably expect mathematical precedence unless it is specifically detailed and specified in the language standard.
>>
>>55468179
>Finally learning C with K&R
Is this the best resource for learning C?
Also, is it better to learn C before C++?
>>
>>55473811
It's a nice book to read for historical reasons, but it's slightly outdated.

If you're a beginner, it's easier to start with C, than diving straight into C++, but otherwise, no.
>>
I want to start daily reading about computer science and computers in general, looking for some book recommendations. The book i'm reading right now is some introduction to the theory of computation and CLRS.
>>
>>55473811
I keep recommending Stephen Prata to everyone though it might be not the best book if you're generally new to programming
>>
>>55472732
So basically I should just treat texture units like registers in a CPU?
>>
Teaching my wife's son's stepmom Python.
>>
Let's say I wanted to write an aimbot, which had to read a game's memory to work.
Wouldn't making it a driver make its probing invisible to most user-level programs?
>>
Hey All,

Tutoring someone in python and they'd like to build 2-D games.
Does anyone have a library they could suggest?
>>
Working on my xscreensaver replacement, just finished adding PAM support for authentication.

It's now officially a working screen saver and locker.

Now I just need to add DBus support for communication, and figure out how xscreensaver does timer resetting with `XSetScreenSaver`.

Then make the saver I'm going to use a little more fancy.

Then make a saver that wraps xscreensaver hacks.

Then make a dialog helper library to implement a password dialog easily in savers using the Rust API.
>>
>>55474306
yes
>>
How can I compose functions in C?
>>
File: udNsWyq.jpg (675 KB, 2400x1800) Image search: [Google]
udNsWyq.jpg
675 KB, 2400x1800
>>55474496
c doesn't have functions, only procedures.
>>
File: 11220237-large.jpg (14 KB, 380x256) Image search: [Google]
11220237-large.jpg
14 KB, 380x256
About to take a DINNER BREAK after a long, satisfying day of coding.

Recommend me some VIDEOS to watch. Preferably related to programming one way or the other.
>>
>>55474496
>>55474524
Typed procedures are called functions.
>>
>>55474496
You can't
>>
>>55474250
Yes, you can render whole scene using only one texture unit, just re-binding textures as you need them. Texture IDs should be persistent.
>>
I've been having trouble with this part of my assignment. I have most of it coded but I have been having trouble implementing this last part:

Write a loop that simulates checkouts and checkins for a 3 month period. Every day iterate over the catalog, and every person in the patrons array. If the patron currently has the book checked out then check it in. If it is not checked out then add it to the patrons list of books via the patrons read method. If the book is overdue then add a fine of $5.00 to the patron returning it. At the end of the 3 month period, display each patron, the books they have currently checked out and any fine they may have.

Here is the code I have so far:

//Author class
var Author = function(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
};

var Book = function(title, Available, publicationDate, checkoutDate, callNumber, Authors) {
this.title = title;
this.Available = Available;
this.publicationDate = publicationDate;
this.checkoutDate = checkoutDate;
this.callNumber = callNumber;
this.Authors = Authors;
};

Book.prototype.checkOut = function(){
this.Available = false;
var temp = new Date(1000000000);
var d = new Date()-temp;
var res = new Date(d);
this.checkoutDate = res;
};

Book.prototype.isOverdue = function(){
//Get 1 day in milliseconds
var singleDay=1000*60*60*24;

var todayDate = new Date().getTime();
var difference = todayDate - this.checkoutDate.getTime();
if(Math.round(difference/singleDay) >= 14){
return true;
}
return false;
};


cont.
>>
>>55474610
var Patron = function(firstName, lastName, libraryCardNumber, booksOut, fine) {
this.firstName = firstName;
this.lastName = lastName;
this.libraryCardNumber = libraryCardNumber;
this.booksOut = booksOut;
this.fine = fine;
};

Patron.prototype.read = function(book){
this.booksOut.add(book);
}

Patron.prototype.read = function(book){
this.booksOut.remove(this.booksOut.length);
}

//creating author objects
var authors = []
authors[0] = new Author("Neil","Armstrong");
authors[1] = new Author("Hard","Popeye");

var mybooks = []
mybooks[0] = new Book('gravity',true,new Date(2000,5,20), new Date(), 10,authors);
mybooks[1] = new Book('munro',true,new Date(2000,5,20), new Date(), 11,authors);
mybooks[2] = new Book('kohli',true,new Date(2000,5,20), new Date(), 12,authors);
mybooks[3] = new Book('sachin',true,new Date(2000,5,20), new Date(), 13,authors);
mybooks[4] = new Book('sehwag',true,new Date(2000,5,20), new Date(), 14,authors);

var patrons = []
patrons[0] = new Patron('master','jumbo',1,mybooks,0.00);
patrons[1] = new Patron('kyle','munro',1,mybooks,0.00);
patrons[2] = new Patron('master','jumbo2',1,mybooks,0.00);
patrons[3] = new Patron('master','jumbo3',1,mybooks,0.00);
patrons[4] = new Patron('master','jumbo4',1,mybooks,0.00);

var j=0;
while(j < patrons.length){
var books = patrons[j].booksOut;
var fine = patrons[j].fine;
for(var i=0;i<books.length;i++){
if(books[i].isOverdue()){
fine = fine + 5.00;
}
}
patrons[j].fine = fine;
}
>>
>>55474534
Only Lisp derivatives and descendants like C (via BCPL) and ML do that.

Algol, PL/I, and Scheme always call them procedures. "Function" only means mathematical functions.

Functions in Fortran and Ada are expected to not have side effects. Pascal is supposed to be like that too (e.g. new is a procedure that takes a pointer as a parameter), but not everyone follows that rule.
>>
Is there any point in learning Rust as in to learn some better practices applicable in C++?
>>
starting uni this fall, is there a pastebin with a lot of programming information or some site that I can learn a lot from?
>>
File: 1443500977688.png (835 KB, 1200x1080) Image search: [Google]
1443500977688.png
835 KB, 1200x1080
>>55474534
not really, a function is actually a procedure which is declarative, only takes one argument, only returns one object, is a first class value (which allows the said composability), and doesn't have side effects when it's pure.
>>
>>55474598
Is there any performance hit with that?
>>
>>55474625
>>55474676
TIL. Thanks.
>>
>>55472346
Yes, it's not idiomatic.

He also could have just match on a tuple like this:

match (state, character) {
(MachineState::Normal, '#') => (None, MachineState::Comment),
(MachineState::Normal, '^') => (None, MachineState::Upper),
(MachineState::Normal, '_') => (None, MachineState::Lower),
(MachineState::Normal, c) => (Some(c), MachineState::Normal),
(MachineState::Comment, '#') => (None, MachineState::Normal),
(MachineState::Comment, _) => (None, MachineState::Comment),
(MachineState::Upper, '^') => (None, MachineState::Normal),
(MachineState::Upper, c) => (Some(c.to_ascii_uppercase()), MachineState::Upper),
(MachineState::Lower, '_') => (None, MachineState::Normal),
(MachineState::Lower, c) => (Some(c.to_ascii_lowercase()), MachineState::Lower),
}
>>
>>55472346
>>55474732

Even better would be to reexport the MachineState enumerations and make the inputs and outputs match, looks better this way:

use MachineState::*;
match (state, character) {
(Normal, '#') => (Comment, None),
(Normal, '^') => (Upper, None),
(Normal, '_') => (Lower, None),
(Normal, c ) => (Normal, Some(c)),
(Comment, '#') => (Normal, None),
(Comment, _ ) => (Comment, None),
(Upper, '^') => (Normal, None),
(Upper, c ) => (Upper, Some(c.to_ascii_uppercase())),
(Lower, '_') => (Normal, None),
(Lower, c ) => (Lower, Some(c.to_ascii_lowercase())),
}
>>
>>55474620
This is homework, isn't it?
>>
>>55474808
All I'm asking for is an output statement.
>>
uncurry (++) . partition (9 /=)
>>
If the difference between a function and a procedure is eminently important to you, then use Ada.
>>
>>55474821
But it's homework, isn't it?
>>
>>55474848
Yeah, so what?
>>
>>55474833
Often
Struggles
Getting
The
Point
>>
>>55474855
It's homework.
>>
>>55474879
Go fuck yourself. I've literally done every step except the last one.
>>
>>55474832
>push to back of list
but why
>>
>>55474691
I don't know, just do it the simple way and then run some tests. If you're doing something simple then it shouldn't be a bottleneck.

Obviously not calling glBindTexture means getting to draw call faster than when you re-bind texture beforehand, but then again, you usually have a very small amount of texture units and chances are that you can't push all your textures to texture units and never-ever rebind them.
>>
I want to learn more about how to structure applications. Do you guys have any good resources/literature?
>>
>>55474864

I get the point - mental masturbation. People are being pedantic.
>>
>>55474620
You need to add a parameter and use it to pass in the state of the universe.
>>
>>55474946
What level are you at? What is the scale of projects you have structured from scratch?
>>
>>55474946
That varies from language to language, from problem to problem. You need books on specific topics.
>>
>>55474952
Procedures can have side effects, functions are pure. I like pure functions. You can snap them together like Lego.
>>
>>55475011

I should have known functionalfags were behind this.
>>
>>55474895
A bird with a knife was threatening me.
>>
>>55475033
And you would have gotten away with it too, if it weren't for those pesky monads.
>>
>>55474946
Design Pattern maybe?
Friend strongly suggested it to me but I've not looked into it yet. He's used a text called Head first design pattern.
>>
>>55474676
>a procedure which is declarative
No, a "function" is some mapping f where
x = y ⇒ f(x) = f(y)
. It doesn't say how it is implemented or whether you use a "declarative" or COBOL or Java or whatever syntax. A procedure is some set of actions that can do things. One of these things can be computing a function. Functions can also describe the state transitions of a procedure.

>only takes one argument, only returns one object
People talk about two-argument and three-argument functions even if you prefer to think of them as one argument that's a tuple or something. If you want to say all functions take one argument that's can be a tuple, there is nothing else multiple arguments could mean.

>is a first class value
That's a made up CS buzzword.

>doesn't have side effects when it's pure.
The terms "side effect" and "pure" have no meaning for functions. "Side effect" is about implementation. "Pure" is ill-defined.

>>55475011
Those are all CS buzzwords. Haskell "functions" aren't any more like mathematical functions than C "functions", in case you're wondering.
>>
>>55475095
Spotted the self-taught programmer
>>
>>55475095
>Haskell "functions" aren't any more like mathematical functions than C "functions", in case you're wondering.
wtf
>>
>>55474393
bump
>>
Is there some definitive, universally recommended guide for learning how to make an android app? I'm going to start with that "Building your first app" guide from the android website but I'd like to know what /dpt/ knows
>>
Can someone explain who does this recursive function work?
its suppose to generate all permutations of a list. it was posted by someone here a few days ago
def all_permz(elementz):
if len(elementz) <=1:
yield elementz
else:
for perm in all_permz(elementz[1:]):
for i in range(len(elementz)):
yield perm[:i] + elementz[0:1] + perm[i:]

# testing
for i in all_permz([1,2,3]):
print i


Output
[1, 2, 3]
[2, 1, 3]
[2, 3, 1]
[1, 3, 2]
[3, 1, 2]
[3, 2, 1]
>>
>>55475250
The list of all permutations for an empty list is the empty list.

The list of all permutations for a singleton list is a list containing that singleton list.

The list of all permutations for a list containing at least 2 elements is: first get the list of all permutations for the list with the first element removed. Then for each of the permutations of the sub-list, insert the first element of the original list at each possible position in the permutation. Collect all these together into a single list.
>>
why is ruby like python except better?
>>
>>55475397
Hard to be worse than complete shit
>>
>>55475411
nice argument you got there faglord
>>
>>55475131
>>55475140
I want math words to mean what they do in mathematics.

You kids are too caught up on syntax. On /g/, you people "get triggered" and say loop syntax or goto makes something "less mathematical" than recursion syntax.

You confuse how people can describe actions to compute a function in a programming language with the function itself.
>>
>>55473028
pls help me
>>
Did this Tic-Tac-Toe in Python a while back. I know I could reuse code in the main function, but I'm lazy about that. Review it, /g/ :3! 1/3

# -*- coding: UTF-8 -*-
import random, os

def cls():
os.system('cls')

def draw_board(board):
print(' | |')
print(' %s | %s | %s') %(board[6], board[7], board[8])
print(' | |')
print('-----------')
print(' | |')
print(' %s | %s | %s') %(board[3], board[4], board[5])
print(' | |')
print('-----------')
print(' | |')
print(' %s | %s | %s') %(board[0], board[1], board[2])
print(' | |')

def choose_letter():
choice = ''
while not (choice == 'X' or choice == 'O'):
print '\n\nDo you want to be X or O?'
choice = raw_input().upper()
if choice == 'X':
return ('X', 'O')
else:
return ('O', 'X')

def who_starts():
if random.randint(0, 1) == 0:
return 'computer'
else:
return 'player'

def keep_playing():
print '\nDo you want to play again? (Y/N)'
choice = raw_input().upper()
return choice.startswith('Y')

def is_winner(board, letter):
winner = [letter] * 3
return ((board[:3] == winner) or (board[3:6] == winner) or (board[6:] == winner) or (board[:7:3] == winner) or (board[1:8:3] == winner) or (board[2::3] == winner) or (board[::4] == winner) or (board[2:7:2] == winner))

def is_space_free(board, move):
return board[move] == ' '

def get_player_move(board):
move = ''
while (move not in map(str, range(1,10)) or not is_space_free(board, int(move) - 1 )):
print '\nChoose your next move'
move = raw_input()
return(int(move) - 1)

def random_move_given_moves(board, moves):
possible_moves = []
for move in moves:
if is_space_free(board, move):
possible_moves.append(move)
if len(possible_moves) > 0:
return random.choice(possible_moves)
>>
>>55475641
2/3

def copy_board(board):
return board[:]

def is_board_full(board):
return ' ' not in board

def make_move(board, letter, move):
board[move] = letter

def get_computer_move(board, computer_letter):
if computer_letter == 'X':
player_letter = 'O'
else:
player_letter = 'X'

for letter in (computer_letter, player_letter):
for move in range(9):
copy = copy_board(board)
if is_space_free(copy, move):
make_move(copy, letter, move)
if is_winner(copy, letter):
return move

if is_space_free(board, 4):
return 4

corner_move = random_move_given_moves(board, (0, 2, 6, 8))
if corner_move != None:
return corner_move

return random_move_given_moves(board, (1, 3, 5, 7))
>>
>>55475512

computers r retarded anyway. what a fucking mistake.
>>
>>55475660
3/3

def main():
print 'Welcome to Tic Tac Toe!\n\nThe board works like the numpad of your keyboard:\n\n'
game_board = range(1,10)
draw_board(game_board)
while True:
game_board = [' '] * 9
player_letter, computer_letter = choose_letter()
turn = who_starts()
print 'The %s will start this round' %(turn)
game_is_playing = True
while game_is_playing == True:
if turn == 'player':
cls()
draw_board(game_board)
player_move = get_player_move(game_board)
make_move(game_board, player_letter, player_move)
if is_winner(game_board, player_letter):
cls()
print 'Congratulations, you have won the game!\n\n'
draw_board(game_board)
game_is_playing = False
elif is_board_full(game_board):
cls()
print 'this game is so cool haha nobody wins equality <3'
draw_board(game_board)
game_is_playing = False
else:
turn = 'computer'
else:
cls()
computer_move = get_computer_move(game_board, computer_letter)
make_move(game_board, computer_letter, computer_move)
if is_winner(game_board, computer_letter):
print 'You have lost a game against a fucking machine, stupid faggot.'
draw_board(game_board)
game_is_playing = False
elif is_board_full(game_board):
print 'this game is so cool haha nobody wins equality <3'
draw_board(game_board)
game_is_playing = False
else:
turn = 'player'
if keep_playing():
cls()
else:
break

main()
>>
>>55475641
>>55475660
>>55475679
Why do some people post their "code" in multiple posts instead of just putting it up on pastebin or something
>>
>>55475743
I did put in pastebin last thread, but nobody cares that much to open it.
>>
>>55475758
>nobody cares so i posted it again in a more obnoxious and spammy fashion
>>
Writing a 3d cheese pizza mmorpg in webgl
>>
>>55475743
>>55475758
It's still there, if you prefer. pastebin.com/fN6fqEGh

>>55475771
Don't be dumb, if I want people to see something I'll post it here, or less people will see. Think logically, please. Anyway, I won't discuss this with you, but I'll happily talk about my code - if you'd like.
>>
>>55475806
>>55475771
>>
>>55475758
I'm really sorry dude but then maybe then no one was interested in tic-tac-toe in Python in the first place. I wasn't interested and I am still not. Now I have to scroll more than one page to get to other posts.

Wanted a review? Ok. It's written in Python; ergo, it's shite.
>>
>>55475669
how many times a day do you think about killing yourself?
>>
>>55475144

Pygame
>>
I open a picture as a text file and then I print the contents.

How to make sense of the gibberish?
>>
>>55476204
POST THE FUCKING CODE AAAAAAAAA
>>
>>55476204
pictures arent meant to be read as text files
>>
>>55476204
What's the format?
>>
>>55476219
text = open('aah.jpg')
first_line = text.readline()
#is gibberish[/spoiler]
>>55476226
how would i open it if i didn't have libraries to do it for me
>>
>>55476229
mp4
>>
>>55476236
binary
>>
File: 1467131735909.gif (1 MB, 640x360) Image search: [Google]
1467131735909.gif
1 MB, 640x360
>>55476236
>python
>how would i open it if i didn't have libraries to do it for me
>>
>>55476250
using a c library isn't more difficult than using a python library just because you use pointers malloc and free
>>
>>55476240
thx
>>
>>55475895

Fewer times than you, to be sure.
>>
>>55476236

https://www.w3.org/Graphics/JPEG/itu-t81.pdf

Should be enough to get you started.
>>
/deadpt/
>>
File: 1441417429530.png (5 KB, 500x500) Image search: [Google]
1441417429530.png
5 KB, 500x500
>want to learn C# as my first programming language
>start reading a book
>realize how many pages there are
>it becomes incredibly boring very quickly
>just give up

Did you really read all of this?
>>
>>55477525
did you read the whole book on bicycling before you rode a bike? write (extremely) simple programs, learn what you need as you go. read the book after you decide you want to hone your skill.
>>
>>55477554
Alright, thanks
>>
I've been learning C++ and Java this past month and want to start making some games with the skills I learned.

What can I use to create games in? I just want to make something like a basic RPG or platformer. From what I hear Game Maker is more of a drag-and-drop kind of thing, I want something that only uses code I create but can let me add backgrounds and sprites and what not. Preferably on OSX or Linux.
>>
>>55477612
SFML.
>>
>>55477612
>basic RPG or platformer
I guarantee you won't finish either of these if that's the first kind of game you want to go for. Start simple.

You can use SDL/SFML with C++.
>>
>>55477525
do java first. it's really easy and you can literally get an okay idea of it within like, 3 days.
>>
>>55477633
>>55477657
Thanks, these seem pretty cool
>>
Any swift/xcode programmers here? What are the best learning resources that aren't as lengthy and time consuming as the official apple sites?
>>
>>55477662
I've actually considered learning Java since cross platform support would be pretty nice. Aren't they very similar anyway?
>>
>>55477725
Extremely similar.
>>
>>55477746
Then I'll probably start learning Java, thanks
>>
i know some C python and scheme and that's all i ever need
am i missing something
>>
>>55477955
OCaml or Haskell
>>
>>55478034
Ocaml doesn't even compare
>>
I'm trying to do a space with line replacer for Ti-89 calculators so that I can print lines without them being cut because of the horizontal character length. They would normally look like so
    This is a pretty long test
ing for the Ti89 Calculator

and I would like them to look like so
    This is a pretty long
testing for the Ti89
Calculator

I tried to do it with this code
    void _print_line(char* string)
{
int k = strlen(string);
if(k > 26)
{
int n = 0;
int c = 25;
while(n == 0)
{
if(string[c] == 32)
{
n = 1;
}
else
{
c--;
}
if(c <= 0)
{
n = 2;
}
}
if(n == 1)
{
string[c] == '\n';
}
}
printf("%s\n", string);
}

But it seems to just ignore it and keep printing it like the first example.
BTW StackOverflow's code tags are shit
>>
>>55478373
You should read further about printf, it can do just what you need alone.
>>
>>55469154
>>55469248
>>55469263
Iteration has nothing to do with recursion.
>>
File: 1467219294605.jpg (85 KB, 641x413) Image search: [Google]
1467219294605.jpg
85 KB, 641x413
>>55468132

I'm a basig Git user (clone, branch, push. pull, retconf, checkout) and I'd like to be more "safe" with merges.

I have a master with 4 features branches all stemming from master.

How do you merge them all to master and have everything working? Is the order important?
>>
>>55478478
>i haven't read SICP
>>
>>55478448
Would you be willing to spoonfeed? I have no idea how to search for this.
Thread replies: 255
Thread images: 21

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.