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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 331
Thread images: 45

File: dp2.png (503KB, 940x822px) Image search: [Google]
dp2.png
503KB, 940x822px
Old thread >>57707481

What are you working on, /g/?
>>
me too thanks
>>
File: 1459870215249.png (235KB, 638x360px) Image search: [Google]
1459870215249.png
235KB, 638x360px
>he uses java
>>
>>57712158
mine:
>11/27/16(Sun)09:23:29
you'res:
>11/27/16(Sun)09:28:55
>>57712094
>>57712094
>>57712094
>>57712094
>>57712094

sage
>>
>>57712211
Doesn't matter you posted way before the bump limit. Also I posted first in the previous thread.

>no anime in OP
fuck off
>>
>>57712224
>way before the bump limit.
No, I did not. Posted it at around ~305posts

GTFO you fat weeb
>>
>>57712240
Bump limit is 310. Try again next time.
>>
>>57712211
you didn't even link the thread fucktard
>>
File: 1400603680822.jpg (76KB, 284x267px) Image search: [Google]
1400603680822.jpg
76KB, 284x267px
>>57712249
>le ebin drole
>>
File: 1476490191768.jpg (42KB, 410x530px) Image search: [Google]
1476490191768.jpg
42KB, 410x530px
>>57712240
It's amazing how passionate you are about this. Kind of funny.

Has anyone here used Theano and/or other similar numerical computation libraries? I've been trying out Theano and it's been pretty great.

Automatic differentiation is awesome. Symbolic autodiff is just amazing.
>>
File: js.jpg (59KB, 437x352px) Image search: [Google]
js.jpg
59KB, 437x352px
Unemployed at the moment. Learning angular by rewriting an app. Putting off interviews.

Feels highly engineered -- but in a good way, so far. Cut out about 75% of the lines? I wonder how much overhead is going on behind the scenes.

JavaScript's philosophy seems to be "fuck it", right? Fuck it and hope the dev isn't a dumbass. Very loose.
>>
>>57712264
hiroshimoot changed it to 310
>>
>>57712158
Nothing. Because I am working on my masters in computer science and I may as well be a fucking English major now.
>>
File: 1478054423500.jpg (119KB, 777x656px) Image search: [Google]
1478054423500.jpg
119KB, 777x656px
>>57712310
Yep, JavaScript doesn't really force any philosophy on its users (comes with the same sorts of benefits and pains of C++), but some architectures work better and others worse with its object model. It's about compatibility, you could say.

>>57712356
You can get a pretty good salary if you don't do stupid shit with your life if you're pursuing an MS in CS.
>>
>>57712435
Good post.
>>
>>57712189
>he uses the highest earning language ever
Everyone else are just being hipsters
>>
File: sumerian.jpg (43KB, 550x244px) Image search: [Google]
sumerian.jpg
43KB, 550x244px
>>57712435
mods
>>
File: Progress-Maybe.png (162KB, 1920x1080px) Image search: [Google]
Progress-Maybe.png
162KB, 1920x1080px
I decided to try and get SFML.NET working on .NET core. I've made a little progress. System and Window modules compile, Window can at least display, but it's pretty dead.
>>
How do I write a data structure for a particle system where each particle gets deleted when its Time To Live expires?
Should I just iterate through it, or sort it once in a while?
Or is there a way to somehow delete elements without even checking their contents?
Maybe store TTLs in a separate, sorted-by-default data structure?
>>
File: haskell.png (786KB, 1000x1300px) Image search: [Google]
haskell.png
786KB, 1000x1300px
>>57712661
If you're looping through them anyway, you probably don't have any use for priority queues, (which would allow you to find the element with smallest TTL, choose whether to delete it if TTL is negative, and then delete it, in log(n) time).

If particles get inserted and deleted at different times, then under these assumptions your best choice would be a queue (as you iterate through your particles to update/possibly render them, delete any with negative TTL in constant time).

If you add a new particle the instant the old one vanishes, then just use an array and iterate through it - when your TTL goes negative, replace that element with your new one.
>>
>>57712737
Can a non-animefag answer my question please?
>>
File: mad.png (204KB, 500x281px) Image search: [Google]
mad.png
204KB, 500x281px
>>57712745
Can I find questions from people who aren't ingrates?

I mean, I take the time to contribute to the thread, and this is what you care about? It's a really disgusting mindset. Do you think I'm a NEET just because I watch anime? If I was a NEET, would it even matter?

People in /g/ who can actually answer your questions are a finite resource, you know.
>>
>>57712799
Relax, it was a joke.

This is why I don't like animefags, they can't take a joke.
>>
File: OP.png (3KB, 698x1284px) Image search: [Google]
OP.png
3KB, 698x1284px
>>57712835
>>
>>57712844
Your answer was shit anyway, I'm going to stackoverwlow.
>>
File: sparkle.png (233KB, 500x368px) Image search: [Google]
sparkle.png
233KB, 500x368px
>>57712802
>weebs are better at programming than me
>throw a fit because the majority of /dpt/ literally gives no shits if it's a weeb image

>>57712835
>>57712848
>>57712852
You would be a much better troll if you actually contributed to /dpt/ in the process of trolling - not that I'm sure you're able.
>>
File: 018 - UOm9Bu9.jpg (32KB, 500x368px) Image search: [Google]
018 - UOm9Bu9.jpg
32KB, 500x368px
>>57712857
>You would be a much better troll if you actually contributed to /dpt/ in the process of trolling - not that I'm sure you're able.
okay. Still saging though.

var elements = document.getElementsByClassName('postContainer');
var com = document.getElementsByName('com');
var str = com[0].value;


for(var i=0; i < elements.length; i++) {
if(elements[i].getAttribute('id')[elements[i].getAttribute('id').length-1] == elements[i].getAttribute('id')[elements[i].getAttribute('id').length-2])
str += '>>' + elements[i].getAttribute('id').substring(2) + '\n';

}
str += 'checked :^)';
console.log(str);
com[0].value = str;

>>57712211
>>57712411
>>57712799
>>57712844
checked :^)
>>
>>57712857
>He cares about "contributing" to an anonymous imageboard
Your beta mentality is why you don't have a girldfriend.
Real alpha males take what they want and then spit in the faces of those who gave it to them.

*spit*

:^)
>>
>>57712872
kek that's pretty neat
You should go back to >>/wdg/ though
>>
File: 019 - EIQS5ac.jpg (25KB, 500x357px) Image search: [Google]
019 - EIQS5ac.jpg
25KB, 500x357px
>>57712978
>>
>>57712661
it kinda depends. if you have a huge array it could be beneficial to sort it so you don't have to loop through the entire thing (because you know the index of the last live element/first dead element) and so you get fewer branch mispredictions (because you know all the first ones are live)

i believe this guy talks about the same thing here, i don't remember exactly what he said though

