[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: 36
File: 1301741749213.jpg (287 KB, 580x2653) Image search: [Google]
1301741749213.jpg
287 KB, 580x2653
Previous thread: >>52946036

What are you working on, /g/?
>>
File: BckMiB3.webm (1 MB, 720x404) Image search: [Google]
BckMiB3.webm
1 MB, 720x404
Ask your beloved programming literate anything.
>>
>>52950018
What project should I do? Preferably in the C programming language.
>>
>>52949972
Learning Elixir, because I wanted to learn Erlang, but it's showing it's age.
>>
>>52950028
terminal IRC client? Shouldn't be too hard. IRC basics are easy to implement, and you can probably ignore the more complicated stuff if you get bored by it.
>>
>>52950056
Sounds shit. Any others?
>>
>>52950018

That raccoon... looks like it's trying to crawl into the dog's mouth. And the dog's just like... "fuck you, you're a smelly raccoon. I don't want to eat you."
>>
Hey i want to be a programmer and code ai for sex dolls, what is the path that will lead me there?
>>
>>52950051
Enjoy your #nojob stupid pleb ull wish u learned java or python like a good goy
>>
>>52950073
you're looking for the dragon book
>>
>>52950071
Roll for one.
>>52950073
Learn how to program and learn AI. You basically look for your own path.
>>52950077
I already know Java, Erlang sounded really appealing. Plus, I'm working on my own shit, so learning popular languages isn't important. I want all that concurrency and fault tolerance goodness, get my 5 9s.
>>
>>52950091
>>52950095
Isnt there specific languages like python or something? python is for ai right? RIGHT!?
>>
>>52950073
Compilers: Principles, Techniques, and Tools
>>
>>52950106
Yes. You seem to know enough. Just learn it. You can find all this information by googling.
>>
>>52950106
>Isnt there specific languages like python or something?
Close. What you're really looking for is "assembly".
Google it and you'll be on your way.
Have fun!
>>
>>52950073

>AI
Master's degree in either computer science and/or linguistics.

>>52950106

Python + NLTK is one option. I'm not sure on what it has for processing spoken language though.
>>
File: Capture.png (216 KB, 842x882) Image search: [Google]
Capture.png
216 KB, 842x882
this or...
>>
File: Capture2.png (234 KB, 827x924) Image search: [Google]
Capture2.png
234 KB, 827x924
>>52950215
this
>>
>>52950215
>>
>>52950225
the inverted color is weird, maybe try changing the color of the image but not adding a background
>>
fuck you fucking spergs you're fucking retarded i'm so sick of you

you really should kill yourselves you cancerous fucks
>>
>>52950215
The first is less wasteful with space, so I would prefer it. Although it might depend on who's going to use this application.
>>
>>52950240
Do you mean on the little floppy icon?
It does look a bit weird with the colors inverted, maybe I'll get rid of the background
>>
>>52950306
oh, were you asking about the search bar position? i like the first one better for that. the second looks like it takes up more space than necessary
>>
>>52950314
if you're asking about the search bar position, I agree
I didn't even notice the color thing at first
It looks better in the first one, it doesn't take up as much space, and the second one kind of looks weird since it's just sitting there all on its own without anything next to it
>>
>>52950330
First one it is. Thanks >>52950298 >>52950234 >>52950314
>>
I'm trying to implement A* pathfinding using a Java PriorityQueue for the open set.

In a Java PriorityQueue, can you use the compare method in a Comparator to filter something out (reject it) when adding an element? I can override the compare method, but is there anything else I can do to reject it if the Comparator returns -1? Do I have to override PriorityQueue's add method?

private class AStarComparator implements Comparator<GridNode> {
@Override
public int compare( Node a, Node b ) {
return a.movement_cost < b.movement_cost ? 1 : -1;
}
}
>>
>>52950391
awesome code. great length. look clean. simple. elegant. good luck with all your java programming goals in 2016.
>>
>>52950435
What?
>>
>>52950451
don't mind me, at this point i'm just metaposting

it's a modified copypasta btw
>>
>>52950451
Wow Ethan, great moves, keep it up, proud of you.
>>
>just because you can use <superfluous meme feature in C#> doesn't mean you should
>>
>>52950215
>>52950225
is there a way you can remove the anime?
>>
>>52950493
img[src="link_to_animu_image"] {
display: none !important;
}
>>
>>52950493
>anime newsgroup indexer
>without the anime
>>
testing syntax highlighting

(let [x 1]
(if (= x 1)
(str "syntax" "highlighting")
"fuck"
)
)
>>
>>52950509
;; posting new anime forum
# on an anime forum
// 2016
/**
* @param what
*/
>>
>>52950215
put the help/contact/github at the bottom or make it lower contrast you fag. the rest of the page still needs higher contrast
>>
8ch dot net/boards.json
Not sure why i can't post an 8ch link.

Can anyone work this out? I've tried using Json2Csharp to get a workable data class out of it, but I can't seem to parse it.

public class RootObject
{
public string uri { get; set; }
public string title { get; set; }
public string subtitle { get; set; }
public string time { get; set; }
public string indexed { get; set; }
public string sfw { get; set; }
public string posts_total { get; set; }
public int weight { get; set; }
public string locale { get; set; }
public List<object> tags { get; set; }
public string max { get; set; }
public int active { get; set; }
public int pph { get; set; }
public int ppd { get; set; }
public double pph_average { get; set; }
}


This is what Json2Csharp gives me, doesn't work. Tried deserialising as a <List<RootObject>> as well and that doesn't work either.

I can't work it out whatsoever.
>>
>>52950624
Awesome code. Great length. Look clean. Simple. Elegant. Keep us all posted on your continued progress with any progress pics or code snippets. Show us what you got man. Wanna see how freaking huge, solid, thick and tight you can get. Thanks for the motivation.
>>
File: the fuck.gif (2 MB, 260x192) Image search: [Google]
the fuck.gif
2 MB, 260x192
>>52950636
>>
File: IMG_20160213_092617.jpg (2 MB, 3264x2448) Image search: [Google]
IMG_20160213_092617.jpg
2 MB, 3264x2448
>tfw 9:30AM
>tfw too retarded to do exercise 1-13 properly atm
top fucking kek

why am I so retarded /g/?
>>
>>52950616
fine fuck you I'll look up real color schemes
>>
>>52950770
draw out the output by hand
>>
>>52950844
works not proplerly if end of line has a space though. Will eat something and then try again.

1 #include <stdio.h>
2
3
4 main() {
5
6 int c, i, nword, tmplen;
7 int wordlen[10];
8
9 nword = i = tmplen = 0;
10
11 for(i = 0; i < 10; i++) {
12 wordlen[i] = 0;
13 }
14
15 while((c = getchar()) != EOF) {
16 if(c == ' ' || c == '\n' || c == '\t') {
17 ++nword;
18 ++wordlen[tmplen];
19 tmplen = 0;
20 } else {
21 ++tmplen;
22 }
23 }
24
25 int j;
26
27 printf("words: %d\n", nword);
28 for(i = 0; i < 10; i++) {
29 printf("%d chars: ", i);
30 for(j = 0; j < wordlen[i]; j++) {
31 printf(" -");
32 }
33 printf("\n");
34 }
35 }
>>
What is the Neon Genesis Evangelion of programming langauges?
>>
>>52950770
Why is it comparing C to Fortran and Pascal?
Literally who cares?
>>
>>52950973
i don't even know what that means
>>
>>52950891
why do you even have an array?
all it does is store 0s in it.

you are doing nothing but wasting space with it.
>>
>>52951017
oh wow, I realized how fucking dumb I am
>>
>>52951017
uhm, no? It's just initialzing in the first for loop. Forgot that you can initialize and array in C with that enum shit.
>>
>>52950616
no more complaints
>>
>>52951132
looks good bruh good job dave man
>>
             ++wordlen[tmplen];
tmplen = 0;


What do you think this does?
>>
File: 1396327969802.png (31 KB, 448x357) Image search: [Google]
1396327969802.png
31 KB, 448x357
>>52951226
it fuggs yo mum
>>
>>52950973
C

also use Temple OS
>>
>>52951132
literally perfect
>>
File: 15.jpg (16 KB, 443x132) Image search: [Google]
15.jpg
16 KB, 443x132
>>52951313
>>
>>52951517
wew, much edgy, lad.
>>
https://www.youtube.com/watch?v=5XBFDLm2EU8

you spergs are like this judge just straight up retarded, delusional and deceitful
>>
>>52951517
That's not a word length histogram.
>>
File: silly cat eating a note stand.jpg (666 KB, 923x923) Image search: [Google]
silly cat eating a note stand.jpg
666 KB, 923x923
Is there any good literature that deals with the co-operation between software-development team and a team of non-programmers?
>>
>>52951631
You could probably read some other material which should give you a good idea.

Books about working with animals, and the mentally handicapped should be a good start.
>>
>>52951657
Thanks for the constructive and rational advice, Captain Autism.
>>
>>52951669
>Doesn't understand a joke

Autism you say?
>>
> 2016
> writing new software on C instead of Rust
Why?
>>
>>52951695
You diverted the discussion path into non-serious. I continued that narrative. You are merely expecting that I wasn't playing along with the joke despite making a gesture of mild frown.
>>
>>52951709
Rust too slow.
>>
>>52951722
How can it be "too slow" if llvm generates the same code for it as for C?
>>
>>52950891
>works not proplerly if end of line has a space though
Your space handling in general needs an overhaul. Consider a line with leading blank spaces - one would reasonably expect it to ignore all leading space before counting. The same for multiple blank spaces or empty lines. The convention for such things is that whitespace has no meaning, but you give it meaning accidentally by not taking into account what is next to it.

A line with 10 blank spaces in a row takes the first branch 10 times in a row, giving a word count of 10 for zero character words, which makes no sense.

I suggest you tweak the whitespace handling so you properly detect a word boundary and ignore any extra whitespace, leading, trailing, or in the middle. Also, zero-character words?
>>
>>52951733
you tell me.
http://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html
>>
>>52951733
>same code
>laughingwhores.jpg
>>
>>52951733
>using proprietary llvm not free gcc
:^)
>>
Hey, gee, how are we on that average function? Did we do it? Is it impossibru?
>>
>>52951132
>all nice and flat
>had to fuck it up with a fake fucking shadow
you dun goofed
>>
>>52951806
it's possibru

