[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/prog/ - Programming

Programming board

Catalog

Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 1 per post.


File: 1441181852069.jpg (66.74 KB, 573x459, 191:153, heart.jpg)

80c2ea No.3182[Reply]

>C without pointers

>Haskell without monads

>Java without exceptions

>Python without whitespace

38 posts and 3 image replies omitted. Click reply to view.

d52f83 No.3986

>any functional language

>no tail recursion


80c2ea No.4001

>>3974

>Nglsh wtht vwls


653c50 No.4005

>>3184

>goto

Just use while loops, you fucking newfag.

>if statements

They're called conditionals, and they're not required.


653c50 No.4006

>>4005

>>3184

Me again, here are some while-loop pseudo-conditionals.


#include "stdio.h"
main(void) {
int x=1;while(x<101) {
while (x%3==0) {
printf("Fizz"); break;
}
while (x%5==0) {
printf("Buzz"); break;
}
while (x%3 && x%5) {
printf("%d", x); break;
}
printf("\n");
x++;}
}


1aee25 No.4018

>>4006

>that indentation style

are you a wizard or an idiot?




File: 1455762555193.png (15.43 KB, 1354x79, 1354:79, Screenshot.png)

17dcfb No.3963[Reply]

I dont know why this is, I have the idea in my head however when I try I seem to develop autism.

17dcfb No.3965

>>3963

No one? really!


b0ed83 No.3967

>>3965

Dude this board has like two posts a week and five active users I saw your post only because I'm subscribed to the board's rss.

Besides what do you want us to tell you? Practice more. Don't be an autist. Work out the things you need to do in your head and then write the code.

Writing a program is like traveling to a destination. You decide where you want to go, you decide how you want to get there and then you depart.


62c6c3 No.3970

File: 1455842157913.png (48.19 KB, 1000x420, 50:21, 03-10.png)

You need to formalize your idea, unless it's a library you probably should analyze it top-down. Get the general idea, split it into problems, subproblems, etc. then implement the small parts. Start practicing with simple programs, since you're having trouble with it you should write your analysis down on paper. Post an idea you're having trouble with.


027cb1 No.4008

Yo, OP, I used to have this exact problem. I knew all the syntax, general rules, etc., but I just could not write anything down. The way I fixed it was that I kept looking at better programmer's code, copied it down word-by-word (don't copy and paste), and then compiled it.

Now you're thinking "but that won't work, I'm not creatively thinking if I do that". While it's true that you won't be thinking creatively, it will make you "get" how their code works intricately. It forces your brain to look at the code closely line by line, rather than trying to read it like a normal book.

Once you do this long enough, you will start predicting what needs to be written next without looking at their code. Keep going, and you'll start noticing ways you could have written it to suit your own preferences. Then, you will actually start thinking like a programmer, and be able to come up with original code.




File: 1425534975668.png (80.94 KB, 1600x900, 16:9, Screenshot (13).png)

01ef74 No.1559[Reply]

beginner noob programmer here who wants to go proffessional as soon as possible. How many hours should I practice? How should I learn? Are YouTube tuts good enough? How will I know if im ready?
Im going for web developement and I have college for two days during the week but Im free the rest of the 5 days and I want to get started proffessionaly as soon as possible.
I apoligize in advance if this seems like shitposting but im serious.
Thanks in advance

And yes pic related, just an imageboard like webpage I designed for practice as I started out.
27 posts and 1 image reply omitted. Click reply to view.

eca3f1 No.3874

>>3352

is a geekcode generator that hard?


de0ab5 No.3877

>>3874

Those "programming challenge" lists have nonsensical variations in difficulty, see >>3359


75a86c No.3999

>>3381

Is there any good source of common concepts you should know? This approach feels true, but a noob don't really know what you should know. At the moment I'm stuck reading programming concept articles at wikipedia haphazardly. A list of concepts in a natural order for good understanding would do many beginners great I think, and I've never found anything when searching for it.


de0ab5 No.4000

>>3999

Books on programming for beginners almost always cover those concepts. Basically pick whatever book is recommended for the language of your choice and it will have every critical concept in the beginning because otherwise it's impossible to progress otherwise.