https://www.youtube.com/watch?v=rX0ItVEVjHc
>>
If I have a grid represented by an array, is there a prettier way to check all points touching it or do I have to do
arr[x+1,y]
arr[x-1,y]
arr[x,y+1]
arr[x,y-1]
>>
quality thread guys

what's the most efficient way to split a concave polygon into several convex ones? I just split the shape into several shapes by the lines where a point intersects two more horizontally, then do the same again with the shapes vertically. Could I just do this in 'one step' with diagonal lines?
>>
top fucking kek this spider poster nigger is so assblasted that no one is going to his thread
are you 5 anon? wtf
>>
File: 1321556631.jpg (65KB, 550x550px) Image search: [Google]
1321556631.jpg
65KB, 550x550px
So what do you guys listen to when you code?

Pic is pretty gud.
>>
>>57713034
thats legit how nintendo did it with the super nintendo. you could have a second thread reading in locations of the surrounding indices and holding them so that your array, as a scope, is smaller.
>>
>>57713077
this
https://www.youtube.com/playlist?list=PLAzGjvl9ybvcth67nXMmYqKhHmXwvKr7-
>>
>>57713011
I had an idea that might be retarded or I dunno.
Since I know the frame during which a particle expires, and I also know the indexes at which I placed the particles, can't I use that data to predict where to search for a particle in an array.
In that sense, the TTL sort of becomes the index, since there can't be multiple particles added during the exact same frame by definition.
>>
>>57713052
maybe iterate through the vertices like this and if the next vertex is on the wrong side of the last line then you've detected a concave part

http://demonstrations.wolfram.com/AnEfficientTestForAPointToBeInAConvexPolygon/
>>
>>57713097
sure, that sounds like it will work. like keep the frame number together with the particle index. then when you delete the particle you could add the freed index to another array. the array of free indices could be sorted in order to keep the particles packed compactly at the start of the particle array (or maybe the array isn't so huge that it matters if they're sorted)
>>
If programmers are so smart why don't they translate their code to machine code themselves instead of using a compiler?

pfft, programmers are garbage.
>>
>>57713052
Try this:

https://github.com/ivanfratric/polypartition

The Hertel-Mehlhorn algorithm seems to be what you're looking for.
>>
>>57713148
Because programmers are smart enough to know that time has value.
>>
>>57713052
I actually implemented an algorithm that split any simple polygon into multiple triangles.
That's not what you want tho but you might be interested
>>
>>57713162
Yeah sure, that's why they waste all that time instead of just using an IDE :^)
>>
>>57713148
If /g/ is so smart why are you still a virgin?
>>
>>57713174
no thanks

>>57713160
thanks
>>
Wait, how do I use a quad tree algorithm on an array with an odd number of indexes?
>>
File: 1474230584330.png (65KB, 1092x1037px) Image search: [Google]
1474230584330.png
65KB, 1092x1037px
>>57713185
>no thanks

o-ok..
>>
its theviacom!
>>
>>57713094
that's pretty nice anon, thanks. will try this when i wake up
>>
Say I have a matrix and if I find a number 2 I change all surrounding spots to a 2. But I don't want this to happen in a cascade like
int[] grid = int[10,10]
The grid is randomly populated by 0,1s and grid[0,0-9] is filled with 2.

for i=0;i<10,i++
for j=0;j<10;j++
if grid[i,j] == 2
set all surrounding grids x+-1, y+-1 to 2 if they equal 1

Say grid[1,1] = 2 and grid[1,2] = 1
How do I stop the next iteration from setting grid[1,2] to 2 and in turn causing grid[1,3] to be 2.

I thought of using if 2 then change surrounding to 3 then rescanning the matrix for 3 and changing them to 2. Is there a neater way?
>>
>>57713247
ye boi dat multiples of 8 my nigga
>>
>>57713177

IDEs are a pain in the ass to work with. Compiling is easier if you know how your compiler works.
>>
>>57713268
cache a list of changes to be made, and process them at the end of the search.
>>
File: 1.44mb of feels.gif (3MB, 287x191px) Image search: [Google]
1.44mb of feels.gif
3MB, 287x191px
>>57713268
My guess is any logic checking if things are equal to one before assigning would be slower than simply setting it to 2. You add conditional branching and reading in return for somewhat less writes. Your processor will already have this spot in memory in your cache anyway, so my bet is that branching is just going to cost too much compared to the gain from reading instead.
>>
>>57713323
IDEs can use any decent compiler
>>
>>57713268
use two grids, one that you read from and another that you write to
>>
>>57713323
Using IDEs is easier if you know how the IDE works :^)
>>
>>57711778
You should look at it and see why it took such a long time.
>>
>>57713399

Well it's a lot more of a pain in the ass to learn an IDE.
>>
>>57713340
I originally had a linked list to hold the coordinates of things I would change to 2 on the next iteration but the last thread posted about linked lists being bad so I tried to change it.

>>57713343
I don't quite understand what you're saying I should do

>>57713366
I guess that could work too
>>
>>57713468
I'm saying that I think the naive way is probably the fastest way worth your time. Maybe there's some tricks with SIMD extensions that the compiler doesn't know to do for you that could be applied to this.

Aaand, I just realized you were actually asking about how to make a particular algorithm correct, not fast. Oops.

Anyway, for your real question, you have a few options, but the easiest one is to make a second matrix to write to and replace it, as >>57713366 said. If you want to save memory, and have an extra bit for each int you're not using (for example, maybe none of your data can be negative, or your data is small), there's some tricks I could show you to basically store a boolean of "is this a new 2 we just created" with each element.
>>
Quad trees fucking suck.
>>
>>57713534
elaborate? how else should you keep track of local objects in a 2d environment?
>>
>>57713534
Quadtrees are awesome. What do you have against them?
>>
File: 1431828492419.gif (113KB, 210x360px) Image search: [Google]
1431828492419.gif
113KB, 210x360px
I self-learned Java up to some data structures and algorithms, but I'm getting bored of it already. What's a good programming language that's actually practical? Currently eyeing Python. (or I might just learn Web Design, maybe some CSS or something to keep things interesting)
>>
If I want to write a 3D RTL implementation, how do I find the largest square inside an arbitrary raster blob?
Is it an np problem or something, because I can't think of a solution that doesn't take like a quajillion checks to iterate the whole possibility space for each instance of all the possible positions and sizes and numbers of squares there can be in an arbitrary data set.
>>
>>57713575
>I self-learned Java
you fucked up anon
>>
>>57713458
>>57713458
ruby, i have a hardware question for you.
its the hi ruby guy that drew a pic of you recently.


if you compile a program with the vectorized option on does that make the time betweens calls like arr[4][7] = 7 and arr[5][7] = 7 shorter than if it weren't compiled with the vectorized option on? i know the vectorized option on hardware is quite common, it may not have been too common before but it is now, so I've got to wonder if this is something people know about.