this might be the least disgusting solution

int avg(int a, int b)
{
if(a > 0 != b > 0) {
return (a + b) / 2;
}
return a / 2 + b / 2 + (a % 2 + b % 2) / 2;
}
>>
>>52951826
even this feels like such a waste of resources.
>>
>>52951826
>if(a > 0 != b > 0)
what does it do?
Test if one of em is >0 or <0, right?
>>
>>52951826
>least disgusting
>branching
absolutely DISGUSTING
>>
>>52951719
Merely pretending.
>>
>>52951800
C is a proprietary language :^)
>>
>>52951836
superior solution:
int avg(int x, int y)
{
return ((long long) x + y) / 2;
}
>>
>>52951847
It's okay, bro, we all make mistakes.
>>
>>52951842
checks if they have opposite signs. (a + b) / 2 is only safe if they don't have the same sign because then it might overflow, and (a + b) / 2 is still necessary because (a / 2 + b / 2 + (a % 2 + b % 2) / 2) by itself isn't correct for all input
>>
>>52951862
>not portable
>might actually be less efficient
>>
>>52951773
So, hundreds of thousands of C programmers realized some solutions better for x years period of time than thousands of Rust programmers in a period less than a year?
http://benchmarksgame.alioth.debian.org/u64q/rust.html
Still, Rust have better results in 4 of the tests, 1 test has equal result (because they made it using C code), 6 are worse. The difference in some of the last 6 tests is very big, which means that the solutions are not optimal. :3
>>
>>52951843

