[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: 49
File: black-lagoon-amv-gif.gif (357 KB, 500x281) Image search: [Google]
black-lagoon-amv-gif.gif
357 KB, 500x281
Old thread: >>53917964

what are you working on /dpt/?
>>
File: qqqqq.jpg (127 KB, 500x500) Image search: [Google]
qqqqq.jpg
127 KB, 500x500
Somebody for the love of god help me before I start this shit.

So I want to use a sites information in an android app but the site doesn't have any proper api. I have made a library of web scrapers to get all of the information from the site. Should I just use the library in my app or should I host a database of the all the already scraped info and then use simple calls to the database?
>>
>>53927028

That depends -- how long will you get away with scraping their site before they fuck up your application by changing things?
>>
>>53927028
>Are you going to reuse the scraped data
Use the database.
>Are you going to use data once then obtain new data
Don't use the database.

You should probably use the DB though so you aren't hammering some website a ton.
>>
  1 #include <stdio.h>
2
3 int main(){
4
5 int age = 0;
6
7 while (age < 100)
8 {
9 age++;
10 printf("pepe|pepe/pepe|pepe/pepe|pepe");
11 }
12
13 printf("\nI just printed pepe alot of times..\n");
14
15 return 0;
16 }
>>
In case it gets buried

>>53926783
>>53926833
>>53926844
P( x ) is the probability of x and P( x | y ) is read "the probability of x given y."

>>53926794
That is another part of the question. I may just be getting lost in the "for all" but I feel like it's necessary to know that they're programmers because of the 1% being at microsoft. Or would it just end up being P( MS ) = .01 ? And then for the 50% that know C++ it's just P( C++ ) and whether or not they're programmers is irrelevant
>>
>>53927028
Weeelllllllll the second option doesn't sound too bad if you already have a place you can host all that shit. Probably the best option.
>>
>>53927054
k
>>
>>53927054
a lot*
>>
File: i got myself an anime!.jpg (204 KB, 440x574) Image search: [Google]
i got myself an anime!.jpg
204 KB, 440x574
I was getting 28ktrips/s with my singlethreaded tripcode generator, so I tried using openmp now it runs at 24.7ktrips/s.

If I get rid of the #omp critical lock, it goes up to 46ktrips/s, but the output is no longer correct.

Is there another way to prevent race conditions?
>>
File: face.jpg (48 KB, 218x265) Image search: [Google]
face.jpg
48 KB, 218x265
>>53927040
The site hasn't been changed in any way that would fuck it up for almost a decade.
>>53927045
>>53927066
Thanks, I'll go with a database.
>>
>>53927100
Yes.
>>
>>53927054
This project took me an hour to debug
>>
Someone's started up a port of ScummVM to the 3DS if you're into that shit:
https://github.com/Cruel/scummvm
>>
>>53926924
Yeah sorry, I was getting the start of the files and running it through ffprobe not ffmpeg.

I've got to uncompress the files from .001, .part01 and .rar01 files.

For .001 I could download part of it, uncompress and still have a file that would have the stream info.
.part01 I needed the entire thing to get the stream info. (not all the parts, just the first one).
.rar01 never gave stream info. I'm not really sure how this compression works, but thankfully I would only be skipping like 80 out of 100k releases if I just ignored it.

Feels dumb downloading part of a .001 file, uncompressing a broken .mkv and still getting media info, but whatever, it works.
>>
>>53927054
  5 int age = 0;
6
7 while (age < 100)
8 {
9 age++;
10 printf("pepe|pepe/pepe|pepe/pepe|pepe");
11 }

>not just using a for loop
>>
>>53927057
Rebosting from old thread
Yeah. If you really want to think about it where the population is important you can do this.
P(C++ | Programmer) = 0.5, P(Microsoft | Programmer) = 0.01 P(Programmer) = 1. Last rule is because no other population is represented, then you can reduce the conditionals in the first two rules. If that helps you think about it.
>>
File: programming.png (79 KB, 485x959) Image search: [Google]
programming.png
79 KB, 485x959
>>53926984
What are some good books on C I can torrent? I only want recent stuff that covers C11.
>>
>>53927351
C book that covers C11? Doesn't exist.
>>
>>53927335
>spot the beginner
>>
I want to become a master software engineer. I want to work on drivers and graphics and ML and AI.

How do I start? I know C.
>>
>>53927373
Start learning OOP. Oh wait you can't because you're a Cfag
>>
File: out.webm (219 KB, 624x288) Image search: [Google]
out.webm
219 KB, 624x288
realised I could embed comments into my world if I added a
default: output[i][j] = input[i][j]
to my switch statement

cellular automata = comfy

(accidentally posting in the wrong thread != comfy)
>>
>>53927350
Okay that makes a lot more sense. My bad if I wasn't explaining it too well.

Thanks though, really appreciate it!
>>
>>53927373
Install gentoo
>>
>>53927406
You can do OOP in C, there's just no reason to.

>>53927419
Next?
>>
File: Sams Teach Yourself C11.jpg (22 KB, 372x400) Image search: [Google]
Sams Teach Yourself C11.jpg
22 KB, 372x400
>>53927357
Then explain the existence of this.

I can't find a torrent of it.
>>
>>53927373
do Computer Science. Scientists build monsters, Engineers build bridges for them to break.
>>
File: Carmack-Rift.jpg (49 KB, 610x347) Image search: [Google]
Carmack-Rift.jpg
49 KB, 610x347
>>53927406
>drivers
>OOP
>graphics
>OOP
>ML
>OOP
>AI
>OOP
>master software engineer
>OOP
>>
>>53927432
Don't read books, just use google "C11 new features" and learn shit from there. Books are tedious and almost always inaccurate.

>>53927440
OOP is the way of the future, you're a backwards fag if you don't accept that
>>
>>53927335
I am a beginner :) plus the thread asked what I was working on so I posted it.
>>
>>53927100
Use a real language.
>>
>>53927440
Software engineer is another way of saying dignified business slave