Like, I would imagine this would place the data table in a spreadsheet format and make calls between particular dimensions in an array contiguous through the use of two iterators or maybe a threading of them ( since calls to the table would be a "vertical" iterator, maybe "horizontal" if the array were to not be modeled as a physical graph, and the second iterator would move to model movement in the opposite direction. The original issue being collisions in the stream. ).

Have you worked with the vectorized option before?

This is how i assumed they always worked but some of the latest posts about grids have me second guessing that understanding...

my computer is kaput right now so im brainstorming as much as i can
>>
>>57713592
It's fine, I had fun anyways.
>>
>>57713587
What's a RTL?

What's a "Raster blob"?
>>
>>57713600
err not in the opposite direction but more like the other latice.

"your life is a latice...ermm lettuce"
>>
File: pic.png (10KB, 785x403px) Image search: [Google]
pic.png
10KB, 785x403px
>>57713609
I mean RL.
Run length encoding.

"Raster blob" means a set of continuous identical data in 2D space.
Like a red circle.
>>
>>57713077
r/a/dio, Shibayan or Alstroemeria Records.
>>
>>57713677
oh, i had to solve that problem once. I just brute forced the whole thing. You can at least do it in parallel.

You could also break the whole bitmap up into a quadtree of all the sections that are completely black. After that it's much faster to compute the biggest rectangle you can fit inside.
>>
>>57713575
C, C++ or Go. Also Python, if you don't care about performance.
>>
>>57713600

I'm assuming by vectorized options, you are referring to something equivalent to SSE vector instructions? If so, then consider the fact that arr[4][7] and arr[5][7] are not adjacent memory addresses, so you can't load them simultaneously with a vector load/store. If it were arr[4][6] and arr[4][7], you might be able to get some multiple load/store instructions if they were aligned right.

And I don't think I've used any compiler optimizations dedicated to vectorization directly. I normally just -O2 or -O3 and call it good. I have worked with SSE intrinsics though for a class, and they are a pain in the ass.
>>
File: 1441085098990.png (27KB, 512x323px) Image search: [Google]
1441085098990.png
27KB, 512x323px
>>57713730
First time I've heard of Go. C and C++ seem so boring to me so I might just go with Go. Probably seems too spoonfeed-y but any suggestions on a project to work on with Go? Just a general idea would be nice.
>>
>>57713642
maybe lattice wasnt the word either...
>>
>>57713592
>>57713730
don't listen to these fags, enjoy learning the highest earning programming language ever with guaranteed jobs
>>
>>57713787
First go through https://tour.golang.org . https://godoc.org for library documentation.

As for a project, not sure what to suggest. Go is very good for writing servers, so maybe something web-related.
>>
>>57713740
turns out it was the sse instructions.
it also turns out that they function as grouping operations rather than as a way to generalize movement over the data table. id already figured out a good way to work with code that way too. ill give it a try on paper and see if it makes sense in conjunction with whatever practical unserstanding i develop for the use of the sse intructions. i really wanted to turn an n value traversal after an initial m value traversal ( m, n ) with a follow up call for a ( m+1, n ) traversal into a ( m, n ) to ( m +1, 0 ) traversal. I figure since the ram is stored out of a circular disk now it would be possible with a simple transfer of voltage but i guess source and destination values would create a bad port.
>>
If I have an ellipse how do I position a number of points on the edge of it, in a way that each adjacent pair has the same circumference 'allocated' to it.
So for instance if I had two points I could place one on each opposite end of each other.

When I have a third I don't know how to place the two other points after I've placed the first one.

Doesn't have to take arbitrary position for point 0 but it would be nice.
>>
>get an idea to compress texture data by converting RGB to LAB color and shrinking the color components and putting them in a quad tree
>half-write the implementation
>find out I just re-invented a shitty version of jpeg
>consider suicide

Fuck programming, everything you want to do has already been done better.
>>
>>57713896
Pretty interesting. I'll just scour Google for sample projects I can get into. Thanks a lot.
>>
>>57714012
What was your ultimate goal? Did you really think you were going to come up with a better form of lossy image compression than what already exists?
>>
>>57714012
The trick to making new things is finding methods used elsewhere and applying them together in a way never done before.
>>
>>57714046
Well, I'm using .TGA images for my shitty vidya gaym because the format is very easy to work with, basically a big honkin block of RGB values one after another, sometimes run length encoded.
But the texture file size was outrageous for such a small game, so I decided to implement 2D run length encoding to make it smaller.
Then I noticed that my particular art style lends itself well to LAB color compression, since I use big swathes of uniform color. Perfect for run length encoding.
So I started working on it. While googling for more info, I discovered how JPEG is done.
And here I am.

I think I'll just finish it because if I included a JPEG library, 99% of my vidya game code would BE the jpeg library, and it makes me feel weird to include a huge library that only gets used once during program startup.
>>
>>57714097
This.
Jpeg in itself wasn't invented from scratch for instance.
>>
>>57714117
dude.

Just use png files..

>99% of my vidya game code would BE the jpeg library
As if anyone will care about 100kb extra. If you really care about the file size, most operating systems have imaging libraries built in you can use.
>>
>>57714012
you can still make a program to make anime real
>>
File: 2016-11-27-03-55-10.png (20KB, 479x799px) Image search: [Google]
2016-11-27-03-55-10.png
20KB, 479x799px
>>57713996
match the derivate values at the points that should be opposite and then use a median length when there is an uneven number of points to be allocated?

im not sure how the math goes but it should be something like the derivative of the first point should have a negative y in the second point and the derivative would be described as the limit for y of the square drawn by the points ( b( x), y ), ( x, y ), ( b( x), y/2 ), ( x, y/2 ).

Theres definitely a better way involving both rectangles there but i didnt want to rewrite the whole post. im on my phone. ill let someone more apt to the problem respond in lieu of my direct guidance.
>>
Should my tab bar object that stores its tabs in a vector pass back the current tab as an iterator<Tab> or a Tab* to bind a signal handler in a different function based off a newly created tab

I keep writing iterator and then thinking "that's pointless I could just use the pointer" and then writing that and feeling weird about the pointer
>>
>>57713996
position the points on a circle and stretch the circle to make the points fit the ellipse
>>
>>57713996
as for how to place them after them after the first has been set...try setting the second one at the opposite derivate's . and come time to set third divide the perimeter by your number of points and move the sequence of the sum of the derivates until the partial sum is equal to the value given at the time of evaluating the result of your division. Something like that?
>>
>>57714333
iterator tab would be returning the pointer so i think you'd be saving yourself a slew of calls by simply returnning pointer but I could be reading into it wrong.
>>
>>57714346
i like this solution but what does the math for that look like since the points as he had them for the circle would be suspended until the stretch was complete and then need to be reevaluated and thus we're back at square one.
>>
>>57714398
Yeah that's exactly right. The vector stores pointers to each created tab, so it all feels a little bit redundant and awkward.
>>
>>57714365
so the first point is set as red, the second purple and the third evaluation method is blue. It would be like a sieve for floating point values except not for primes. maybe.
>>
File: 2016-11-27-04-25-49.png (31KB, 479x799px) Image search: [Google]
2016-11-27-04-25-49.png
31KB, 479x799px
>>57714486
oops forgot pic related
>>
>>57714365
move along* the sequence of the sum
>>
>finally come up with the algorithm I needed by writing it down step by step on paper
>brain decides "welp, job well done" and cuts off dopamine supply
>don't have motivation to actually implement the code
Fuck my brain.
>>
>>57714426
an ellipse is just a stretched circle