int avg(int a, int b)
{
return a / 2 + b / 2 + ((a > 0 == b > 0) * (a % 2 + b % 2) / 2);
}
>>
>>52951631
I wish, because honestly they are speaking two different languages. There were some articles I read by an experienced software developer (did freelance, worked with a team that shipped small business software, had done enterprise), and he gave some advice regarding independent software contractors. He wrote one for hiring them from a management standpoint, one for the freelance being hired about what to expect and look out for, and at least 2 about how to actually figure out what people want in spite of what they say.

I'll look for them, but the main point was to NOT ask for their solution, but focus on understanding their problem and what they want the outcome to be. I remember one anecdote where the hiring manager used a bunch of jargon about how they needed a new server and software written in java because it is new to help the webdev team to make it easier to change the website, and yadda yadda yadda, and it took him 20 minutes to figure out that all they really needed was someone to help them set up a decent CMS for their site.

If he'd just described the problem (changing stuff takes a long time and is error prone, sometimes we want to change something at a certain time and someone has to log in at midnight to do it, etc) and the outcome desired (we want to make a change in one place, and everything gets updated everywhere, we want automatic time-based roll out, and we want to be able to rotate existing content without a massive struggle), then the meeting duration would have been halved.

Anyway, if you search for how to hire a freelance dev, you'll get articles that will be from the other perspective, which is a start. Just remember that the words they use likely have absolutely no technical meaning whatsoever, and they probably don't understand how any of these things work.
At all.
Seriously.
>>
>>52950624
Thread is a little less dead now, bumping my own post.
>>
File: how_about_no.jpg (78 KB, 457x386) Image search: [Google]
how_about_no.jpg
78 KB, 457x386
>>52951891
>>
>>52951875
>not portable
extremely portable
>less efficient
more efficient than branching
>>
>>52951898
why not
>>
File: Screenshot_2016-02-13_04-01-50.png (49 KB, 426x682) Image search: [Google]
Screenshot_2016-02-13_04-01-50.png
49 KB, 426x682
Do you put memes in your debug text?
>>
>>52951902
>>52951904
you overestimate the cost of a branch and the ability of the compiler