Of course OOP is going to be the cornerstone of development
>>
>>53927451
OOP for drivers?
>>
>>53927054
Indent your fucking code.
>>
>>53927451
Only an idiot uses the same tool for every job.
>>
File: linus-torvalds.jpg (16 KB, 221x336) Image search: [Google]
linus-torvalds.jpg
16 KB, 221x336
>>53927451
>OOP is the way of the future
it's been 'the way of the future' since the 80s and it's only made our software slower, buggier, and less maintainable

fite me irl
>>
>>53927432
Well maybe you should buy it. Or just learn from a C99 and read up on the changes to C11 online. There are less than to C99. Most important is threads (just a library) and variadic macros (which are a bitch anyways.

>>53927353
Sounds boring desu. My CS program is shitty but at least we have Automata Theory and Operating Systems. They are 5000 level courses, but you'll have plenty of time to take them senior year.
>>
>>53927475
Yes.

>>53927485
OOP isn't a tool, it's a way to structure your programs so that they are easier to maintain/refactor.

>>53927495
Then explain why Java is the most widely used programming language? Surely it wouldn't be if it caused so many problems...
>>
>>53927453
>working on

This is hello world pretty much. How about learning some data structure, eh? Use a for loop btw :). A while loop is useful for bool functions or validators.
>>
I'm getting a CE/CS double major. Am I cool yet?
>>
>>53927502
>OOP isn't a tool
Retard.
>>
>>53927518
Nice ad hominem you got there buddy, it really helps your case. In fact, I'm beginning to think you're right!
>>
>>53927502
>popular = good
he's doing it
he's really doing it
>>
>>53927351
C in a nutshell
>>
>>53927543
Actually, popular = good is self-evident. Nothing becomes popular if it isn't good in some way. The term "good" is very black-and-white too. I'll admit Java has disadvantages, and so does OOP but you don't see too many huge companies maintaining a C codebase for business logic.
>>
>>53927531
You don't know what you're talking about so it isn't worth arguing. Are you even aware of the massive overhead that OO causes?
>>
I'm trying into maths to help with understanding how machines process information. But I don't really understand how to generate a PDA from a language.

How would I take something like pic related and generate a PDA or Grammar?
>>
File: Bob_Saget.jpg (16 KB, 230x316) Image search: [Google]
Bob_Saget.jpg
16 KB, 230x316
>>53927567
>Actually, popular = good is self-evident
>Nothing becomes popular if it isn't good in some way
>he thinks businesses choose languages based on how good they are
>he thinks businesses let programmers choose their languages
jesus christ
>>
>>53927500
I got it from the library, so I'm definitely not buying it, but I want a permanent copy.


>>53927451
Cfag.blogspot.com is way worse than a published book.
>>
>>53927567
Well the thing is I am reading a book on C to learn the operators and what not so I want to know how to use it before I do, that is why I do cheesy useless programs. DESU I am a complete noob so what do you mean when you say "data structures"?
>>
>>53927516
You better ME/EE/CE/CS or else no jobs ever.

>>53927502
setting up drivers is often a lot of procedures where procedural code works just fine. Why would you OOP that?
>>
HELP Is there any way to do something like this in C++?
>>
>>53927544
Thanks I found a torrent.
>>
>>53927577
>What are C++ zero cost abstractions
It is you who doesn't know what he's talking about.

>>53927602
Can you maybe extend your thinking beyond one step? Businesses may not let their programmers choose the language but that's because businesses that didn't use something "business scale" (like C or whatever) failed quickly. Businesses that used stuff like Java and C# stay afloat because their codebases are actually possible to maintain once they grow.
>>
>>53927602
uhhh who else would make those decisions? the CEO?
>>
>>53927643
>>>/stackoverflow/
>>
>>53927647
>C++ zero cost abstractions
A fancy word for macros.
>>
>>53927670
Still provides you with OOP with hardly any overhead. You didn't do anything to further your claim.
>>
File: [ELECTRONIC MUSIC].gif (498 KB, 320x240) Image search: [Google]
[ELECTRONIC MUSIC].gif
498 KB, 320x240
>>53927647
>C++ abstractions are zero cost
>businesses that didn't use something "business scale" (like C or whatever) failed quickly. Businesses that used stuff like Java and C# stay afloat because their codebases are actually possible to maintain once they grow.
holy jesus shit these people exist in the world
>>
>>53927643
yes, there's a way.
>>
>>53927681
Those are only in C++ so it doesn't justify that fact that OOP has massive overhead. In fact it furthers my claim because it takes special compiler optimisations just make things normal speed.
>>
>>53927687
which is...
>>
>>53927696
Ok look you faggot, post the fucking resources for whatever this is so I can do it. I need this. Please
>>
>>53927683
There's probably only a few of them, plus hating C has been a meme for a while now. Being a proponent of Oracle / Java is new though.
>>
>>53927683
You've literally only made posts quoting things I've said and making some surprised comment below them. Why don't you use both of your brain cells and actually refute any of my claims?