>This equation means an ellipse is a unit circle scaled by a factor of a in the x direction and a factor of b in the y direction.
https://en.wikipedia.org/wiki/Ellipse#Equations
>>
>>57714458
I think the vector helps store the data in a contiguous array and allow for operations on the data without proper specification. meaning you dont have to write the code for wanting to do something to those tabs like sorting or appending each entry or replacing entry with a specific number and junk. solly things but the container was created and termed a generic for a reason. i think so anyway. ive been fired upon on my head, hit on my head
slammed on my head
strangled and blssted with all sorts of sonic weapons, for lack of a better term, so my memory gets hazy.
>>
>>57714531
make pseudocode for it and try then

keep it general and then when you move forward make it more specific
>>
>>57714532
yes, but the points themselves may be stretched into parts. how will the stretching apply this to each point under the IMPLIED condition that each point precede an allocated length that is to be arbitrated by a condition of congruency?
>>
>>57714576
inclusively or exclusively, I think it's the same but I could be wrong. Any and all corrections are welcome.
>>
>>57714576
ok so you're saying the points might stretch unevenly? yeah that's probably true i guess. but still you could probably place them on the circle while taking into account the stretch somehow
>>
>>57713996
are you saying you want to put a bunch of points on the outside of a ellipse, and have them all evenly spaced in terms of distance between them as measured along the edge of the ellipse?
>>
>>57714486
>>57714498
I like this idea. But I'm thinking a solution using the perimeter/circumference of the ellipse and its association to the major and major axis should be possible. An ellipse can be considered two bounded second degree polynomial functions am I right?
If I have a polynomial function I should somehow be able to figure out the 'travel distance' from point a to point B on the function is the distance between X number of points I place in between them points. So sum(sqrt(n, n+1)) bounded by the points where n is a rational number which increments by fraction of the difference of Ax Bx. So with smaller increments I get a more precise sum of the distance.
Sorry I'm not a math person so I don't express myself well.

It seems like a good solution. But I'm not completely understanding your solution.
And creating a 2 function polynomial approximation of the ellipse I have no clue how to do but it's possible I'm assuming.
>>
File: Screenshot_2016-11-27-13-42-58.png (219KB, 1080x1920px) Image search: [Google]
Screenshot_2016-11-27-13-42-58.png
219KB, 1080x1920px
>>57714708
Yes exactly this. Much better way of putting it.
See pic. A==B==C (or approximately).
>>
There's literally no efficient way to find the largest square that fits into an arbitrarily sized and placed circle of uniform color in a 2D image.