>also what is instruction pipelining
>>
>>52951914
>the ability of the compiler
*underestimate
>>
>>52951914
I just gave a branchless version to calm his autism.
>>
File: bait 3.png (55 KB, 625x626) Image search: [Google]
bait 3.png
55 KB, 625x626
>>52951911
> Java
>>
File: Kornheiser_Why.jpg (73 KB, 600x1040) Image search: [Google]
Kornheiser_Why.jpg
73 KB, 600x1040
>>52951911
>libgdx
>>
>>52951826
>>52951806
Can someone tell me why no one is summing the ints into a long, then dividing by 2? It won't overflow.

int average(int a, int b)
{
long temp = a + b;
return (int) temp/2;
}


That seems like the simplest solution?
>>
>>52951914
this is clearly over your head
>>
>>52951934
Because sovjet era chips do not support longs.
>>
>>52951934
longs are often no bigger than an int you have to use a long long or a fixed width type

also your a + b can overflow as an int before being cast to long, and your temp can overflow when you cast to int (you need parentheses around temp/2)
>>
>>52951927
you're even more of a retard
>>
>>52951943
lol k tard

with the long long version you have to switch registers

with the int version it's just a few parallelized instructions and it's done
>>
anyone know how to read protocol buffered messages? I have a bunch of them but no text editor of mine can read them as plaintext.


Do I just need to use a library and call elements or something? Any help appreciated
>>
>>52951864
thanks, hun :^)
>>
>>52951932
What would be the best solution?
> games for smartphone
> libgdx is too heavy
> unity is too heavy
> unreal is too heavy
> cocos2d is heavier than an %%USERNAME%%'s mom // how can you make an engine for primitive games so fucking heavy?
>>
>>52951957
>you have to switch registers
omg! them switched registers!
>a few parallelized instructions
parallelized branching! you heard it here first, folks!
>>
>>52951946
so, check if overflow occurs, then do average..
>>
File: 02-13-13-12-36.png (121 KB, 1458x827) Image search: [Google]
02-13-13-12-36.png
121 KB, 1458x827
>>52951897
Extremely terrible code I wrote way back for testing some shit.

You should be able to solve your problem with this though.
>>
File: OpenGL-ES-2_0-Reference-card.png (2 MB, 1944x1320) Image search: [Google]
OpenGL-ES-2_0-Reference-card.png
2 MB, 1944x1320
>>52951974
raw opengl man it's actually easier once you've gotten into it because you don't have the same constraints, you can just program whatever the fuck you want

don't fall for the GAYM ENGYN hype. i could understand using a AAA game engine but it's not worth it to use something like libgdx, unity and such shit where you still have to do a lot of work yourself and the result sucks
>>
>>
>>52951993
4chan isn't an issue, that works absolutely fine.

8ch on the other hand serves up it's board list in a completely unusable format, it doesn't seem to break boards down into objects, I'm not sure what I'm supposed to do with it to make it work.
>>
>>52951963
bump
>>
File: an hour's worth.png (253 KB, 1280x858) Image search: [Google]
an hour's worth.png
253 KB, 1280x858
>>52951998
A game engine is not only about graphics.
Still, you suggest to spend some months/years on making your own engine (inventing a wheel) when you can spend that time making a game?
>>
>>52951892
The articles might be nice to get, but there's sound advice in your post already. Either way thanks.
>>
>>52952049
if you want to use some babby engine then kindly fuck off to >>>/vg/agdg

just use the android(/iOS) APIs man you have things like GLSurfaceView, OnTouchListener, OpenSL ES what more could you even ask for
>>
>>52952049
look at it this way

you could spend months, years using a crappy tool to make a crappy "game"

https://www.youtube.com/watch?v=Ze9G4rCxiyU

or you could make whatever the fuck you want without being constrained by dumbed down babby tier tools
>>
>>52952092
unity, UE are pretty good and you can make what the hell you want to make.