I kind of get where the pseudocode guy comes from, but personally I think it's much harder to start without an actual language when you can get syntax verification and interpretation.


94c187 No.4007

>Chrome and Chrome OS.

Get better tastes in software.

>Shit grammar.

Learn to speak your native language first.

>YouTube tutorials and Shitty WebPages

You couldn't make a fucking Imageboard? What, are you retarded? It's the fucking FizzBuzz of back end WebDev.

Oh, and your shit site looks awful too.

Assuming your either a straightfag or a nigger, because those are the only two groups with a low enough IQ to produce something so fucking shitty.




4baaa0 No.3995[Reply]

Could someone please explain to me what is going on in this code?


#include <stdio.h>
#include <math.h>

// (1):
typedef struct
{
double x,y;
} POINT;

POINT c, o, p[10000]; // (2):
double a, q=0.0; // (3):
int n; // (4):

// (5):
double ccw(POINT a, POINT b, POINT c)
{
return a.x*b.y + a.y*c.x + b.x*c.y - c.x*b.y - b.x*a.y - c.y*a.x;
}

int main(void)
{
int i, j;

o.x=-10001; o.y=-47; // (6):
while (scanf("%d", &n) > 0) // (7):
{
if(!n) // (8):
break;
for (i = 0; i < n; i++) // (9):
scanf("%lf %lf", &p[i].x, &p[i].y);
a=0; // (10):
for(i=0; i<n; i++)
a += ccw(o, p[i], p[(i+1)%n]); // (11):

c.x = c.y = 0.0; // (12):
for(i=0; i<n; i++)
{
q = ccw(o, p[i], p[(i+1)%n])/(3.0*a); // (13):
c.x += q*(o.x + p[i].x + p[(i+1)%n].x); // (14):
c.y += q*(o.y + p[i].y + p[(i+1)%n].y);
}

printf("%.3lf\n", fabs(a) / 2.0); // (15):
printf("%.3lf %.3lf\n", c.x, c.y); // (16):
}

return 0;
}

I really can't grasp C at all, no such problems with JavaScript, HTML or XML or even Python (although I haven't really looked into that one yet), but C will most likely kill me for some reason…

I get the basis and some of the theory of what is going on in this particular code (calculates the area of the object formed by the co-ordinates, as well as the center of gravity(? - English is not my native language, so not sure if I got it right)), but I'm fucking done when it comes to how the parts work.

Could someone please explain it to me?

Input forPost too long. Click here to view the full text.

4baaa0 No.3996

>posted too soon

Should return:


4.000
0.000 0.000


a333c6 No.3997

You're lucky I'm ok with doing your CS homework for you OP

I'm assuming you know basic stuff like arrays that you would have hopefully learned with javascript. If you don't then fucking learn the basics first then come back.


// READ UP ON YOUR ALGORITHMS
// https://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon
// https://en.wikipedia.org/wiki/Graham_scan

// (0): Tells the preprocessor to prepend the stdio & math libraries to file
#include <stdio.h>
#include <math.h>

// (1): Defines (but doesn't create) a grouping of variables called POINT
// Models the x and y coordinates of a single point.
typedef struct
{
double x,y;
} POINT;

// (2): Creates 2 POINTs and an Array of POINTS:
// c: For holding centroid (or center of mass) point coordinates
// o: For holding a reference point to create triangles from
// p: For holding the points the user puts into the program
POINT c, o, p[10000];

// (3): Creates 2 double-precision floating point number variables:
// a: For holding the accumulations of the areas of the triangles used to
// calculate area (basically builds shape out of triangles).
// q: Holds calculated distance from point to centroid
double a, q=0.0;

// (4): Integer variable for holding number of points the current shape has
int n;

// (5): Part of Graham Scan algorithm, used here to find area of triangle
double ccw(POINT a, POINT b, POINT c)
{
return a.x*b.y + a.y*c.x + b.x*c.y - c.x*b.y - b.x*a.y - c.y*a.x;
}