Or is there?
>>
>>57714727
This is pretty obvious and brute forcey... but you could just break the ellipse up into a series of very short lines and just add up the distance of all the lines between each point to find out the distance between them. The more lines the more accurate it will be. I figure you could get it arbitrarily close without an unreasonable amount of CPU work needed, but it depends what you're trying to do i guess.
>>
>>57714117
Use picopng (http://lodev.org/lodepng/picopng.cpp) to load PNG images. It adds only about 30 kilobytes to your project.

Alternatively, put your TGAs (and other resources) in a ZIP file and let the deflate compression do its work. Grab a minimalist deflate decompressor and you'll have a perfectly cromulent basic ZIP reader in <20 kilobytes. Looks more professional that way anyway.
>>
>>57714730
Inscribed circle solutions exist.
Tons of them.
Not sure what you mean though.
Reading out the shape of the circle from an array of 2D colors is just finding the center point and measuring the radius.
>>
Holy shit are you guys euro's?
This is way better than the 'OOP is good/bad' in the American prime time/aus time yesterday.
>>
>>57714770
Reminder not to derail this great thread with another discussion of whether or not OOP is bad. The answer to this is obvious, so there is no need to discuss it any longer.

Thank you.
>>
>>57714752
Like what, you start with a random point and start growing the radius 1 pixel at a time, checking if the pixels in the circumference are the same color?
That doesn't sound terribly efficient.
>>
I'm doing some exercises from /r/dailyprogrammer in Rust. I'm liking the language so far. Too bad I have to use the nightly channel in order to get clippy (static analyzer) to build.
>>
File: 2016-11-27-05-04-07.png (45KB, 479x799px) Image search: [Google]
2016-11-27-05-04-07.png
45KB, 479x799px
>>57714601
how does the eccentricity play into each point? I would think it cuts each point into a point with respect to the eccentricity, right? I say this because ultimately eccentricity reaches 1 and the shape is a circle. The higher or lower the eccentricity gies, the more of that circles length is attributed to any one psrticulsr point on that original circle. So like if the point on the circle is 1 then the points on an ellipse would be the value of the eccentricity and so the sum of the partial sums of derivates where each partial sum equals 1 would increase increase or decrease in size with respect to the eccentricity. Meaning it would take fewer or more to reach a value of 1 depending on the eccentricity and thus any lengths to be made from these partial sums would be made up of a set of values that are differentiable as values that equal the eccentricity of the shape in question.

Something like that, right?

Someone correct me if im wrong please. Im still
>>
>>57714789
Of course, we all know OOP is shite.
>>
the largest square you can fit inside a circle is always the same size in proportion to the radius of the circle.
>>
File: mane.png (100KB, 1603x664px) Image search: [Google]
mane.png
100KB, 1603x664px
I'm having problems with saving and printing structs in c correctly. The format of the strings I am copying with fscanf are
R1 Fre 17/07/2015 18.00 FCN - SDR 0 - 2 3.211
Don't worry about the formating in the print, I am only printing to check if it is saved correctly. I am running the function 198 times, because there are 198 games(4 in each round).
The only thing that seems to be printing correctly is that name of the first 30 rounds. Can anyone spot where I am messing up?
>>
>>57714798
Depends on if the array is cluttered or not.
It's a problem suited for parallelism so you can do it on the gpu. And when you're on the gpu you really have boundless power since you could do it hundreds if not thousands of times per second without issue.

Personally, if 'clean' (solid color vs white or something). And ideally I'd know where it is. I'd walk in from the left/right where it is and find the outermost edge. Assume the distance is the radius.

If unclean and I _just_ know the color I'd scan the image in some worst case optimised way (maybe I know it's at least 3 pixels radius so I'd scan every third row). Then do a blind linear bounce around the circle at different angles a and eventually determine the maximum length I found. Seems a good enough approximation.

There's many ways.
>>
File: pic2.png (29KB, 783x881px) Image search: [Google]
pic2.png
29KB, 783x881px
Pic related.
>>
>>57714900
So you want to find the biggest circle you can fit in a contiguous section of colour in a bitmap?
>>
>>57714900
quadtrees is the best way I can think of
>>
>>57714916
Yes.
Then that circle would be subtracted from the section, creating several smaller sections, for which the process repeats recursively until I get the resolution I need. Like minimum circle diameter = 16 pixels or something.
>>
>>57714814
yeah so like d is the hypotenuse to half the square inscribed and the two sides can be found by using the laws attributed to isoceles triangles. i cant remember the specifics for some reason.

anyway its late, early again?, i should go to sleep.
>>
Hi there!
I just started learning PHP and it's AWESOME, it's my first programming language as I have experience only in HTML and CSS. Looks like you can do (nearly) everything you want. The only downside is that you must put a semicolon at the end of every line and I'm not quite used to that.
Any advice for php noob?
>>
>>57714956
>hey guise, jerking off is cool, BUT i don't want to clean after
>any advice xD
>>
File: pic3.png (5KB, 715x460px) Image search: [Google]
pic3.png
5KB, 715x460px
Wait, how do you even tell if a section of pixels is even continuous in a non-trivial case?

I think I've bitten off more than I can chew.
>>
>>57714956
good bait
>>
>>57714935
yep, i did this myself a few years ago, but reducing it to rectangles.

I did a somewhat brite forcey thing that worked fine for me.

I just creates a list of all the possible triangles that could fit inside the bitmap.

Then I sorted them all by area.

Then I started iterating over the list, and check if any triangles were completely black when I check them on the bitmap. If they were, then I added that triangle to a new list of rectangles, and i turned all the pixels inside that triangle in the bitmap to white. Then I kept going down the list of triangles doing the same thing.

The new list of rectangles contained a list of all the rectangles needed to make up the black contiguous areas of the bitmap.

I think you could make the whole thing more efficient by using a quad tree to work out if a triangle was completely black or not, but I didn't bother because the code was fast enough already. I also was able to make it multithreaded by fucking with it a little bit.
>>
>>57714956
Go on with PHP. Once you start learning another language, you wish you could travel back in time and kill Rasmus Lerdorf.
>>
File: 1480253223764.png (15KB, 715x460px) Image search: [Google]
1480253223764.png
15KB, 715x460px
>>57714990
>>
>>57714828
>aflaeskampefunc
>uafgjortekampefunc

Some people run their source code through an obfuscator before they release it, but I've never seen anyone obfuscate their code as they write it.
>>
>>57714966
just cum on yourself and put it back in your pants
>>
>>57714990
you need to check every single pixel of the continuous block. Check one pixel, then check all the pixels touching those pixels, and then do the same for those pixels and so on. There's some algorithms online that talk about this shit. "paint-fill" algorithms or something.
>>
>>57714956
HTML and CSS are not programming languages.

PHP is good for backend stuff, but you will end up writing a lot more for the functionality of your scripts when you compare it to Python or Ruby on Rails.
>>
File: Capture -real.png (8KB, 485x310px) Image search: [Google]
Capture -real.png
8KB, 485x310px
If I have a matrix like this, and I am at 0,0, those numbers show the number of steps I need to get at a particular tile from the origin.

I manually drew the chart, how would I go about programming it? I can't find a programmable pattern.

Is there a mathematical formula which gives me the number of steps, if I were to input a coordinate (O(1))?

Best algorithm to find the shortest path? I have an implementation of BFS but it's cripplingly slow at a matrix size > 30.
>>
>>57714990
Check for convexity vs concavity.
>>
>>57715026
That's what I said!
>It's my first programming language as I have experience only in HTML and CSS
>>
>>57715012
It's danish, how would you have wrote it?
>>
>>57715047
in english, retard
>>
>>57715047
in english
>>
>>57712158
I strongly believe there should be Ritsuko
>>
>>57715071
>>57715077
I have been told to write this program in english, I would have wrote it in english normally.
>>
>>57715047
I'm Swedish.
I would have written in English.
Lay off the booze and speak a real language danskjävel
>>57715094
I'd object to writing in other languages than English. Ask for motivation. But if you have to you have to.
>>
>>57715094
it is good to write code in english because it's the standard for communication in the business and international programming scene, you'll hit the widest demographics. It also has all of the jargon and good, short and concise verb/noun combinations.
>>
>>57715105
>>57715113
But can you guys spot whats fucking up my struct?
>>
>>57715198
translate to english, first
>>
How do you guys keep yourselves programming instead of just playing videogames. Honestly this applies to life too and my serious lack of motivation lately
>>
>retard tries to solve an np-hard problem, the thread
>>
>>57715261
just start the editor turn off the game and program?
or force yourself to finish some tasks before you allow yourself to play video games
>>
>>57715261
Just stop playing games. If you really have a problem, play computer games some other place or time in the day than your allocated programming space or time.
>>
>>57714990
What do you mean by continuous? Do you mean compact?
>>
>>57715281
>someone will reply to this bait
>>
>Want to do something with a vim plugin
>Documentation is succinct, to say the least
>Thinks "that's fine, I'll just try figure out how to do this from the source code"
>grep for what I'm looking for, get a single match
>A function is defined somewhere in the source code but never called anywhere
>Can't for the life of me figure a way to do what I want

Whew, never thought I was so shit at reverse engineering something
>>
>>57715261
You need a good scare. Imagine where you'll be in 5 years if you keep going on like you're going. You'll be in some shit their job and poor as shit and not be able to look back on anything you are proud of. All that time you could have created something, learned something.. that you just spent playing some video game.

Every day you don't change is a day closer to that reality.
>>
>>57715403
http://geoff.greer.fm/vim/#realwaitforchar
>>
>>57715261
Deadlines keep me in my seat, even if i half ass things on the deadline i regret it a lot and tell myself i shouldn't fuck around so much and do things responsibly.
>>
Why isn't there a fucking image format that's just
[width]
[height]
[pixeldata]
?
I don't need your fucking bullshit headers, fuck off.
>>
How do I multiply a struct with something in c is it just structname->x * number?
>>
>>57715442
Even when I fuck up deadlines I tell myself it'll be different next time and then I pull the same shit
>>
>>57715453
http://tools.suckless.org/farbfeld/
>>
Is it possible to remove the prev_arg variable?
use std::collections::HashMap;
use std::env;

fn main() {
let mut whitelist = HashMap::new();
whitelist.insert("white", vec!["purple", "red", "green", "orange"]);
whitelist.insert("red", vec!["green"]);
whitelist.insert("black", vec!["black", "purple", "red"]);
whitelist.insert("orange", vec!["red", "black"]);
whitelist.insert("green", vec!["orange", "white"]);
whitelist.insert("purple", vec!["black", "red"]);

let args: Vec<_> = env::args().skip(1).collect();

let mut prev_arg: String = String::from(""); // shoo shoo
for arg in args {
if prev_arg != "" {
if !whitelist[prev_arg.as_str()].contains(& arg.as_str()) {
println!("Boom");
return;
}
}
prev_arg = arg.to_string();
}

println!("Bomb defused");
}
>>
File: received_1222203014498530.jpg (6KB, 180x180px) Image search: [Google]
received_1222203014498530.jpg
6KB, 180x180px
Art faggot here... Just developing an interest in coding and shit so starting with GML baby language to learn. It's a different world than I'm use too.
>>
alright /dpt/ help me write my bash script here

I have a folder full of subdirectories and I want my script to

>visit folderA
>do something
>visit folderB
>do something
>...

can someone provide the skeleton for that?
>>
>>57715605
for i in *; do
cd "$i";
do_thing();
cd ..;
done
>>
>>57715590
what is GML even?
>>
>>57712158
>best girl edition
Thanks.
>>57715590
Try Processing. It works really well for all kinds of artfaggotry. https://processing.org/
>>
I fucking hate Evangelion
>>
>>57715653
I don't believe you. No one hates Evangelion.
>>
>>57715631
> Game Maker Language
It's babyish but its a good starting place. Im trying to get more into the mind set. I was never all that great with math in school so I have so catching up to do.
>>
I am writing a program in c that reads inputs from a file. In this file there are numbers written as such 3.567, how do I make my program ignore the . and just save 3567?
>>
>>57715453
But dear anon, width and height *are* header data. And is the image RGB or RGBA? Boom, more headers.

The only image format with no "fucking bullshit headers" is just a raw array of pixel data and you already know the image width and height and bytes per pixel count because all that has been stored elsewhere. Not a very general-purpose format. And that format exists already: RAW. Nothing but raw image data in whatever format you want.
>>
File: 1458941173654.jpg (116KB, 1280x720px) Image search: [Google]
1458941173654.jpg
116KB, 1280x720px
>>57715624

for i in *; do


>cd a file
>file is not a directory
>do thing you're not supposed to do in the main folder
>cd back
>repeat until you're in /
>>
>>57715707
Actually, you're right.
The only header data should be width.
Height can simply be calculated from width and file size.

And the width should be stored in the filename so that there's no headers and only pixel data.

I'm a genius.
>>
>>57715697
>open file
>use replace on notepad++
>save

:^)))
>>
>>57715743
>
int n = 0;
for (int i = 0; i < strlen(str); ++i) {
if (48 <= str[i] && str[i] <= 58) {
n *= 10;
n += str[i] - 48;
}
}