Cities:Skyline devs, a very small company decided to go with Unity instead of their own inhouse engine, that they used in 2 previous games because it was just too much to focus on.
>>
>>52952126
if unity is your thing then sure but libgdx is a fucking joke it's not even an engine it's a dumb little framework that only complete beginners/underachieving normies use
>>
>>52952092
Yeah, you can spend months, years using a crappy OS (windows, linux), or you could make your own glorious one.
http://www.templeos.org/
>>
>>52952158
>OS
>Made on C++
>Not on glorious Assembly language

where is your god now?

http://kolibrios.org/en/index
>>
File: shiftout.webm (2 MB, 1280x720) Image search: [Google]
shiftout.webm
2 MB, 1280x720
Got a shift register yesterday. Not sure what I am gonna do with it now though.
Maybe will build a binary clock.
>>
>>52952287
Nice bomb m8.
>>
>>52952291
What bomb? I see just a ticket into the White House.
>>
>>52952291
thanks, bru :^)
>>
>2016
>can't average 2 ints
>/g/
disgusting
>>
>>52952394
What's an "int"?
>>
>>52952013
The boards.json? It's an array with board objects, what is it you don't understand?
>>
File: 1452410500981.png (9 KB, 405x344) Image search: [Google]
1452410500981.png
9 KB, 405x344
Just started learning. What are the biggest roadblocks that newbies usually face? You know, besides literally everything.
>>
Want to get into graphics programming . What would be a good project to complete within a month, something like a milestone and goal to have in mind. I already know c,c++ and have some SDL coding experience making games etc.
>>
>>52952475
The mindset.
>>
So, why not
int avg(int a, int b) {
return (a>>1) + (b>>1);
}
>>
>>52952510
because /g/ is afraid of muh overflow, nigger.
>>
>>52952510
No memory involved:
avg(int, int):                               # @avg(int, int)
sar edi
sar esi
lea eax, [rsi + rdi]
ret

>>52952541
There will be no overflow if you divide both first and then add them.
>>
You guys seem to have a severe complex as your meme profession is being overtaken by the men of the street.
>>
>>52950225
This, but change the links: make them only icons (question mark, letter and github logo). Perhaps move them to the left or somewhere better.
>>
>>52951826
>>52951862
I just tested these and the second one is faster. Any other solutions I should test?
>>
Is there anything stopping me from making a private repo on gitlab and using it for backing up my files?
>>
>>52950148
Degrees are worthless
>>
>>52952581
>>>52952473
>Not on 8ch it isn't.
>I'm not being dumb, it's just one big list of properties instead of an actual array of objects with properties.
>I've said it multiple times now, take the extra second to process what you're reading instead of just immediately reacting to it.
nice delete :^)
>>
>>52952624
Most services do not allow pushing large binaries. But you can always backup your dot files.
>>
>>52952643
splitting the archive every 10mb or so would work though right?
>>
>>52952638
Don't worry I'm still going to call you a moron alongside the extra information, calm down.

>>52952473
On 8ch that doesn't seem to be the case, deserialising into an array of "Board" doesn't work, deserialising into a list of "Board" doesn't work.

Making a new object and then having that object contain a list or array of board doesn't work.

I'm really not sure what else I'm supposed to try, because it absolutely refuses to play ball, the JSON appears to be like the one 4chan gives you. You'd know that if you took a look at the boards.json that 8ch returns. and the one that 4chan returns.
>>
File: avg.png (33 KB, 1142x396) Image search: [Google]
avg.png
33 KB, 1142x396
http://vk.cc/4MpyNM
>>
>>52952654
I had problems pushing 3MB to neetcode. Luckily rar handles that for you. Also read up on the maximum size of a repo. I'm sure you're not able to push your 1TB porn collection on gitlab.
>>
File: images.jpg (8 KB, 225x225) Image search: [Google]
images.jpg
8 KB, 225x225
>>52951773
Damn son. Rust is pretty fast, specially considering how young it is.

I'm currently learning it btw, see if I can write my utilities in that instead of C.
>>
>>52952677
thanks
>>
>>52952677
>>52952697
just googled, gitlabs 10GB per repo
>>
>>52952510
>>52952553
What is avg(1, 1)?
>>
>>52951993
Did you pay for that font you filthy thief?
>>
File: avg2.png (40 KB, 992x520) Image search: [Google]
avg2.png
40 KB, 992x520
>>52951826
>>
>>52952707
Shit, you're right.
>>
>>52952714
is that a website?
>>
>>52952743
http://gcc.godbolt.org/ , I can't post direct links, it puts all the code in the url and 4chan blocks shorteners.
>>
>>52952763
Thanks, now I can optimize my code on whole new level!
>>
File: avg.png (7 KB, 474x156) Image search: [Google]
avg.png
7 KB, 474x156
This should work.
int avg(int a, int b) {
return (a>>1) + (b>>1) + (a & b & 1);
}
>>
File: 7434541170_0dd8fff6f6_o.jpg (1 MB, 1920x1280) Image search: [Google]
7434541170_0dd8fff6f6_o.jpg
1 MB, 1920x1280
I am a beginner in C programming. I'm working on a microcontroller project and currently I have all of the code in a single .c file. This is cumbersome to work with if the program has more complexity than blinking an LED.