>>53927700
Granted, but Java is still one of the fastest languages (due to special compiler optimizations, sure, but compiler optimizations are pretty much necessary for any kind of performance-critical programming)
>>
Sorry to bother you with my stupid questions, /g/, but I think I fell into pointer hell and it got me stuck. Working on an assignment with the following class (well this is what's relevant right now anyways) :
 struct vertex; struct adjVertex{ vertex *v; int weight; }; struct vertex{ int ID; std::string name; int district; bool visited; int distance; vertex * parent; std::vector<adjVertex> adj; }; struct queueVertex{ int distance; std::vector<vertex *> path; }; private: std::vector<vertex> vertices; 
UNFORTUNATELY, this is made a lot harder because I'm limited to this single class. (CS is definitely a meme) I'm having some trouble with my BFS and I don't think I quite understand what to pass
 //some bullshit about finding the location in verticies where the search term lies, sLoc, and confirming the search terms exist { Graph n; queue<vertex> q; q.push(vertices[sLoc]); vertices[sLoc].visited = true; while(!q.empty()){ vertex s = q.front(); q.pop(); for(int i = 0; i < s.adj.size();i++){ if(s.adj[i].v->visited == false){ s.adj[i].v->visited == true; cout << s.adj[i].v->name << " "; q.push(s.adj[i].v); //Doesn't want to compile because of this line } } } } 
I can't figure out what I should be passing from the adjacency list in order to keep going. Seems to be the only line, and I'm pretty sure my algorithm is fine. I'm not sure what it's pissed at me about. "Graph.cpp|152|error: no matching function for call to ‘std::queue<vertex>::push(vertex*&)’|" Any wizards able to see where I'm being retarded?
>>
File: bjaaaaaaaaaaaaaarne.jpg (105 KB, 603x324) Image search: [Google]
bjaaaaaaaaaaaaaarne.jpg
105 KB, 603x324
>>53927681
>runtime polymorphism is free
JUST FUCK MY LANGUAGE UP
>>
>>53927719
I don't hate C, I just think it's meant for certain tasks and also absolutely not meant for others. If i had to write and maintain a huge codebase for a business (which I have), I'd do it in Java. All you little fucks play on the meme of hating Java but that's because none of you have held real jobs.
>>
what's a universal turing machine? whats a turing machine? what's turing complete? i'm reading wikipedia and it's not helping
>>
>>53927726
>Java is one of the fastest languages
yeah, only if you compare it to fucking ruby
>>
>>53927742
Think of a TM as a brainfuck interpreter.
>>
>>53927726
>Java is still one of the fastest languages
In very rare cases. Most of the time it's either shit or average speed.
>>
File: 1459577085101.png (758 KB, 1280x720) Image search: [Google]
1459577085101.png
758 KB, 1280x720
307ktrips/s!

Thank you openssl!
>>
>>53927742
When a language is competent enough to do any algorithm it's given.
>>
>>53927731
I'm no wizard but it looks like you're retarded in a whole bunch of places.
>>
>>53927432
I might actually have to buy this fucking book. No one is fucking seeding. Fucking fags!
>>
File: Untitled.png (2 MB, 1680x1050) Image search: [Google]
Untitled.png
2 MB, 1680x1050
why is coding fun?
>>
>>53927746
Can you please do some research before spewing hearsay? The optimizations that the JIT compiler does can beat the performance of C code (in some cases, don't have an autist rage about this statement)
>>
>>53927758
Why do you care about optimizing hash generation
>>
File: tmp_31226-157836240843733.png (291 KB, 750x366) Image search: [Google]
tmp_31226-157836240843733.png
291 KB, 750x366
>>53927731
Jesus what the fuck happened
Anyways here is a hastebin I guess

http://hastebin.com/apocewecuw.cpp
>>
>>53927763
can you make a turing machine out of wood?
>>
>>53927778
Looks better. I still think the main thread window should be filled in correctly
>>
>>53927732
Saved.
>>
>>53927790
When you can supply a steady current through a piece of wood let me know
>>
OOPfag here, I'm done arguing with you autistic hivebees, it's past 10 so I'm going to go to bed now so I can wake up to go to my job. See you all in tomorrows /dpt/!
>>
>>53927784
>why are you so happy about anything
>why arent you a miserable piece of shit like me

go away
>>
File: Untitled.png (1 MB, 1680x1010) Image search: [Google]
Untitled.png
1 MB, 1680x1010
>>53927798
liek dis?
>>
>>53927818
Non-transparent
>>
>>53927779
>C compilers, which generate native code, don't have optimizers
>inb4 static loop unrolled java run time vs rolled c run time
>>
scraping nba data to find a shit player, tweet at the player saying something mean. nba.com is a pain in the ass to work with, 3/10 would not recommend.
>>
>>53927818
Oh god of earth and altar, what the fuck is this
>>
File: Untitled.png (715 KB, 840x1010) Image search: [Google]
Untitled.png
715 KB, 840x1010
>>53927825
ooohhh. liek dis!
>>
File: anime-confused-gif.gif (574 KB, 500x281) Image search: [Google]
anime-confused-gif.gif
574 KB, 500x281
God dammit /g/, I've having a mental crisis.

I'm not sure which meme language I should learn: Rust or D. D has awesome meta programming but a shitty GC. Rust has safety but at the cost of complexity.

I'm really torn, so I'll do the only rational thing: dubs decides which language I learn next.
>>
>>53927841
Yeah and consider choosing a color scheme that blends well.
>>
>>53927779
Okay, how about you do your fucking research then you mong

have you ever taken a look at any of this high performace java code? Tell me how much object orientation you see in it
see if you can find a single non-static and non-final method
>>
>>53927848
haskell
>>
>>53927848
japanese so you can talk with your waifu
>>
>>53927848
Nim
>>
>>53927731
>>53927786
I'm being a nice guy here, this isn't really the type of shit you should bring to /dpt/. your code is absolutely hideous, why are you using structs everywhere in c++?

anyways you're trying to push a vector pointer (vector*) into a queue of vector objects (queue<vector>)
>>
>>53927841
Yeah that's better. Easier to look at
>>
>>53927849
how does that not blend well? It's 4chan's colors.
>>
>>53927848
Why learn a meme language?
>>53927855
lol
>>
>>53927790
mechanical logic using wooden components should be doable

just don't overclock it, or you'll give woodscrews housefire a new meaning
>>
>>53927855
oh shit lol
>>
>>53927832
browser #112
says so right there in the titlebar :^)
>>
>>53927861
I meant use a single color scheme for the back tiles and the page. It would make it look like less of a clusterfuck.
>>
>>53927848
lua
>>
>>53927848
In a way I kind of like the way D's garbage collector is super shit. It teaches you that the best heap management strategy is not to use the heap at all

I'd say learn both. Rust has some fucking spooky levels of static analysis, but that comes at the cost of a more complex type system to learn. D's metaprogramming is absolutely dizzying - you can get most of your high level abstractions out of the way at compile time and generate the same code as if you'd written it all C-style
they're both pretty great to know, so you can be a smug cunt and point out missing features in other languages
>>
File: Untitled.png (2 MB, 1680x1050) Image search: [Google]
Untitled.png
2 MB, 1680x1050
>>53927883
well one man's clusterfuck is another man's... um, wait I had something for this.
>>
>>53927857
Sorry anon. I usually hate writing code this unorganized but graphs kinda blindsided me and it's been frustrating trying to figure it out.

I figured it out though guess I just needed someone to call me an idiot.
>>
What table in Oracle stores the NULL column that appears in the describe query? This is for an assignment.

Is it Nullable? because that displays as Y/N not "NOT NULL"
>>
>>53927941
sorry, nullable was the column from all_tab_columns...

Is that the table I'm supposed to use?
>>
>>53927798
anyway, the reason for not filling it in is so you can see the more of the tiles while you mouse around.

a big, solid window covering the grid kind of defeats the purpose.
>>
>>53927848
Intel x86 Assembly
>>
>>53927848
MIPS x64 Assembly
>>
>>53927848
Verilog
>>
>>53927963
fuck this
learn amd64

having to push args onto the stack for function calls is shit
in 64 bit you pretty much never have to do that, because you have 5 fucking billion registers
>>
I want to conditionally enable openmp so as not to cause errors on older compilers with no openmp.
It seems to compile fine, but is it portable?
#ifdef _OPENMP
#include <omp.h>
const unsigned NUM_CORES = omp_get_num_procs();
#pragma omp parallel num_threads(NUM_CORES)
#else
/* No OpenMP support! Defaulting to single-thread mode! */ ();
#endif
{
/* parallel code */
}
>>
>>53927986
B-but... you're post ends in x86
JUST LOOK!

Besides, my next roll was:
>>53927975
>>
>>53927848
D get
>>
>>53927848
Java EE
>>
File: when the d on point.jpg (14 KB, 250x377) Image search: [Google]
when the d on point.jpg
14 KB, 250x377
>>53928011
OH SHIT
>>
>>53928022
damnit, I was looking for something better

I was too late to suggest Malboge
>>
File: c++.jpg (105 KB, 768x1024) Image search: [Google]
c++.jpg
105 KB, 768x1024
>>53927855
>>53928022
>>53928011
okay anon you're either learning japanese, java EE or D

have fun
>>
>>53928034
>>53928043
can I still reroll for Malboge?
>>
>>53928054
I don't know I don't make the rules
>>
>>53928054
oh, I know why I didn't get...
It's Malbolge!
https://en.wikipedia.org/wiki/Malbolge
>>
>trying unity
>more confusing than I think it should be

Does anybody in this thread have any experience with Unity? Speficially, Unity2D?

I'd like to test out a simply thing I have where a box can move up, down, left, right, or diagonally; and when it collides with a "solid" (that's the other object/sprites name) it gets forced back.