Can you explain what you are doing here?

>>57715772
Without cheating anon.
>>
File: le giga baka.jpg (76KB, 500x375px) Image search: [Google]
le giga baka.jpg
76KB, 500x375px
>>57715644
>used goods
>best
>>
>>57715697
while ((c = fgetc(f)) == '.');
>>
>>57715843
I am gonna need and explanation, for how this works
>>
>>57715261
Switch to Linux. Hardly any games work there.
>>
>>57715823
Eva milfs are way better than Asuka and Rei, you fucking giganigger.
>>
>>57715855
It ignores '.' characters by continuing on to the next character whenever it sees one.
>>
>>57715870
Could Insert that line in my fscnaf?
>>
File: le jiggy jigaboo.gif (2MB, 480x270px) Image search: [Google]
le jiggy jigaboo.gif
2MB, 480x270px
>>57715868
>liking roasties
>calling others giganigger
>>
>>57715764
And who fucking cares about compression? Multiple gigabyte images are no problem these days.
>>
>>57715876
fscanf is deprecated. Only use fgetc and fgets to read files.
>>
>>57715858
theres hedgewars which i havent installed but it looks like a real time sink
>>
File: 1476525660892.png (493KB, 1280x720px) Image search: [Google]
1476525660892.png
493KB, 1280x720px
>>57715878
>using shitty /r9k/ memes
>disparaging anyone
>>
I'm reinventing the internet, using phone lines:

http://github.com/collinoswalt/modem
>>
>>57715731
for dir in */; do
pushd "${dir}" || break
# ...
popd
done
>>
>>57715899
>deprecated
Can you explain why?
>>
>>57715932
Why not spawn a sub shell?
>>
>>57715527
Can I store farbfeld in gpu memory and decompress it in gpu memory
>>
>>57715928
>http://github.com/collinoswalt/modem
is that you in this vid? https://www.youtube.com/watch?v=WrDbnvUK76s
>>
Should Muslims be banned from programming?
>>
>>57715953
Why would you spawn a sub shell?
>>
>>57715993
Like that you cd in that subshell, and you're sure that main shell isn't affected by cd
>>
>>57715984
Should /pol/tards be banned from /g/?
>>
>>57716020
Trump won my friend. That means all 4chan boards are /pol/ now
>>
>>57716020
/pol/ can program.

/g/ can't.
>>
>>57716026
i'm not your friend, buddy
>>
>>57716010
Oh right, didn't think of that. But that code should work fine too.
>>
>>57716026
Where did this meme come from?
4chan had no interest in politics up until very fucking recently, and even then, it's cause niggers like reddit and breitbart sent their faggotry over to us.
I mean Jesus Christ, even /pol/ was more about jewish conspiracy rather than mainstream politics.
>>
>>57716044
i'm not your buddy, guy
>>
>>57715975
Yes, why? It's a couple years old. I think I was 19 when I recorded that video
>>
>>57716056
>4chan had no interest in politics up until very fucking recently
How new can you possibly be?

>even /pol/ was more about jewish conspiracy rather than mainstream politics.
>was
>>
>>57716070
I was just curious. Neat project guy
>>
>been here since before /pol/ and /new/ were a thing
>newfags call me a newfag
is it time to go
>>
>>57716054
Probably but you'll learn that subshell are awesome because it handles scoping too.
>>
What's an HList?
>>
>>57716111
Scala? It's a heterogenous list; a list-like structure that can accept elements of multiple types.
>>
>>57716111
HList provides many operations to create and manipulate heterogenous lists (HLists) whose length and element types are known at compile-time. HLists are used to implement
>>
>>57716129
So basically what almost every other language calls a regular list?
>>
>>57716129
so ArrayList<Object> in java?
>>
>>57716133
>are used to implement
>
I see what you did there
>>
>>57716074
Thanks! I won a $50 gift card at my community college's science fair (though, it was an old project I worked on as a freshman and presented as if it was new). I now want to improve the code (I was a freshman, and this was the first project I had worked on) and create a better receiver using an arduino and a piezo element, so I can then read the serial data as a /dev/ file in linux and essentially make my arduino into a modem.

Then, I want to set up a google voice account and have a server running which will send data like this via the telephone (maybe make a bbs board using this). I have an internship with a company that does the backend of phone systems (the automated menu systems, etc.), so maybe I'll learn a bit there. The goal is to be able to dial a server like it was 1985 and connect to that using only the phone lines and completely circumvent the internet (though I'm sure modern telephone systems are sending voice data through some kind of network nowadays).