What's the recommended way to split the functions into several files? Should I move all the functions into separate .c files and then just
#include
them in the file containing main()?

Just FYI:
$ wc weather_station.c
568 1452 12781 weather_station.c
>>
>>52952426
back to /hpg/!
>>
>>52952841
>should work
it doesn't though
>>
>>52952847
> Should I move all the functions into separate .c files and then just #include them in the file containing main()?
No, you should move all the functions into separate .c, put declarations into .h files, #include .h files in the main file, compile each .c file separately and then link them together.
>>
B...but muh documentation.
// RandStringBytesMaskImprSrc prints a random string
func RandStringBytesMaskImprSrc(n int) string {
>>
>>52952887
Explain. You can change (a & b & 1) to ((a | b) & 1) if you want to ceil instead of floor .
>>
Is java a god starter language? I want something that works on windows and linux
>>
>>52952973
Yes.
>>
Why isn't Microsoft doing something about C#?

If the .NET framework stays Windows-only they will never beat Java no matter how much they improve the language itself
>>
>>52952973
It's a good start language. If you want to become software alchemist, learn C instead.
>>
>>52952973
it's really easy and you can make bank on it

so yes
>>
>>52952980
can you recommend some learning materiel?
>>
>>52952981
They do: https://github.com/dotnet/coreclr .
>>
>>52952992
not looking to get into it as a job, more hobbyist but nice to know
>>
>>52952999
Not really no, I learned programming by jumping straight in on a big project and working my way through it.

Any old Java book will do if you want your hand held through the learning process, I wouldn't recommend it but that's just me.
>>
>>52953012
>Not really no, I learned programming by jumping straight in on a big project and working my way through it.
This

Fuck books
Fuck tutorials

Just find some really big project, clone it and start figuring out how it works
I honestly think this is the best and funnest way to learn almost any language
>>
>>52953012
I think I'm going to watch a few YT vids before jumping in, whats a good lightweight IDE for java? preferably on arch and windows
>>
>>52953012
I wouldn't recommend the way anon described. I did that with C++ and learned some really nasty habits.
At least learn the basics before you start maiming a project.
>>
>>52953024
Yup, especially if you're just a bedroom programmer, there's nothing finer.
I'd recommend starting your own large project, no point jumping in on existing code, you'll just get lost and confused.

>>52953025
>Lightweight
A text editor and a compiler.
>Good + Linux/Windows
Eclipse

>>52953033
If you're a bedroom programmer who occasionally wants to write a little utility or a neat toy, "bad habits" don't really matter - especially in a language like Java.
>>
So if a have project a in language1 and I port it over to language2 should I make a new repo or just have a new branch?
>>
>>52953044
True, but if you want to contribute to another project or make a living of it, than you're in big trouble. I'd rather invest some time in learning the language properly than just diving into it.
>>
>>52950072
He's washing the dog
>>
>>52953069
There's a limit on how bad your habits can be, and really they're easily unlearned. There's no point giving yourself a mountain to climb if you're just looking to kick your feet up and watch the sunset, can do that just fine on a small hill.
>>
>>52953069
>or make a living of it, than you're in big trouble
Not true

when I started working my job I knew fuck-all about C#, having massive enterprise projects slammed into my face really helped quite a lot
seeing how incredibly experienced developers programmed and picking up habits and design patterns resulted in a lot of rapid improvement
>>
>>52953044
>Eclipse
don't do this
>>
>>52953104
How did the company ensure the code you wrote was good enough to be pulled into the project?
>>
>>52953111
Not many other choices, if you can recommend a cross-plat IDE as good then let me know.

I'm a C# programmer who uses VS2015, so what do I know.
>>
Just finished the 2x2x2 rubik's cube solver

Took me over 4 hours to write it, but it solves it in a couple of seconds
>>
>>52952475
Read (and understand) code written by other people. That will show you where you are weak.
>>
>>52953130
I had a mentor who looked at my code in my first weeks/month

At first he didn't trust me with much of anything, then when those first weeks passed I was left one in charge of a massive project
he was very impressed by how fast I learned
>>
>>52953137
IntelliJ IDEA

it's basically the Java counterpart of Visual Studio
>>
>>52953161
>left one
left alone*
>>
File: Lewd.png (210 KB, 860x755) Image search: [Google]
Lewd.png
210 KB, 860x755
>>52950073
Study anthropology and psychology in addition to the programming languages of your choice.

I hear great strides are being made in the field of teledildotronics.
>>
>>52953161
K, fair enough. Though my personal preference is to read a book before doing any serious work.
>>
>>52950770
That first sentence seems like it's worded very poorly to me.
>>
>>52952916
you're supposed to truncate (round toward zero), that's the hard part
>>
>>52951631
You know it's kind of mind boggling to consider things like the machines used for testing blood and urine in hospital labs. An incredible amount of collaboration must have occurred between mechanical engineers, chemists, and programmers to be able to design such a thing.
>>
>>52953266
I write software a company that makes stuff like this and you'd be surprised. It's mostly just completing small milestones then passing the buck to the next department.
>>
>>52952287
Nice shift register, Ahmed.
>>
>>52953304
I don't see anything soldered
>>
What progamming language should I learn as an almost complete beginner?

How would I go about learning it?
>>
File: rob.pike.jpg (26 KB, 500x335) Image search: [Google]
rob.pike.jpg
26 KB, 500x335
>>52953401
>How would I go about learning it?
>How would I go
>would I go
>I go
>go
There, learn the language of Pike senpai.
>>
>>52953401
APL
>>
File: ayy lmao.jpg (16 KB, 437x354) Image search: [Google]
ayy lmao.jpg
16 KB, 437x354
I'm trying to figure out named pipes on Windows. I need 2 programs written in different languages to talk to each other on the local machine and I figure pipes are a good way to go.

I can't figure out the dynamics of it though, I can get data to move between the 2 but I feel like I'm doing it wrong, I set up a pipe, send data, close the pipe and do the same on other side. They're going to be communicating regularly for their entire life so I feel like I should be leaving a duplex pipe open and then just read and write when I need to send/receive instead of opening and closing it for each interaction.

Does anyone have experience with these?
>>
>>52952287
That looks like a counter not a shift register.
>>
>>52953423
http://www.ratedpeople.com/local/plumbers
>>
C Programming exam on Monday. I have to make a program to handle a chain of superstores, using linked lists. Wish me luck,/g/
>>
File: poor (You).png (102 KB, 1006x573) Image search: [Google]
poor (You).png
102 KB, 1006x573
>>52953481
>using linked lists
>linked lists
>linked
>lists
>>
File: phil-spencer.png (18 KB, 175x233) Image search: [Google]
phil-spencer.png
18 KB, 175x233
>>52953469
>call the top 3 rated numbers
>they don't even know what I'm talking about when I mention the Windows api
>the second number didn't even know what IPC meant
>quality plumbers
>mfw
I'll never figure it out at this rate.
>>
>>52953497
the exam requires linked lists :(
>>
File: dunno.png (28 KB, 300x196) Image search: [Google]
dunno.png
28 KB, 300x196
Thinking about making some random site to learn React. Suggestions?
>>
>>52953497
I'm a noob

Are linked lists some sort of a meme around here?

Linked lists have their own applications
No?
>>
>>52953525
They're a meme everywhere and to anyone who even remotely cares about performance.
>>
>>52953525
Literally everything else shits all over them in terms of performance in all scenarios
>>
>>52953501
https://www.anglianhome.co.uk/windows
>>
>>52953547
>>52953551
Yeah, but adding an element at the beginning is O(1)
appending is O(1) (with mutation)
I think you can use pointer swapping to insert in O(1) as well

which you can't do with arrays

Explain if I am wrong.
>>
>>52953559
>call number
>Hello sir this is Windows Microsoft and how am I to helping you today?
Simply impossible.
>>
>>52953570
Appending to a vector (resizable array) is O(1)

There are other data structures for achieving fast entry at the beginning, like a vector of vectors
>>
>>52953570
To clarify: inserting where insert is in a sorted list and you've already found where to insert
>>
>>52953598
>and you've already found where to insert

That sounds a lot like inserting into a vector where a space has already been made :)
>>
>>52953570
One word: Cache
>>
>>52953604
That was three words
>>
>>52953604
elaborate a little bit, just a few words so I can at least google something a little bit more specific
>>52953588
but a vector of vectors is not an array right
sounds more like a hash map to me, where you have little vectors instead of little (mb linked) lists
>>
>>52953640
an array is of fixed size

a vector of vectors is like an array of arrays
you could have a vector of pointers to vectors

the point is linked lists are still shit
>>
>>52953640
Look at stroustrup's entry on that: https://isocpp.org/blog/2014/06/stroustrup-lists
Especially the linked talk.
>>
anyone that knows how to retrieve an array from a query with pqxx? as of now with "normal" type i have simply used

myint= iterator[4].as<int>();

but 1 column of my table is an array of ints, how can do something like

myint*= iterator[5].as<int[]>();

?
>>
>>52953401

first study python, because it's comfy and you need to learn the most basic stuff about typing in code and seeing what happens when it runs

then after about a month switch to C

you'll learn a lot about how computers and languages work

after that you can "really" learn a language, as in, learn it well enough to build stuff, which is when you really learn the most.

could be anything at that point -- c#, javascript, back to python -- but right now you are 6 months away from worrying about this.

tl;dr - go do python until you know the difference between a for loop and a while loop, then switch to C
>>
>>52952999

nice trips btw

i'm halfway through Head First Java and it's fine, after this I'll try making some stuff
>>
How about object orientation in C?

I might need some knowledge for an interview regarding embedded shit, and I just vaguely know it involves a lot of structs and pointers.
>>
>>52953994
'bout 90 degrees
>>
>>52953481
you are giving exam questions before the exam?
>>
>>52953994

struct object {
// properties
};

returnType method(object* this, params...)
{
// do stuff
this->property ...
}

int main()
{
object x;
x. ...
method(&x, ...) // x.method(...)
}
>>
>>52954012
*they are giving
>>
>>52953722
>I have seen a case where changing a zero-to-two-element list to a zero-to-two-element vector made a factor-of-two difference to an algorithm. I didn’t expect that. Nor did other experts looking at the code.

That sounds weird. What a bunch of geniuses, a 2 element vector is practically an array. constant access, allocation or insert timings. while linked list is still linked list. why would anyone, especially stroustrup and 'experts', use linked list in such a case.
>>
>>52954041
>>52954012
yes
>>
>>52954139
why it is not called homework then? is that a take-home exam or they expect you to do a 'homework' then memorize it and repeat your answers in classroom?

that is pretty stupid, is this common?
>>
>>52953852
it is probably
iterator[5].as<int*>();
>>
>>52954275
nah i've tried that, after googling a bit it seems that there isn't shit in documents and stuff ( to be honest the library seems in great need of work and care), i found a guy that said he converted the array to a string then converted the string to an array piece of piece, it's a fucking horrible thing but i've written it by now, ill try that later, worse case i just remove the int array from the table and store as a string keeping the conversiong from string to array of ints
>>
>>52954450

Eww, she's white.
>>
>>52954449
piece by piece*
>>
>>52954475
tripfags no faggotry
tripfags no faggotry
tripfags no faggotry
>>
>>52954475
Same as you race traitor.
>>
>>52954503

Yeah, that's why it's gross. She needs to be much blacker.
>>
>>52954557
So you despise yourself?
>>
>>52954570

No. I love being white. I just don't find white women particularly attractive.
>>
I just applied a trademark for "daily programmning thread", once it passes you weebs wouldn't be able to make threads anymore without getting sued by me
>>
>>52954669
Too bad you misspelled it retard.
>>
>>52954701
is 4chan the patent office now?

misspelling the word here doesn't matter does it you fucking idiot?
>>
>>52954669

Trademarks adapted from common culture are already protected under trademark fair use.

You will be suing nobody.
>>
>>52949972
I'll post this again so that everyone can vote. Trying to put together a list of languages that /dpt/ might actually know if someone posts.
http://strawpoll.me/6801824
>>
>>52955432
>all these imperative OOP languages
functional is truly dead
>>
>>52955501
It has never been alive.
>>
new thread when
>>
Why is FPGA programming such fucking cancer. This shit is not intuitive. The languages for it exist on the asm/C level of abstraction. Because hardware is inherently parallel doing anything sequential is a pain in the ass: state machines are necessary for everything. Not to mention you usually have to manage the states of other modules when you are writing another because truly-event driven code makes code extremely bloat and occasionally unimplementable.

There needs to be a better way to do this shit. Preferably something FOSS too. Vivado is a joke of a program when it comes to user interface. Still can't handle spaces in file paths in 20-fucking-16.
>>
http://scholar.google.com.secure.sci-hub.io/scholar?as_ylo=2012&q=type+theory&hl=en&as_sdt=0,5
>>
>>52953111
Whats so bad about eclipse?
>>
>>52955709
...
>>
>>52955709
java
>>
>>52955731
>>52955793
that it?
Thread replies: 255
Thread images: 36

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.