int main(void)
{
int i, j;

o.x=-10001; o.y=-47; // (6): Set o to a far away coordinate, is ref point.
while (scanf("%d", &n) > 0) // (7): Loops and gets user input in integer form,
{ // which is placed into memory address of n.
Post too long. Click here to view the full text.



File: 1456812984336.png (40.21 KB, 685x723, 685:723, seamsbotsms.png)

989a87 No.3991[Reply]

What projects are you guys working on?

I got a not-yet-conforming to PEP8 Python project.

https://github.com/keithstellyes/Seams-Bot

I have unlimited SMS but limited data, figured I'd just run a script using Twilio for texting. It also can run in a terminal and can be easily ported as an IRC bot or email interface.

Pic related, show me your cool stuff.

989a87 No.3992

Each time it polls for new SMS, it prints _, when it detects a new one, it prints !, shows the message received, and the one it sends.


989a87 No.3993

Easy as hell to make new commands for it too




File: 1426132970503.png (334.97 KB, 812x458, 406:229, 1426107755599.png)

c3c9dd No.1643[Reply]

Anyone wanna learn Android programming with me?

Add meow@hot-chilli.net on XMPP

Use OTR. We can do this.
5 posts omitted. Click reply to view.

3e25d5 No.2095

>>2085
>congratulations, two terminal commands, one minute of configuring and 1-5 minutes of googling for a server allow you to defeat the NSA's multi-billion-dollar surveillance mechanism.
Not if one of the computers is rigged.

c2ace6 No.2111

>>2095
alright, but cracking weakened encryption is still more expensive than just looking at the packets.

there is not yet an english sauce available but:
>thx to snowden there's moar encryption
>nsa can't decrypt
>representatives of google, cisco m$ and university of zürich are trying to help by suggesting a new protocol that puts information about the content into the packet header so middleboxes can check for bombs or whatever they do.
http://www.heise.de/netze/meldung/Friedensangebot-oder-Kniefall-IETF-streitet-ueber-Auskunftspflicht-von-Datenpaketen-gegenueber-2597342.html

some encryption is always better than no encryption and it requires virtually no effort to get started.

c07bc5 No.2119

>>2111
I'm speaking of things like keyloggers and screenrecorders.

c2ace6 No.2120

>>2119
lmao, right.
well, spend an afternoon to set up linux then if you want to be on the safe side.
sage because not sure if serious.

3891dd No.3985

>>1643

I'm a bit late to the party, but I want in. I created a hot-chilli account and added you.




File: 1448730838041.jpg (90.62 KB, 1034x594, 47:27, steveklabnik.jpg)

78aa16 No.3652[Reply]

Thesis: rustlang is a theoretically nice language whose community is overrun by mediocre webdevs who see it as a lazy shortcut to get into systems programming without having to learn all the low level stuff.

14 posts omitted. Click reply to view.

dc290a No.3893

>>3797

i would care to hear more about this as well


38a884 No.3896

>>3893

Chances are he just lied on the internet.


38a884 No.3897

>>3892

* at cumpile time


0e94d9 No.3908

>>3659

I wonder who would be most insulted by the company?


e3cd19 No.3982

Truthfully rust is actually much nicer than C for systems programming because of the ability to inline assembly in a way that won't make everything explode. Because you can warn the compiler what register's you're using and it then won't make any assumptions about them, which in C requires using naked functions or black magic.




File: 1434465291433.jpg (84.62 KB, 620x387, 620:387, marijuana_2255302b.jpg)

f8e942 No.2605[Reply]

I've been smoking/vaping weed on and off for about 8 months now and I've decided to start learning programming. Does marijuana impair one's ability to learn how to code? Should I quit weed altogether and just study programming or is casual use of weed still ok?

33 posts and 4 image replies omitted. Click reply to view.

4c6daf No.3701

>>3698

>NIDA-funded scientists

>NIDA-funded

>NIDA

So who the fuck is NIDA?

The same people that created these websites:

https://teens.drugabuse.gov

http://www.drugabuse.gov/

They totally don't have an agenda.

Damn it I fell for the bait didn't I?


bc26a9 No.3706

>>3701

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2825218/

>Conclusions

>In sum, this review demonstrates that adolescent marijuana users show working memory, attention, and learning abnormalities that persist at least 6 weeks following cessation of use, but that these deficits may resolve with longer term abstinence.

You're in denial.


bc26a9 No.3707

>>3701

I'm guessing you couldn't find anything wrong with this study, "Persistent cannabis users show neuropsychological

decline from childhood to midlife" ?

http://www.rjbf.com/PNAS_Meier.pdf


e58004 No.3768

If you can drop the habit one day without thinking about it and never smoke again, then you're okay. But if you can do that, why not do it right now and save the money and time?


0af80a No.3977

>>3512

this.

alpha-pvp changed my life




File: 1451615498815.png (9.2 KB, 512x512, 1:1, r6028.png)

1f7d08 No.3791[Reply]

I've got a lot of time on my hands for the next couple of days and I'd like to learn how to use HTML and at least be able to make something functional soon. The thing is, I don't know where so start.

I know basic things such as how to format the code so as it can be read and to use a css for pretty much everything but other than that, I'm useless.

Can you please point me in the right direction to start? Thanks.

Also happy New Year.

1 post omitted. Click reply to view.

6e1056 No.3857

literally XML, it doesnt get much easier


b4d5d2 No.3861

>>3791

just start making a website and Google things as you need to use them. html and css by themselves are practically useless though. if you want a functional site learn jquery sql asp and stuff.


000000 No.3887

>>3861

>asp

>google

lol

>>The thing is, I don't know where so start.

>Take this page, right click and hit save page as.

>Begin changing values and see what happens

>w3schools.com

> learn HTML, JS and then once you can build a frontend; learn Node or Python

MFW


c1a33c No.3951

http://www.w3schools.com/html/

Start from here, then continue to CSS, Javascript, dabble a bit in PHP (every web designer has to know how to use it, even though the language is garbage), then learn Python w/ Django.


99169b No.3972

I think the most important thing you need is experience.

I did the w3scools tutorial on javascript, but that by itself isn't enough. I still struggled writing something basic such as counting all the images in a thread.

Maybe build a custom homepage for yourself and fiddle with it?

I actually created my own hidden board to fuck around with the css and vent like a bitch.




File: 1454997421513.png (58.87 KB, 464x450, 232:225, 1445174595001.png)

e66e0b No.3920[Reply]

Can I learn to code?

>19 yo

11 posts and 3 image replies omitted. Click reply to view.

f2862b No.3954

>>3935

Beats me. Life happened.


41851e No.3964

>>3920

If your mother didn't play audiotapes of Assembly scripts read aloud when you were in utero, you might as well just give up now.


53c101 No.3969

>>3954

>>3954

>>3954

Life hasn't happened to you yet son. You've only had hair on your balls for 4 years.

You're starting younger than most who are employed to program professionally. The stuff that kids program is garbage and your frontal cortex isn't fully formed until after the age of 25. This isn't like learning a spoken language. It's logical syntaxical expression.

The plebs propagating the child programmer myths also thought we'd be driving flying cars by now, so start learning and stop asking.

The worst thing you'll develop is a new skill.


c75429 No.3971

>>3969

That dude just turned 40, though. Happy birthday, f2862b!

Anyway, this is mostly true. You have to bear in mind however that university hacker culture trickled down to computer-savvy kids as early as the 70's (Bill Gates and RMS - they both started young.) Even Zuckerjew had a headstart on coding.

The younger the better, and OP you are a freaking kid. You haven't lived even 2 decades.

Get out there and write some software, boy-o.


d452e8 No.3988

>>3920

yes, but not by asking stupid questions on the internet.




File: 1455737459436.png (49.82 KB, 2000x530, 200:53, vulkan.png)

e3b809 No.3962[Reply]

Vulkan 1.0 dropped Feb 16, 2016.

Full 1.0 Spec (warning, huge): https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html

Vulkan 1.0 Quick API Reference: https://www.khronos.org/files/vulkan10-reference-guide.pdf

Mantle hello world (almost identical to actual Vulkan use): https://medium.com/@Overv/implementing-hello-triangle-in-mantle-4302450fbcd2

Mantle programming guide and API reference (since the official Vulkan programming guide doesn't land until August): https://www.amd.com/Documents/Mantle-Programming-Guide-and-API-Reference.pdf

Planning to use it? Already using it? What are you using it for?

4c6ced No.3966

File: 1455835412302.png (591.59 KB, 548x602, 274:301, 1455329109220.png)

>>3962

>Planning to use it?

I would like to, but it will take about 1000y to learn it and another 1000y to refractore everything to use ti, damn


eef7ed No.3968

>>3962

I would really like to, but I know jack shit about this stuff so far, so it will probably be a long time before I am able to.




File: 1454925825843.gif (19.11 KB, 617x388, 617:388, u_term_01.gif)

c36779 No.3909[Reply]

Hello /prog/!

Learning myself C at a steady and slow pace. Now I've learn that creating even the most simple TUI using printf is bloody murder. So I've decided to take it to the next level.

Can anyone please tell me if there's a good tutorial on how to create terminals using <curses.h> (or some other library).

2 posts omitted. Click reply to view.

c36779 No.3947

>>3940

Thanks a lot!


080bea No.3952

>>3947

Pirate Visual Basic for DOS.


c36779 No.3953

>>3952

>Visual Basic for DOS

Seems cool! And does that code transslate to C code?


d3778e No.3955

>>3940

>>3909

This one is ok OP, just remember that you have to use pdcurses if you want it to be remotely portable.


c36779 No.3959

>>3955

Thanks! But the terminal is to make it easier for me to explore and develop core mechanics.




File: 1455323149655.png (164.37 KB, 800x846, 400:423, Konqui.png)

ad5b89 No.3938[Reply]

Let's play a game.

>Pick a open source project you like/hate/think is horribly buggy or bloated

>post example code on how to make something it does better

>Hard Mode: Test and commit the change to the project.

>Damn Fine Autism Mode: Show profiled proof that your change made it better. Valgrind.

8ch shut the fuck up this isn't even flooding yet

666b49 No.3939

https://github.com/chromium/chromium

README.md

 The main Chromium project is located at https://www.chromium.org/.
The source code is available at https://chromium.googlesource.com/.
Instructions for contributing can be found at https://www.chromium.org/developers.

BETTER VERSION

 The main Chromium project is located at https://goo.gl/i55pmC/.
The source code is available at http://goo.gl/zB2JyD/.
Instructions for contributing can be found at https://goo.gl/shpwff/.


d2eeba No.3950

File: 1455410517009.jpg (26.84 KB, 275x142, 275:142, e.jpg)

How does one find a project to contribute, granted that all the software I use on daily basis is usually too mature and complex for any minor fixes.


ea4c6f No.3956


ea4c6f No.3957

File: 1455560118305.png (77.86 KB, 433x331, 433:331, his-smile-and-optimism.png)

>>3938

>post example code on how to make something it does better

In many cases that would be a complete purge/redesign/rewrite so you see this isn't feasible.




File: 1429727811618.jpg (85.86 KB, 569x400, 569:400, emacsvim.jpg)

31c5bf No.2190[Reply]

What are ya hackin' with, /prog/?

79 posts and 5 image replies omitted. Click reply to view.

7f98e2 No.3902

>>2279

Nano is extremely simple to use and I've done much better programming with it than both Vim and Emacs.

It's better than Emacs and Vim combined, especially because both of those are bloated to all hell, have no real useful purpose aside from purposely making the software overly complicated to use.

I want to be out of a text editor within a second of making the decision. Same goes for saving the file.

This isn't really a necessity, just preference, but from me, comparing Vim to Nano, Nano gets a plus for highlighted code.

Explain why either Vim or Emacs is any good, or at least how they aren't the cancer of text editors, which should be extremely simple tools, not wannabe far overcomplicated IDEs.


c0131a No.3905

>>3902

i can only speak for vim. and i'm not sure we're talking about the same nano.

leaving the editor and saving a file in vim is one combined command - ZZ - or if you want to just exit ZQ. you can easily map a save key in your .vimrc; for example, i have \-s mapped to save so i don't have to :w<CR> everytime i want to save. vim also does highlight code without addons, so the features you mentioned are there and then some.

i understand you don't want a wannabe IDE but rather a simple text editor, and vim imho can be just that. granted, you have a small learning curve at the beginning, but if you're serious about editing text, vim will quickly feel much more natural and the commands are actually quite mnemonic. c for cut, cw for cut (to the next) word, ciw for cut inner word (cut the word under the cursor, p for paste, and so on. moving around, once you're used to, will also feel more natural than before - you don't have to take your hands off the normal position on the keyboard, looking for the arrow keys or the mouse to jump to a line and a lot of the time you can move around and edit at the same time. i haven't even started talking about the ease of scripting from within the editor - just press q and another button, it starts recording until you press q again, then execute what you recorded by simply doing @<button> which of course can be prefixed by the number of times you want it to happen - or using marks.

all in all, vim aims to enable you to interact with your file rather than just edit it. i have vim bloated to the maxxx with 20 plugins, enabling me to write code and latex like someone using textmate or sublime would, amazing autocompletion provided by clang for c/c++, python by python, rust by racer, ruby and java by eclipse (through eclim), file explorer, method explorer and the like.

to me, vim is the only tool i ever need to edit text files, be it config files or refactoring code in big projects. this way i only need to learn one tool and benefit from this whenever i edit, which i do a lot. and the performance is still very good, although i admittedly dPost too long. Click here to view the full text.


000000 No.3934

vim, but I use it like vi with syntax highlighting.


30c027 No.3945

>>2278

>text editor using a webpage rendering toolkit

Is this somehow less bad than a text editor OS?


30c027 No.3946

>>2694

Integrated gdb doesn't sound too bad, but ultimately you can just use tmux/screen to accomplish the same stuff without fattening up your editor.




File: 1421771585722.png (1.55 MB, 1366x768, 683:384, 1409640772840.png)

37b299 No.1082[Reply]

Share your unpopular opinions. I'll start:

I think Python is the best general purpose language if speed doesn't matters.
102 posts and 4 image replies omitted. Click reply to view.

47ca45 No.3762

>>1178

inheritance is shit, not objects


98cea4 No.3770

File: 1451186836856.gif (217 KB, 173x261, 173:261, 2b6.gif)

So, according to this thread this is unpopular.

I like python and think Guido is a cool guy.


44feeb No.3918

>>2033

Does Stallman still code? B-)

The problem with him is not that he's autist. It's that he thinks that the whole world should live according to his impossible standards. Case in point: For years he lived on MIT, rent-free. That maladjusted him into thinking that everything is for freedomz, or something.

>>2141

>Seconded. Open sourcing .NET just screams "Embrace, Extend, Extinguish".

So open source wasn't the panacea? B-)


3102a3 No.3929

>>1137

We've got a lisper over here


44feeb No.3933

File: 1455182634978.gif (176.33 KB, 363x511, 363:511, Karl Marx.gif)

>>3918

To further develop my thoughts.

The reason that programmers are treated as beta plebs is because of Stallman. His idolatry of programming, something that *should* be made out of *kindness* has done unimaginable damage. His ifs and buts on making money on programming renders it effectively a non-commodity.

And if programming is not a commodity, then it's nothing to negotiate about. And big companies just loves workers who don't negotiate. Even if it will hurt them in the long run. Such as EA's etc policies who made "crunches" and "death marches" standard operating procedure. No wonder that programmers leaves the gaming industry and goes to finance or oil when they hit the raising a family-age.

I'm not saying that this policy was only possible with Stallman. I'm neither saying that this policy was predetermined. EA could have not sucked Origin dry and so on. And I'm not saying that Stallman is actively obstructing the unionizing of programmers. But still, Le Mememan haven't done shit for 30 years and farts spooks about the nature of programming is EA's best enemy.

If you got to have an idol with wild hair and beard, at least do it properly.




Delete Post [ ]
[]
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]
| Catalog
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]