Finally, I want to improve the standard so that I can use a few bits/bytes of data at the beginning of a transmission to tell the modem when to start demodulating, because right now it kind of relies on the transmission beginning at precisely the correct time.

Potential uses:

1. Hobbyists, first and foremost
2. Internet capabilites in areas with no wireless signal, but with phone capabilities (Dial a server which will `curl` whatever webpage you request it to and converts it to KC (Kansas City) format and sends it to you), and then view it in lynx or something
3. Nutjobs who are paranoid about the NSA watching their traffic, but they're listening to your phone calls as well so only end to end encryption will solve this. At best this will obfuscate your traffic
>>
>>57716111
Don't use Scala

https://www.youtube.com/watch?v=uiJycy6dFSQ
>>
>>57716138
Well, that's what you get from a static, strong type system (which all type systems should be; dynamic / weak typing a shit).
>>
>>57716159
>paulp
>admitted he would rather be an alpaca farmer than write code
>>
>>57715029
Turn your board into a graph (as in graph theory graph not xy plot) and square the adjacency matrix
>>
>>57716158
you are going to fly high, no lie.
>>
>>57716167
It sounds like static typing struggling to provide what dynamic typing gives you for free.

Python doesn't complain or make me jump through hoops to put elements of different types in a list.
>>
>>57716173
What's wrong with that?
>>
>>57712158
Would a VPS provider (DigitalOcean) care if I use a vps to bruteforce hashes?
>>
>>57716192
It means he has llamas on the brain and so we shouldn't trust anything he says about any other topic.
>>
>>57716186
>Python doesn't complain or make me jump through hoops to put elements of different types in a list.
That's also why it's shit. It's trivial to put different types in a list in any decent statically typed langugae, but the times you actually would want to do this are exceptionally rare.
>>
>>57716211
He simply points out facts about Scala's insanely broken type system and core libraries.

The fact still stands that Scala should be avoided in favour of better options regardless of how you feel about this man.
>>
>>57715029
>>57716176
Sorry, looking further into it it's not that simple
http://mathworld.wolfram.com/GraphPower.html
>>
>>57716205
no
>>
Is md5 good for checking to make sure data sent is the same as data received? I know it's insecure for encryption, but I just want to verify data
>>
>>57716213
That's only because your types aren't precise enough.

Text representations of two different things? Let's give them both type String! I'm sure nothing will go wrong, like accidentally transposing a server password and an email subject. That's obviously completely different to accidentally using an integer instead of it converted to a string.

Static typing today is hypocrisy.
>>
>>57716255
yes
>>
>>57716255
The odds of md5 collision are very low. If you're really unsecure combine md5 and sha256.
>>
>>57716238
alright good, one last question is it possible to make a webpage trigger a python script, input options into the script, then the script to output information to the webpage? if so what would I google to find out more about it

planning on making a website that cracks hashes
>>
>>57716229
>better options
Such as?

If you're restricted to the JVM, there are none.

If you're not, enjoy Idris, I guess.
>>
>>57716272
>That's only because your types aren't precise enough.
what's because my types aren't precise enough?

>Static typing today is hypocrisy.
Example?
>>
>>57713862
this
java is pajeet-tier but it is an easy mode in terms of getting a job
>>
>>57716287
>alright good, one last question is it possible to make a webpage trigger a python script
eh, yeah. If you run the python script on the server hosting the website that's pretty easy. In Fact you can host the website in python.
>>
Wait a second.

Why the fuck does every image format have its own compression algorithm and data layout when all images could just be raw data put inside on of the million existing compressed file formats whose fucking job it is to compress data?
>>
>>57716288
F#, OCaml

>If you're restricted to the JVM, there are none.
I guess. If you're stuck with JVM you're pretty much fucked whatever you do.
>>
>>57716295
>what's because my types aren't precise enough?
Wanting to put things of different types into a list being rare.

>Example?
I just gave you one...
>>
>>57716319
>you can host the website in python.
alright I'll google about this and making websites interact with python scripts - thanks for all the help anon
>>
>>57716330
>F#, OCaml
Do they have dependent types?
>>
I literally can't think today.
Sitting here staring at a bunch of nonsensical scribbles trying to come up with a solution to a problem I can not even formulate properly.

Do I have brain damage?
>>
>>57716331
>Wanting to put things of different types into a list being rare.
It is rare. When you you want passwords and email subject as separate items in list? That would be idiotic in any langugae and I've never seen it.
>>
>>57716350
To some degree yeah.
>>
>>57716367
It's called a hangover.
>>
>>57715590
>Art faggot
why not just go to /wdg/ and make websites?
>>
>>57715527
Just a shittier BMP
>>
>>57716367
Try caffeine
>>
>>57716404
Drank 5 cups today.
>>
>>57716432
haha us coders
>>
>>57716380
Then they may have a future, if they can fix multithreading and add HKTs.
>>
>>57716448
multithreading is already fixed. They don't need every feature to have a future, they just have to be better than the alternatives.
>>
>>57716460
That's going to be difficult if they don't have the basics.
>>
>>57716460
C++ has futures.
>>
>>57716464
>HKT
>Basics
ayyy

>>57716467
yes anon
>>
>>57716432
You should be worried about brain damage
>>
Dependent types master race:
Definition U : Type -> nat -> Type :=
fix f (U : Type) (n : nat) {struct n} : Type :=
match n with
| S n => U -> f U n
| 0 => U
end.

Definition sum : forall n : nat, U nat n :=
let f :=
fix f (accu : nat) (n : nat) {struct n} : U nat n :=
match n with
| S n => fun x : nat => f (x + accu) n
| 0 => accu
end in
fun (n : nat) => f 0 n.

Eval compute in sum 3 4 7 1 : nat.
Eval compute in sum 2 4 7 : nat.
Eval compute in sum 7 4 7 1 5 6 8 9 : nat.
>>
>>57714900
but why?
>>
>>57716432
5 cups of pure caffeine would kill an elephant
>>
>>57716505
pedant
>>57716502
I come up with arbitrary problems and try to find solutions for them because I am an art-programmer.
>>
>>57714990
what? just walk over them and check if they're contiguous
>>
>>57716500
Hvilket språk?
>>
>>57716529
What?
>>
>>57716522
i don't think the solution will be very elegant. but you should be able to solve it more or less with brute force in a reasonable amount of time because of the limited resolution. oh, just an idea: try scaling it down to a lower resolution first to the point where it's trivial, and then scale it back up in iterations until you reach full size again
>>
>>57716545
Which language?

(Kan du ikke snakke norsk??)
>>
>>57716432
3 cups is more than enough for me, not a good habit, 4+ cups daily would end up being counter-productive
>>
>>57716557
the rooster
>https://coq.inria.fr/
>>
Should i learn to use gdb?
It's so annoying.
>>
>>57716582
Takk
>>
>>57716599
nah