In C I could make a function where I have the x, y, w, and h of two boxes and return true if any intersect eachother. In this I am unable to do that, rather, I did try making a function like that, but it didn't work as intended.

Unity's scripting is C#, and I know Java, so it's not too different in syntax. But i'm having a really hard time getting something this simple to work, it's almost like it's too simple for unity to comprehend lol.

Any ideas?
>>
>>53927983
module fpadder(clk,reset_n,start,sign,ain,bin,result);
input clk,reset_n,sign,start;
//input [1:0] opin;
input [111:0] ain,bin;
output [111:0] result;
reg [111:0] a_reg,b_reg,result;
reg [96:0] addtemp;
reg [2:0] state;
reg adone,findone,ovrdone,addexp;

parameter LOAD=2'b00,ADD=2'b01,OVR=2'b10,FIN=2'b11;

always@(posedge clk)begin
if(reset_n==1'b0)
state<=LOAD; //load a and b regs state
else if(state==LOAD && start==1'b1)
state<=ADD; //add the two numbers state
else if(state==ADD && adone==1'b1)
state<=OVR; //handle overflow state
else if(state==OVR && ovrdone==1'b1)
state<=FIN; //output the results state
else if(state==FIN && findone==1'b1)
state<=LOAD;
end

always@(posedge clk)begin
if(reset_n==1'b0)begin
//result<=112'd0;
a_reg<=112'd0;
b_reg<=112'd0;
end
else if(state==LOAD)begin
a_reg<=ain;
b_reg<=bin;
end
end

always@(posedge clk)begin
if(reset_n==1'b0)begin
addtemp<=96'd0;
adone<=1'b0;
ovrdone<=1'b0;
addexp<=1'b0;
end
else if((a_reg[111]^b_reg[111]==1'b0) && state==ADD)begin
addtemp<=a_reg[95:0]+b_reg[95:0]; //add the two FP mantissi
adone<=1'b1;
end
else if((a_reg[111]==1'b0) && (b_reg[111]==1'b1) && state==ADD)begin
addtemp<=a_reg[95:0]-b_reg[95:0]; //subtract the two FP mantissi
adone<=1'b1;
end
else if((a_reg[111]==1'b1) && (b_reg[111]==1'b0) && state==ADD)begin
addtemp<=b_reg[95:0]-a_reg[95:0]; //subtract the two FP mantissi
adone<=1'b1;
end

else if(state==OVR)begin
ovrdone<=1'b1;
if((a_reg[111]^b_reg[111]==1'b0) && addtemp[96]==1'b1)begin //if there is an addition overflow
addtemp<=addtemp >> 4'd4; //shift right by 4
addexp<=1'b1; //add plus one to the exponent
end
else if(a_reg[111]^b_reg[111]==1'b1 && ovrdone==1'b0)begin
addtemp<=~addtemp[95:0]+1'b1; //take twos complement of subtraction
addexp<=1'b0;
end
end
end

always@(posedge clk)begin
if(reset_n==1'b0)begin
result<=112'd0;
findone<=1'b0;
end
else if(state==FIN)begin
result<={sign,(a_reg[110:96]+addexp),addtemp[95:0]};
findone<=1'b1;
end
end

endmodule
>>
>>53928069
unity is a full engine, which means that's already implemented somewhere within it

there's OnCollisionEnter and OnCollisionExit, but I think you might have to add a rigidbody for that, which you may or may not want to do
I would suggest asking >>>/vg/agdg
(or posting your code)
>>
write a function that turns a list of lists into a list in your favorite language
>>
>>53928069
It was a long time ago since I used it but of I remeber right. In unity you don't need to script collision detection. You can add the rigidbody and physics2d property to objects trugh the ui.
>>
>>53928109
there really isn't any code to post, why rigidBody where there is boxCollision2D and OnTriggerEnter2D() and OnTriggerExit2D()?

I've tried asking in agdg a couple times, got no replies, and any replies I did get were people in the same boat as me or people promoting their own game/engine.
>>
>>53927848
Racket
>>
>>53928146
I don't really know anon

I think /agdg/ really is a better place to ask, because no one here knows anything about unity
>>
>>53928133
List finalList = new List();
for(int i = 0; i < listArray.length; i++){
finalList.addAll(listArray[i]);
}

t. pajeet
>>
>>53928190
I figured as much but it was worth I try, I really hate to make a post in that thread when it is after 600+ posts so i'll have to try my luck when I get home to see if there's a new thread and someone willing to walk me through it
>>
>>53928166
seriously 8 functions deep is ridiculous

i bet you make a shit ton of one-time-use functions too

don't make fucking minced meat spaghetti code fucking retards
>>
>>53928069
unity is shit and has shit physics
>>
>>53928268
^this

i'm trying it though because I assume it will be easier to release a game

i've been working on an simple engine for a long while, but it's not ready yet and I am approaching my endgame
>>
>>53928133
list.flatten!


>>53928268
found the ksp player
>>
>>53928291
>simple engine for a long while
w-what language?
>>
>>53928268
Lol how do you fuck up physics
>>
>>53928291
my endgame as in I need money
>>
>>53928303
they purposefully make it bad so that you have to purchase assets to fix it. like the keycodes are strings, that's just ridiculous

either that or they're really this incompetent and are just arrogant enough to market a general purpose game engine
>>
>>53928133
list.SelectMany(i => i)

ideally you aren't so retarded that you just need the list and actually have something to do with the items in the flattened list
>>
>>53928250
Oh looks like I came back to the thread right on time.
Yeah, it's ridiculous. The person who wrote most of it is some old white EE who left the company a month ago.
I ended up condensing it down a bunch and in return fixed some soon-to-be bugs, reduced memory usage, made it actually fucking readable, and made it faster.
EEs should not be aloud to program.
>>
>>53928365
allowed*. I need to sleep. I've seen too much shit today.
>>
>>53927990
That should be fine as long as you don't get the pid or something inside the scope.

You can skip the #else part by the way and just write that comment saying "Single threaded by default, OpenMP if available"
>>
>>53928365
>EE
what
>white
?
>>
>>53928392
Electrical Engineer?
>>
What is the best resource to learn Android?
>>
>>53928392
Electrical engineer.
And old white people are horrible programmers. They're stubborn as fuck, have an attitude, and write terrible code.
>>
>>53928401
how do you know they were white then?
are you saying jayquon tyronius can't be an electrical engineer
you raciss
>>
>>53928421
https://developer.android.com/training/index.html
>>
>>53928422
I've worked for old white guys who don't know C. Have to bring in an intern to write it for them.
>>
>>53928442
>https://developer.android.com/training/index.html

I want the holy grail of Android books or resources
>>
>>53928462
Android moves so fast that they are all really out of date.
>>
>>53928429
people of the darker persuasion are generally not fluent in electromagnetism, no
>>
>>53928481
Exactly even those ones on the main developer Android site are out of date! What am I suppose to do?
>>
>>53928492
https://developer.android.com/training/index.html
This site is a living, breathing resource. If anything is not going to be out of date, it is this.
>>
>>53928484
All my EM teachers were Indian or Pakistani
>>
>>53928460
Oh hey, that sounds like the exact scenario I'm in right now.
The problem is the guy actually tried to write stuff and I was silly enough to build on top of some of it.

He managed to separate if statements into single use functions, while also creating unreadable one liners in other places.
He would also intentionally go out of bounds, barrage the USB host with malformed packets, and use magic numbers everywhere. Nothing was commented, of course.
>>
File: Pw5.png (67 KB, 1920x1080) Image search: [Google]
Pw5.png
67 KB, 1920x1080
>>53927432
are there any other books I should have in my collection of C?
>>
>>53928605
Jesus are you going to actually read one of those? One book is probably enough to learn the damn language.
>>
>>53928605
>600kB rar with a PDF

That's got virus written all over it
>>
>>53928605
Just read K&R to learn C, and then look around elsewhere for C code that's actually sane.
>>
>>53928605
K&R teaches you the C language, but I don't like Ritchie's archaic examples of cute, obfuscated code.
>>
File: PwR.png (54 KB, 1920x1080) Image search: [Google]
PwR.png
54 KB, 1920x1080
>>53928643
Somebody else compilation, I just downloaded it
>>53928649
pic related
>>
File: umaru a winky.gif (1011 KB, 500x500) Image search: [Google]
umaru a winky.gif
1011 KB, 500x500
>tfw you passed a negative number as an index and you didn't even notice

Just C things~
>>
>>53928715
>being a shit programmor
>>
>>53928779
this

you should generally be using unsigned for indexing anyway
>>
so can anyone please tell this noob how functions where you use variable.function() instead of function(variable) works?

how would I set something like that up?
>>
Anyone here knows bash or could help me out with a simple problem >>53928826 ?
>>
>>53928820
variable.function() is generally done by passing a reference to variable as an invisible first parameter (or it's just a namespace and you don't need to do that)

how do you mean set that up? are you writing a compiler?
>>
>>53928820
That's called a member function.
The compiler usually has some kind of abstraction layer where it literally passes in a pointer to itself, but it hides this from the user.

You can fake it in C, but you still have to pass in the pointer, which makes it kinda pointless.
something like...
typedef struct bloated_obj {
void (*function1)(struct bloated_obj *self);
...
} bloat_t;

/* inside some constructor */
bloat_t variable;
variable.function1 = &some_function;

...
variable.function1(variable);


yes, it's dumb
>>
>>53928886
no wait
/* on stack */
variable.function1(&variable);
/* on heap */
variable->function1(variable);
(*variable).function1(variable);
>>
>write python script that solves functions for variables utilizing regex a year ago
>go back to community college for this semester, tested into babbies first algebra class a long ass time ago
>bitch ass professor gives us 24 hours worth of homework per week
>say fuck that and solve everything using python script
>get assignment back today
>marked down to 10/25, accused of copying answer from back of book
>tell 'em that I wrote my own program to do it for me, point out several different problems where I had different notation but was still correct (want to tell her that I also don't want to waste an entire day every week doing this shit, but hold my tongue because not autistic)
>says "WELL THAT'S COMMENDABLE BUT IT WON'T HELP YOU ON THE TESTS"
>shoot back "well when you finish grading my test you'll see I aced it"
>know deep down I aced it because this is literally 7th grade math
i wish i didn't need a fallback degree in comp sci in case my startup doesn't work out

thanks for reading my blog, i'm going to go kill myself now because im mildly inconvenienced by a dinosaur and a broken system that has lost sight of it's intended purpose.
>>
>>53928886
>which makes it kinda pointless.
no, the main point is dynamic dispatch.
>>
Do even companies even pay better in the US for on-site jobs? I've been looking for a remote job since i live in a third world country and holy shit, they pay immensely for programmers.
>>
>>53928938
show your work/the steps dumbass
>>
>>53928938
>not autistic
lad...
>>
>>53928938
>i'm going to go kill myself now
thank you for your service to society
>>
>>53929017
What's the point if I still have to feed the member function it's own variable?

Also, you should be using vtables unless you like the idea of having hundreds of copies of the same function pointer bloating up your structs and eating your memeory.
>>
>>53929017
are you the OOP guy from before?
>>
What reputable learn-it-yourself coding websites did /g/ use when they first started out? Currently using the free Codecademy and about to jump ship to Khan Academy once i finish the Javascript course there.
>>
>>53929050
I learned to program almost entirely by doing all the challenges on codeeval.
>>
>>53929050
those are for faggy fuccbois

just RTFM
>>
>>53927440
>master web software engineer
>golang, only has structs
>>
>>53929050
this is how I learnt everything I know
>taking the train
>some high school student leaves their C textbook and gets off
>nick it
>read it every day on the way to school
>couple of months later leave it on the train
the circle of life
>>
>>53929050

Project Euler or codeeval. I don't know how hard it is for a beginner, but don't give up so easily. Or do, what do I care.
>>
>>53929072
>>53929077
>>53929097
>>53929114
thanks for the suggestions. Not that there's really anything inherently wrong with codecademy apart from their inane attempt to try and be a cool, relatable online hangout for the younger kids I just wanted to check out other places before i stick to one website
>>
File: malcolm tucker.jpg (45 KB, 1024x768) Image search: [Google]
malcolm tucker.jpg
45 KB, 1024x768
>>53929136
>inane
you'll go far
>>
>>53929136
I tried codecadmeny once and didn't learn a thing.
They don't teach programming, just syntax.
I guess it's fine if you just wanted to pick up javascript as a web developer, but it does no favors for the beginner.
And I'm pretty sure it's a covert attempt to discourage stupid kids from "learning to code".
>>
>>53928643
not the other anon but i like to do the same, the easiest way for me to learn something is if i can draw from multiple sources
>>
>>53929159
>And I'm pretty sure it's a covert attempt to discourage stupid kids from "learning to code".
kek maybe i should start something to discourage women from "learning to code"
>>
>>53928938
>marked down to 10/25, accused of copying answer from back of book
Be glad you didn't get a zero, which is the standard for cheating. And if "solving functions for variables" (I'm assuming you mean solving a series of equations, and probably linear ones) takes you that long to do manually, then the class does have something to teach you.

And what the fuck were you expecting just writing down answers with zero work? If you're a teacher or professor you have to be trusting bordering on retarded to think that's legitimate.

>But I wrote a script, so since i didn't copy and it came from something I did, that counts.
The purpose of the class isn't the answers, autismo. It's the process. Generalizing that process once and running a list though it, (for your problem you don't even need to know how to do this if you look up the right functions/methods) is not the same as doing it. If you're so above it all it should be no problem anyway.
>>
>>53929136
There isn't anything wrong with codecademy except for the fact that it does shit to teach you programming. Thankfully I was exposed to assembly before learning anything. It taught me how the fuck a program is supposed to act.
>>
>>53929188
If we taught everyone to program the whole world would explode with shitty software. A lot of people don't know how to think or even learn how to think programmatically.

On a side note, I found a piece of software that a company released on github. I took a look in the includes folder and found this. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>>
How the fuck do i convert a multidimensional array to a jagged array? I have this array:
int[,] results ={{ 4, 7, 9, 3, 8, 6},{ 4, 8, 6, 4, 8, 5}};

I just want to be able to define both rows separately. But i have to keep the initial multidimensional array.
>>
>>53929254
cant remember the name, but theres a technique where you create lots "combined" headers in a hierarchy in order to cut compile times
they're PROBABLY using it
>>
For my bachelor thesis i would like to write a tethering app for andoid. is this a good topic to write about? Or is it "too" easy
>>
lol c#
i pulled this theory out of my ass:

new jagged-array new int [multi-array.count]
for each multi-array
jagged-array[multi-array.count] = new int[] multi-array[index-count]
.
>>
>>53929375
I don't know shit about networking etc but it sounds too simple for a thesis imo
>>
>>53929375
For a thesis I thought you had to make something, eh, original?
>>
Startup people are so weird, you know the classic new startup that wants to be the next google, the people who appear in those presentation videos and stuff they're so damn weird and strange, and weird.
>>
>tfw you get on a roll but you need to sleep because it's 3am
>>
>>53929527
iktfb
>>
>>53929390
it would include shit like: Go on the "market", see what features have free and non free apps. Maybe include some new features like bandwith limitation, monitoring, user management. Have a couple of ideas.

>>53929478
No, not necessary... Bachelor is shit anyway these days. Will doing something unique at my master.
>>
>>53929527
this
>>
File: durg.jpg (326 KB, 1440x1990) Image search: [Google]
durg.jpg
326 KB, 1440x1990
>>53929527
>>53929602
>>53929690
Sleep is for pussies. Break out the stims.
>>
>>53929709
fuck off druggie
>>
Is codeacademy good for learning more languages if you have already been programming for a couple years, or is it better to stick to dedicated pages for the language?
>>
File: Absolutely-disgusting.jpg (74 KB, 720x540) Image search: [Google]
Absolutely-disgusting.jpg
74 KB, 720x540
>>53929746
>is codecademy good
>>53929709
Eat my butt dood
>>
>>53929746

it's good for a second to see a little bit of syntax but you can't really "learn" from it very well

but if you have already been programming for a while you probably have an idea of how to learn a language already, right?

you have to write programs, basically.
>>
>>53929746
R T F M
T
F
M
>>
>>53928605

I really liked Stephen Kochan's Programming in C
>>
>>53929746
that site is shit
>>
it's like people have no sense of quality, just because things like codecademy, unity engine, python exist doesn't mean you have to use them
>>
>>53929746
The best thing you can do is to just program, find a project you want to do and just program.
You learn so "god damn butthole in jesus" much by doing that.
>>
>>53929746
If you have been programming for couple years, you should be just find with reading quickstart+documentation of given language from their official page.

>>53929802
People don't use them because they exists, people use them because they are easy and have good effort/result ratio.
>>
File: sixpackshortcutsgarbage.jpg (20 KB, 298x250) Image search: [Google]
sixpackshortcutsgarbage.jpg
20 KB, 298x250
>>53929812
in other words people are lazy
>>
File: akari eats chippus.png (131 KB, 256x256) Image search: [Google]
akari eats chippus.png
131 KB, 256x256
What kind of things can you do with this online C compiler?
http://www.tutorialspoint.com/compile_c_online.php

They literally serve you a fresh docker instance every time you reload the page.
And it has full internet access.
I wget'd my tripcode program and i'm crunching tripcodes right now.
>>
What a disgusting accent
https://www.youtube.com/watch?v=V_1IEx15QmE
>>
>>53929931
are you sure it's not just running in your browser...
>>
>>53929947
i'm pretty sure it's not running in my browser, i'm getting 424.1 ktrips/s from this online computer thing.
My c2d only goes up to 309.5 ktrips/s.
>>
>>53929937
at some points he's not even talking in full sentences, just repeating words over and over. typical poo in loo, just memorizing words and simple tasks
>>
post favorite songs about programming
https://www.youtube.com/watch?v=v4Wy7gRGgeA&nohtml5=False
>>
working on my senior project, an iOS app using aws s3 to manage and display generic media in a visually appealing way. fuck Xcode and fuck multithreading, fuckers keep racing no matter how i try to control them.
>>
>>53929991
thanks for nostalgia
>>
>>53930032
>fuck multithreading, fuckers keep racing no matter how i try to control them
RTFM DUMBASS
>>
feel the bern xd

https://www.youtube.com/watch?v=UOQb7Y5QVO8
>>
File: pol is here.webm (1 MB, 640x480) Image search: [Google]
pol is here.webm
1 MB, 640x480
>>53930129

THE J IN JAVA STANDS FOR JEWS.
>>
>>53929937
I've had so many CS classes I can understand this
>>
>>53930129
it's almost like socialism is bad lmao

Java sucks. Gotta put something programming related in there.
>>
I'm currently working on a module for 3DSlicer, but I'm not accustomed to extending existing programs.
Now, it rotates an 3d image with the mouse. What would be the most efficient way to find out how it programmatically does that?
>>
>>53930254
Does it have an API? If so, check the docs. If not, is it open source? If so, check the source docs. Lacking source docs? Start reading code. Is the program lacking API, docs, and is closed source? You are on your own.
>>
>>53927758
How did you do it?
>>

// ==UserScript==
// @name 4chan post sort
// @namespace 4chanpostsort
// @description Sorts 4chan posts in a thread by number of replies to a post
// @include http://boards.4chan.org/*/*
// @include https://boards.4chan.org/*/*
// @version 0.0.1.20150629054247
// ==/UserScript==


if (!GM_registerMenuCommand)
alert('Please upgrade to the latest version of Greasemonkey.');
else
{
function toArray(obj) {
var array = [];
// iterate backwards ensuring that length is an UInt32
for (var i = obj.length >>> 0; i--;) {
array[i] = obj[i];
}
return array;
};

function compareChildrenCount (a,b) {
if (a.children.length < b.children.length) { return -1; }
if (a.children.length > b.children.length) { return 1; }
return 0;
};

function PS_sort()
{
var reps = document.getElementsByClassName("backlink");
reps = toArray(reps);
reps.sort(compareChildrenCount);
t=reps[0].parentNode.parentNode.parentNode.parentNode;
for(i=0,x=reps.length;i<x;i++) {
var e = reps[i].parentNode.parentNode.parentNode;
e = t.removeChild(e);
t.insertBefore(e, t.childNodes[0]);
};
};

GM_registerMenuCommand('4chan Sort Posts by Reply Count', PS_sort);
};



this stopped working on my tampermonkey script, idk why. happened only after the 4.0 tampermonkey update
>>
My from scratch meme lang actually parses and executes correctly

Wow it feels like I actually did something
>>
>>53930358
but can it average 2 ints?
>>
>>53930302
>var reps = document.getElementsByClassName("backlink");
shouldn't it be quotelink not backlink?
>>
File: kill me.jpg (157 KB, 901x632) Image search: [Google]
kill me.jpg
157 KB, 901x632
>when the dream dies and you realize you'll have to learn to be /enterprise/
>aka the garbage man equivalent of computer science
>>
>>53930395
It can. That was the first thing I made it do believe it or not. Thanks a lot /dpt/
>>
I have a text file I'm parsing with lots of lines. Each line is an update to a different variable.

I want to be able to see which variables are typically updated within the same 10 line periods.

Is there some mathematical name for a process like this? I'm not sure where to begin.
>>
>>53930413
implement your language in your language and then post the code
>>
>>53930129
Kek, that retard is an anarchist.
>>
File: 6zDqjm8.jpg (3 MB, 6016x4016) Image search: [Google]
6zDqjm8.jpg
3 MB, 6016x4016
need some help with java

    public void Parser(String inputs, int x, da d, go r) throws IOException
{
String input = inputs;
String[] keyword = new String[100];
String[] commands = input.split(", ");
for(int k = 0; k < x; k++)
{
for(int j = 0; j < commands.length; j++)
{
keyword[j] = commands[j].replaceAll("\\d", "");

if (keyword[j].equals("forward "))
{
d.forward(numPluck(commands[j]));
keyword[j] = keyword[j].replaceAll("^\\s+","");
r.Record(commands[j], keyword[j], numPluck(input));
}
else if (keyword[j].equals("backward "))
{
d.backward(numPluck(commands[j]));
keyword[j] = keyword[j].replaceAll("^\\s+","");
r.Record(commands[j], keyword[j], numPluck(input));
System.out.println("j is "+j);
}

so I have a problem when I pass keyword[j] into my Record method when the command has a space after it. for example passing "forward " will not get recorded. it must be "forward" with no spaces on either side. I've tried using replaceAll and trim but none of them work. I feel like I'm missing some method that can do this. Something that can take a string like "forward " from keyword[j] and then turn it into "forward" and store it in the same spot in the array keyword[j]. Thanks in advance.
>>
>mfw find it difficult to do the easiest project euler and codeval challenges
>>
File: 1449464824502.jpg (31 KB, 373x523) Image search: [Google]
1449464824502.jpg
31 KB, 373x523
>>53930432
found one, boys

literally fuck off bernie bro
>>
>>53930441
To be fair, most of project euler isn't trivial.
>>
File: milk.webm (3 MB, 1280x720) Image search: [Google]
milk.webm
3 MB, 1280x720
Ask your much beloved programming literate anything (IAMA)

>>53929044
>What's the point if I still have to feed the member function it's own variable?
when you don't have first class methods, the "this" argument being implicit is nothing more than syntactic sugar.

>>53928715
There no such thing as "index" in C.The [] operator is syntactic sugar for a[b] -> *((a) + (b)).

>>53928421
http://guides.codepath.com/android

backup link:
https://github.com/codepath/android_guides/wiki/Home/876b9e2779111f1241d889f7bc849dfe25fd6e1d

>>53927495
but linux is (poorly) object oriented.

>>53927431
>You can do OOP in C
not completely, C is one of the worst programming languages for doing abstraction.

>>53928605
c primer plus 6th edition

>>53929931
Akari-chan, daisuki~
>>
>>53930441
Are you that beginner I told not to give up? Don't give up. Or do, why would I care?
>>
>>53930438

Maybe use substring() with string.length -1 ?
>>
>>53930438
There is no reason why string.replaceall("\\s",""); won't work
Thread replies: 255
Thread images: 49

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.