some devs swear by debuggers but imo they're not needed and there are many programmers who don't use debuggers

http://wiki.c2.com/?ForgetTheDebugger
http://lwn.net/2000/0914/a/lt-debugger.php3
>>
>>57716633
>your language doesn't have a debugger
>awkwardly work around it
>spend 3x longer fixing any problems
>y-you don't need a debugger, guys
>s-stop being more productive than me
>>
I was happier when off the meds
>>
>>57716643
you probably write fucking awful code if you have any significant problems with your code that you can't fix easily
>>
>>57716647
Nice blog.
>>
>>57714531
push yourself, faggot
>>
File: 1461388282016.png (736KB, 1050x870px) Image search: [Google]
1461388282016.png
736KB, 1050x870px
>>57716666
Delete this post
>>
>>57716633
A visual debugger, like Visual Studio has, i great,
but gdb being a command line tool is not user friendly, imo.
>>
>>57716666
>projection
>>
>>57716647
shit blog unsubbed
>>
Modem guy: I'm having trouble figuring out phone systems. Is there a service or API which will help me set up a phone answering menu? I.e: "Press 1 for X, press 2 for Y", etc.? I was thinking of running this myself, but telephony interface cards are like $500
>>
>>57716633
The more I read about Linux philosophy the more I like it. His positions about debugger and about C++ are so true.
>>
>>57716703
s/Linux/Linus/
>>
>>57716386
Havent thought about it much. I've got one I'm lurking in and have been looking into buying a book about HTML and CBS so could be something to do.
>>
Found and fixed two tiny bugs in my program. One of them critical.
>>
optimizing a website for mobile use

>everyone says use @ media queries
>I start using them to target the device sizes

anything wider than 1100px is considered a desktop... this means all iPhones see my website in mobile, all computers see it in desktop and all android phones with their UHD screens and whatnot all display a horribly formatted desktop version.
>>
>>57716814
You got it wrong anon. The question is not to know if it's a desktop or a phone, but if it's a big window or a small one. I hope you'll understand.
>>
>>57716754
>One of them critical.
oh thank allah
>>
>>57716814
shiggy diggy

at least have some mercy on 1080p portrait mode and 1024px width desktop users
>>
>>57716814
>not knowing what viewport is
>>
>>57716814
https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop

???
>>
File: cantfindparticlesystem..png (16KB, 1042x307px) Image search: [Google]
cantfindparticlesystem..png
16KB, 1042x307px
Does pic related mean the compiler doesn't know what ParticleSystem is?

I've written
import finnstr.libgdx.liquidfun.ParticleSystem;

at the top of the class, surely it should just work?

The library containing ParticleSystem is in the same folder that I'm compiling inside
>>
>>57716952
use eclipse
>>
>>57716845
Is this sarcasm?
>>
>>57716952
Sam... don't embarrass yourself, it's been 2 months and you still can't figure it out.
>>
>>57716997
im just beng playful anon~
>>
>>57715552
Not really. You could change it to:
let mut prev_arg = None;
...
if prev_arg.is_some() {
...
prev_arg = Some(arg);
>>
>>57717005
Ahaha, this made me laugh so hard, thank you anon

>it's been 2 months
At least I'm persistent, I'm not giving up

Each time I post it's a slightly different problem, I am making progress
>>
I fucking hate javascript
>>
>>57717089
this reminds me

javascript is NOT programming, it's not a PROGRAMMING language, programmers DO NOT use javascript when they program
>>
>>57717089
Literally the most fun language

Made a music visualiser when I was on acid, didn't have to worry about syntax or compiling 10/10
>>
>>57717097
you gotta go to >>>/g/wdg to catch something on this bait
>>
>>57717120
>bait
if it makes you feel better call it b8
>>
>>57717026
That's all right then.
>>
File: Kornheiser_Why.jpg (73KB, 600x1040px) Image search: [Google]
Kornheiser_Why.jpg
73KB, 600x1040px
>>57716952
>>57717063
are you not using an IDE on purpose?
>>
>>57717175
>>57716973
I don't like eclipse, and I can't do what I'm trying to do in Android Studio.

>>57717005
Also, joke's on you ^^
Code runs perfectly, I just saved the wrong copy in notepad++
>>
File: 73476927.jpg (113KB, 400x400px) Image search: [Google]
73476927.jpg
113KB, 400x400px
>>57717097
You have aspergers syndrome
>>
>>57717202
eclipse neon (the latest version) is freaking good give it a chance
>>
NEW THREAD

>>57717232
>>57717232
>>57717232
>>57717232
>>57717232
>>
>>57717202
>netbeans
>intellij
>spring tool suite, which is still eclipse though
>>
>>57717221
I like eclipse neon as a text editor but not for compiling, it makes me sad
>>
>>57717107
>didn't have to worry about syntax or compiling
except you did. JavaScript developers are actually this stupid.
>>
>>57717250
how so? you just hit a button and it compiles and runs
>>
>>57717268
I'm using jni, so I have to write in java and c++ then compile files seperately

It just seems easier to use cmd, but maybe eclipse is good at this too
>>
>>57717107
>didn't have to worry about syntax or compiling
but that's bad and you're supposed to feel bad
>>
>>57714828
>>57715105
Sorry, didn't aim to just ditch you.
If this is personal then I suggest using binary file formats or defining something more rigid.

Reading format strings and envisioning data from straight text is not my strong suit.
>>
>>57717290
it worked out of the box with jni and android ndk, not sure how non-android jni would be set up without having to resort to using cancerous gradle/ant build systems but maybe it can work similarly like how it works with android ndk, it does an incremental build so it compiles the C++ code automatically before launching the app but it skips compiling if it didn't change
>>
>>57715261
I wish I find something fun. I wish I could play videogames because they bore me.
Right now I live on external motivation alone.
Maybe I can feel happy in the future. So I prepare for that.
>>
>>57715029
Let
C=column
R=row
N=the number you want

You must have R+2*C=4*K for some integer K, otherwise the cell is empty.

If 2*C>=R, then N = K = (R+2*C)/4
If 2*C<=R, then N = 2*K-C = R/2
>>
>>57717346
In the computer, check that R+2*C = 4 K by seeing if (R+2*C)%4==0. You don't really need to compute K.
>>
>>57717317
I figured it out myself, the file I was reading from was not in the correct format, it was missing the / between the dates.
>>
>>57717321
I'm using android ndk too

This does sound quite good
I'll get eclipse when I've finished my project, thanks anon
>>
File: g3-717789.jpg (75KB, 900x728px) Image search: [Google]
g3-717789.jpg
75KB, 900x728px
Quick question: i want to build from source an old roguelike for a mac osx 10.3 powerpc, is there a way to compile the source without using xcode?
Apple discontinued xcode 1.5 (which is the latest supported version for 10.3) and i cannot upgrade to 10.4 which uses xcode up to 2.5
>>
>>57717433
>>57717232
Thread posts: 331
Thread images: 45


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.