[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: 237
Thread images: 29

Previous thread: >>57445335

What are you working on, /g/?
>>
>pic that has nothing to do with programming
You stupid fuck
>>
>>57451570
>muh animu~
anon...
>>
>>57451547
So 100000000 get is coming up on /pol/. Are there any good extensions for gets or do I have to write my own?
>>
>>57451615
what did she mean by this
>>
>>57451547
This thread is better than the other thread. This is the real thread now.
>>
what's a java book
a good one preferably
i will have to study java and OOP next year and I'd like to get started now instead
i have *some* experience with C
>>
>>57451789
https://docs.oracle.com/javase/tutorial/
http://www.cs.armstrong.edu/liang/intro10e/
>>
File: 1462601264023.jpg (102KB, 490x310px) Image search: [Google]
1462601264023.jpg
102KB, 490x310px
>>57451799
many tanks
>>
File: [email protected] (19KB, 1494x286px) Image search: [Google]
screenshot-20161109@203308.png
19KB, 1494x286px
Working on my terminal emulator, managed to squeeze some more performance from insertion heavy situations.

If you consider cancer started out taking 25 seconds to do the same this is a huge improvement.
>>
To day i added metadata printout to my audio file player learner project.
I think the next step will be to go back and try to port some parts of the project to Linux.
>>
File: Capture.png (10KB, 325x179px)
Capture.png
10KB, 325x179px
Hi, if anyone can help me this it would be much appreciated. Input is an array and an int. I have to return the [i] number of the array.
Why is this not working? It's F# btw
>>
>>57451948
then and else has to be switched I know, still errors :)
>>
>>57451547
Nothing really
>>
>>57451948
Arrays start their index at 0?
>>
>>57451948
because you don't actually call the function?
>>
>>57451996
Yes, should print out:
3
"i is not good"
>>
>>57451996
You have no idea how much that bothers me
>>
File: Capture.png (11KB, 383x188px) Image search: [Google]
Capture.png
11KB, 383x188px
>>57452025
You're right, now I feel kind of stupid lol. Still errors : /

"This value is not a function and cannot be applied"
>>
>>57452048
Get used to it, unless you want to architect a new computer.
>>
>>57452100
safeIndexIf [|1..5|] 2
>>
>>57452118
>unless you want to architect a new computer.
Lua and Matlab start their arrays at 1. Both run on the same computers as everything else. What now, faggot?
>>
File: file.png (127KB, 266x295px) Image search: [Google]
file.png
127KB, 266x295px
/sqt/ wont help me so I'm trying here.
I'm retarded and never used Python so excuse me.
I'm trying to move my leddit account settings to another one, and found this https://github.com/jathu/sublet which does it for you, but I have no idea how to use it.
I installed Python and Praw, but I'm not sure what to do from here, help me out lads.
>>
>>57452146
>Lua and Matlab start their arrays at 1
They're not programming language. They're scripting language.
>>
>>57452146
>making every access operation require an extra instruction just because you can't get to grips with what everybody knows and loves
>>
>>57452196
There's no reason this couldn't be done compile time, in compiled languages.
>>
>>57452123
"The type int is not compatible with the type 'Printf.TextWriterFormat<unit>'

Why is my function even that type to begin with? I have that "arr: 'a []" which is an array. Just dont get it
>>
>>57452175
Ada allows you to specify array ranges. They must be using arcane magic, like subtraction.
>>
>>57452222
That must be really confusing for readability.
>>
>>57452169
>reddit
>>
>>57452255
How so?
>>
>>57452267
fugg u got me :DDD
>>
>>57452255
Where its used is not specifying arbitrary ranges like (2 .. 97) for an array for no reason, but specifying ranges with arbitrary ordinal values instead of only integers, and remaining type safe.
>>
>>57452273
Just harder to write idiomatic code. Increased risk for off by one errors, and harder to spot them, especially when working with someone else's code.
>>
>>57452344
Ada has the 'first and 'last attributes, so indexing errors are pretty rare.
>>
>>57452344
I mean, i would probably use 1 indexing half the time, because 1 indexing makes sense, and 0 indexing half the time because that's what i'm used to.
>>
>>57452216
Please learn the language first
>>
>>57452411
>1 indexing makes sense
It's not an index, it's an offset from the head.
That's why it's the same for pointers and relative addressing in asm.
>>
>>57452344
see >>57452325

You could represent a Schedule as an "array (Day) of Task" (where Day would be an enumeration like (Mon, Tue, ...)) so MySchedule(Mon) := Work, instead of MySchedule(0) := Work. Of course exploiting a language like's C weak typing you can have Mon basically be an alias for 0, but there's no way to enforce only allowing Mon and not 0.

The example from https://en.wikibooks.org/wiki/Ada_Programming/Types/array has an array keeping track of character counts in a text, "array (Character) of Natural", so when you encounter an 'A' you can simply do "CharacterCount('A') := CharacterCount('A') + 1"

>>57452411
Like >>57452397 says, Ada documentation generally discourages accessing an element using just the index, they advise doing Array'First + Offset. So really, you will be using "0-indexing" since you're specifying the offset regardless of where the indices actually start/end.
>>
dude dipropyltryptamine lmao
>>
>>57452454
But everyone uses, thinks of, and calls it an index.
>>
I know this is a web language, but I have a tech interview in an hour and I don't know what to review.

The place does javascript and I need to know what to review
>>
>>57452547
>in an hour

What the fuck are you doing?
>>
>>57452547
>in an hour
>just now asking for help
you're fucked
>>
File: 1464823306282.png (5KB, 270x175px) Image search: [Google]
1464823306282.png
5KB, 270x175px
>>57452547
just make sure you understand these
>>
>>57452561
Was weak typing a mistake?
>>
>>57452344
It's more idiomatic. You can index arrays in ways that makes sense to people. For example, indexing for a grid from -X..X and -Y..Y.
>>
>>57452547
review the history: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript

review the basics of types: https://www.destroyallsoftware.com/talks/useing-youre-types-good

review some unique features of Javascript: https://www.destroyallsoftware.com/talks/wat

and you should be good to go!
>>
>>57452561
jeeeesus

Some of the examples I've seen before are pretty understandable but these are just criminal.
>>
>>57452222
>>57452576
Haskell has something similar
>>
File: what.jpg (9KB, 667x69px) Image search: [Google]
what.jpg
9KB, 667x69px
>>57452574
>>57452582
>>
>>57452586
cool

Ada of course adopted this from Pascal
>>
>>57452603
Ada and Pascal are pretty good
Shame C got so popular
>>
>>57452616
C is superior.
>>
>>57452635
I like all of them
>>
File: weak typing.png (2KB, 209x18px) Image search: [Google]
weak typing.png
2KB, 209x18px
>>57452635
literally a trap language
>>
>>57452673
What is the interest of your post? Delete it please.
>>
Democracy is not ok?
Or is it only democracy and freedom when the one you want is winning?

The posts of Hillary supporters have high resemblance to the religious "When good things happen God wills it, but when bad things happen God works in mysterious ways." shit.
>>
>>57452752
Take that shit to /pol/
>>
>>57452673
get rid of the explicit cast if you really want to demonstrate "weak typing"
>>
>>57452770
This is /pol/. Just replace Java and C, or any text editor comparison, with Conservatives and Liberals, and you get the same thing.
Don't delude yourself into thinking it ain't so.

Also Python is the best programming language :)
>>
>>57452673
I'd allocate her my girl pointer, if you know what i mean.
>>
>>57452800
Stop deluding yourself, ameritard.
>>
File: trop.png (1MB, 1280x720px)
trop.png
1MB, 1280x720px
>>57452790
I think you forgot something
>>
>>57452752
Wha tthe fuck are you going on about? And what is it with your chinese-ish rhetoric? I don't mind that you be either or but what the fuck does it have to do with what you're saying or with this thread?

Anyway, I went on a hunt and got a ton of c code snippets from way long ago so I'm going to be messing with those for a while looking for old tips we might not have access to these days. Or at least may not have had access to before today.

Btw, I forgot the election was yesterday and went on as if it was all normal. Well...about halfway through the day, the pressure in my eyes and ears just went away. My computer stopped hissing and there is nothing wrong with my soundcard. WTF?!
>>
>>57452752
And if Hillary had won, we would be getting the same from Trump supporters. So what else is new?
>>
>>57452817
i think you forgot to kill yourself
>>
>>57452833
The new thing is that America is great again.
>>
>>57452850
And the rest of the world is going to suffer for it.
>>
>>57452862
literally how will any non-fag suffer from it?
>>
>>57452862
That's a good thing.
>>
File: 1469324638746.gif (743KB, 281x281px) Image search: [Google]
1469324638746.gif
743KB, 281x281px
>>57452849
y r u so rude
>>
>>57452790
Here's some weak typing
        int x;
unsigned y = 0;

for(x = -5; x < y; x++){
puts("Tick");
}
return 0;
>>
>>57452862

When America is great, the world benefits.

We buy more cheap chink shit, russian vodka, and european luxuries than anyone else in the world.
>>
>>57452862
Yes, the rest of the world will suffer from the fact that Trump will initiate a world war with Russia, Iran, the Middle East, even though the main criticisms against him are his wishes to have more favorable ties with Russia, Iran, to abandon war in the Middle East.
Yes, it makes absolute sense that people are now Google searching nuclear shelters after Trump's election turned up to calm down and shave off the edge from USA's biggest enemies.
>>
>>57452862
>And the rest of the world is going to suffer for it.

America buys more crap from the rest of the world than they do from us.

Even Ignorant niggers in African mud huts making their "peace bracelets" are thanking their gods Trump won.
>>
>>57452800
>Also Python is the best programming language :)
It is tho
>>
>>57452899
>When America is great, the world benefits.
>We buy more cheap chink shit, russian vodka, and european luxuries than anyone else in the world.

Yup. Eurofags should be thanking Allah in the streets 'Merica will be able to afford to buy their useless luxuries again.
>>
>>57452920
Who has enough money to buy nuclear shelters but is threatened by the economy Trump represents...?

What?
>>
>>57452899
>We buy more cheap chink shit, russian vodka, and european luxuries than anyone else in the world.

This.

Why else do you think the stock markets went UP today?
>>
>>57452953
Apparently lots of people have money for nuclear shelters, as shitdot seems to find:
https://tech.slashdot.org/story/16/11/09/1510219/google-searches-for-president-impeachment-canada-immigration-nuclear-shelter-skyrocket-after-trumps-victory
>>
working on a custom packet parser for reversing protocols

>tfw and theres 15 chinese in the dorm kitchen out of nowhere
>>
>>57452971
I didn't ask about impulsive behavior. I asked about actual purchases.
>>
>>57452985
there were only 2 a few hours ago
they breed so fast
>>
>>57452971
Ladies and gentlemen, bad science
>>
>>57452577
>https://www.destroyallsoftware.com/talks/wat
This is gold, thanks anon
>>
>>57452971
idk about burgerland but sweden has nuclear shelters literally everywhere in ordinary buildings and such
>>
>>57452899
>We buy more cheap chink shit, russian vodka, and european luxuries than anyone else in the world.
You also exploit more workers in third world countries and prop up the governments who allow this. Remember when Chiquita effectively owned several central and south American countries as a source for their bananas? Backed by US naval power.
During WWI when the British needed more aluninum they found the port for their Cryolite mines in Greenland blockaded by US destroyers, forcing them to buy from the US companies.
Wonderful friends to have.
>>
>>57451578
Oh, i'ts the guy who didn't read.
Fuck off
>>
>>57453022
Those are not nuclear shelters, those are burrows to escape the cold.
Swedes resolve their war issues by doing suicide instead of building shelters.
>>
>>57453043
nice meme
>>
File: Capture.png (35KB, 1029x978px) Image search: [Google]
Capture.png
35KB, 1029x978px
I need to use gitlab for a project I don't want to do. I have never used it, but here is my problem.
I managed to push my Android Studio project into gitlab server with following default .gitignore file:
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuil


My problem is that when check this project out on a new computer, I get pic related. How do I fix it.
I want to do it so that I can check out the project on any computer and continue working on it wherever I am.
>>
>>57452996
How many will there be in an hour?
My quick and dirty simulation approximates it to 63. Because i'm to stupid to solve it algebraically.
>>
>>57452169
win+r, cmd, enter
navigate to the folder you put sublet in by using the cd command.
python sublet.py <- run this command.
>>
>>57452899
Trump is against trading with other countries though.
>>
>>57453125
f(x) = ae^kx
exponential growth

initial was 2
f(0) = ae^0 = a = 2


f(x) = 2e^kx

after a few hours it was 15
lets say after 3 hours

f(3) = 2e^3k = 15
3k = ln 15/2
k = [ln 15/2] / 3 ~=~ 0.6716

f(x) = 2e^0.6716x

after 6 hours
f(6) = 2e^(0.6716*6) = 112.4768

after 6 hours there will be approximately 112 chinks
>>
Oh god I thought the interview was going to be all javascript questions so that's what I studied but it was a java interview so I royally fucked up the terminology. I mixed up a hash table with a hash map and mixed up polymorphism with inheritance

God, that was my last opportunity. I'm going to fucking kill myself
>>
>>57453439
It's ok. Both languages are shit.. But on a serious note, There are always more opportunities.
>>
>>57453439
>I'm going to fucking kill myself
there might be a queue today
>>
nogger
>>
>>57453468
there are less and less every day. I stopped applying for a week and when I came back there were like 5 new jobs. just a month ago I'd come back to 20 the next day
>>
>>57453439
how does this even happen in real life? haha

>>57453477
Queue<Person> endItAll = new LinkedList<Person>(hillary.getSupporters().add(anon));
>>
>>57453511
h1bs are probably going away
good times ahead for you anon
>>
>>57451547
MAGA
>>
>>57453515
They gave me two tests, a javascript test and a java test. I did the java test first in like ten minutes and then spent hours on the javascript section. I completely forgot the java section existed
>>
>>57453515
won't compile. Type mismatch.
>>
The worst part is they told me I held the firm's record for fastest completion of the java section, but becuase I didn't know the terminology I wasn't going to be recommended to the client

on the plus side, he said he's going to try to recommend me to another client provided I take another javascript test, but I still haven't gotten it
>>
>>57453542
Linked lists implement Queue.
>>
>>57453600
That's stupid.
>>
I need some help. I'm tired of being a lazy unproductive slob so I wanna start programming but it's hard to find motivation. I think I need a really interesting idea/project to motive me, can someone think of something?
>>
>>57453665
no
>>
>>57453665
video game
>>
>>57453665
If I could I'd make it myself.
>>
>>57453676
>productive
>>
Anybody know how's the state of bullet3d c api state?
>>
>>57453676
Doesn't seem very realistic.

Keep it coming lads. What are all of you making right now?
>>
>>57453697
>assuming there are any productive members of society in this thread
>>
>>57453623
Why? You can add to one end and take from the other.
>>
>>57452561
also
!![]==false //false
>>
>>57453439
top kek
>>
>>57453697
screw only making your own thing, honestly you will be better off contributing to projects you like and getting cred. looks great on interviews too, and you'll learn how to work with people which is more important than sheer programming ability
http://kbroman.org/github_tutorial/pages/fork.html

>>57453703
you can be well paid, but also not a productive member of society

.t nodejs dev
>>
File: hi.png (1MB, 2584x1576px)
hi.png
1MB, 2584x1576px
mods, please delete the other thread

also, Swift 3 a best
>>
>tfw don't understand prolog
>>
>>57454700
>Pajeet
>Web ide
Disgusting
>>
File: BehindPlaneSegment.png (8KB, 674x577px) Image search: [Google]
BehindPlaneSegment.png
8KB, 674x577px
How would I detect if a point is behind a plane segment?
Like this, with the red points being "behind" and the green not being behind.

All I can find online is infinitely sized plane sidedness.
>>
>>57452817
What anime is this?
>>
>>57454934
http://www.lighthouse3d.com/tutorials/view-frustum-culling/
>>
>>57454937
Don't worry: It's shit.
>>
>>57454984
But there aren't many pop culture things about programming.
>>
>>57455025
It's an edit, idiot.
The series is just literal fag shit.
>>
>>57453529
Compile-time safety is for bad developers.
>>
File: 1129294958856.jpg (40KB, 433x380px) Image search: [Google]
1129294958856.jpg
40KB, 433x380px
>>57454883
>Web ide
wat?
>>
>>57454883
looks like xcode
>>
>>57451547
well you should have voted. Voter turnout was awful.
>>
>>57455148
highest voter turnout in 2 decades
>>
File: hereyougo.gif (88KB, 10000x10000px) Image search: [Google]
hereyougo.gif
88KB, 10000x10000px
bask in my glory
>>
>>57455065
Compile-time safety is for careful developers who want to reduce cognitive load.
Run-time safety is for lazy developers because it offloads the cost of the developer making sure things are safe to run-time checks that have overhead.

No safety at all should be reserved for when compile-time safety is impossible or impractical. So really there is a spectrum between compile-time and no safety (e.g. lots of languages have some degree of compile-time safety through types but not enough to completely eliminate either run-time safety or some developer responsibility).
>>
can anyone tell me how to run up a check
>>
Any recommended java performance tools? Mostly measuring your heap consumption rather than speed

Some german boss is paranoid as fuck that my filewriter may take too much memory and prefers writing them in batches as different files, then just combine them later into one file. I'd try yo prove him oyherwise
>>
>>57455334
Also, run-time safety isn't necessarily all that safe. What happens when you fail a run-time type check in a situation where a computation is not permitted to fail?
>>
>>57452862
And then the rest of the world will get its shit together and improve itself in America's footsteps.
>>
>>57455401
If you get an unexpected failure, languages with run time checks make it easier to gracefully shutdown. Otherwise it's very likely it's going to just crash and you won't really know what happened.
>>
>>57455770
Run-time checks should be used during development to ensure that the developer is really right (in the absence of hard proof, at least) but it should be possible to also switch them off.
>>
hailstone :: [Int] -> [Int]
hailstone xs:[1] = xs:[1]
hailstone xs:[x] | even x = xs:x:(hailstone(round(x/2)))
hailstone xs:[x] = xs:x:(hailstone((x*3)+1))


what the FUCK am i doing wrong??!?!?!?
>>
>>57455782
>xs:[x]
?
>>
>>57455792
it didn't like _:[x] so i tried that. i'm trying to create a list of the hailstone sequence of an integer
>>
>>57455805
nm i'm retarded
>>
>>57455805
>>57455814
xs:[x] means you're expecting a list [xs, x]. If you're trying to destructure into the head and tail, you want x:xs.
>>
>>57455780
Yes? But it's also common to leave them in, especially if the look up time and a jump table isn't effecting your timing limits.
>>
>>57455823
hailstone :: [Int] -> [Int]
hailstone xs | (last xs == 1) = xs ++ [1]
hailstone xs | (even (last xs)) = xs ++ (hailstone(xs ++ [round((last xs)/2)]))
hailstone xs = xs ++ (hailstone(xs ++ [((last xs)*3)+1]))

check out the compile error on that. what gives?
>>
>>57451547
tfw github might be great again

ty based trump
>>
>>57455823
also, i'm trying to access the last thing in the last. if the input is hailstone [12], i want it to produce [12, 6, 3, 10, 5, 16, 8, 4, 2, 1]. i need to access the last thing in the list, not the head


....


though i just realized i could reverse it at the end

...

fuck
>>
>>57455933
You can't pattern-match against the last item in a list.

A list is simply a pair, where one element is the head of the list and the other is the tail (everything but the head). Pattern-matching splits it into those two components.
>>
>>57456094
my professors language cinnameg was unironically way more powerful than haskell for this stuff. you could even do
define half (x*2) = x

and similar. it gave me an unrealistic view of pattern matching in haskell
here's the language if youw annit lad
http://www.cs.ecu.edu/karl/cinnameg/9-0/lin/index.html
>>
>>57451547
how did he know.
Did he call and take someone else spot?

>That's not OK.
>>
>>57455933
Why is the input a list?

If you want to generate the hailstone sequence for a number:
hailstone 1 = [1]
hailstone n | even n = n : hailstone (n `div` 2)
hailstone n | odd n = n : hailstone (3 * n + 1)


Or use iterate:
f 1 = 0
f n | even n = n `div` 2
| odd n = 3 * n + 1

hailstone = takeWhile (> 0) . iterate f
>>
>>57451626
lurk more
>>
>>57452946
nope, java is superior
>>
>>57453194
>they did the math
>>
>>57451547
would a P2P chat client in python need you to port forward?
>>
>>57456361
Language doesn't matter.

If the "server" end (whichever one is accepting the connection rather than initiating it) is behind NAT or a firewall, the port needs to be forwarded. Depending upon the router's configuration, you may be able to use UPnP to instruct the router to forward a port.
>>
>>57456393
thanks
>>
>>57456157
It is an interesting point. A pattern is basically just an isomorphism, so you should theoretically be able to make a pattern out of, well, any isomorphism. The canonical example is destructuring (inverse being construction), but you could make a case for e.g. x*2 vs. x/2. Neat stuff.
>>
File: gdb io error.png (18KB, 1208x456px) Image search: [Google]
gdb io error.png
18KB, 1208x456px
Been like a year since I used gdb (linux), now trying to relearn with the mingw gdb. Am I doing something really stupid? Only thing I can think of is this it's pie but I've loaded it several times and entry point is static so it can't be dynamic right?

On an unrelated note is there a mingw equivalent to layout asm on linux gbd? Of course that'll only matter once I can actually step through the exe
>>
>>57455148
it was better than the last 3 years
>>
>>57451878
Cool, anon!
>>
If a key isn't set correctly and it defaults to another key, should that be logged or put in stderr?
>>57451547
topkek
>>
Good morning, /dpt/.
>>
File: yaruo.jpg (18KB, 400x400px) Image search: [Google]
yaruo.jpg
18KB, 400x400px
>someone stars your github repo
>>
>>57456906
mornin friend

Currently having to learn R, Scala and C++ for uni.

R for datamining and statistics, looking fun so far, did some cool plots.
Scala for writing parsers for simple languages.
C++ because i did not learn it at my bachelors and somehow we have to learn it in the masters

mostly looking forward to learn c++ because most of the cool open source projects i follow are written in it and i cannot understand dick when looking at the code. hopefully i can contribute soon.

what language are you learning, /dpt/?
>>
/pol/ pls
>>
File: 1431120150742.png (289KB, 602x330px) Image search: [Google]
1431120150742.png
289KB, 602x330px
>>57457117
>some forks your github repo
>all the commits are comments about how shit your code is
>>
>>57457406
that happened to you?
>>
>>57457406
learn to code
>>
>>57457406
But are they right about the code being shit?

Or is it just a matter of equating "this isn't how I would have done it" with "this is wrong"?
>>
PyCharm is so comfy, I just discovered you can make things custom colours

e.g. If you write BUG: Oh noes a bug in this function

you can make it all red or whatever
>>
>>57454984
no, it's great
>>
>>57457738
got only good experiences with jetbrains IDEs

only problem is that they take ages to launch on my ol' x200
>>
So I managed to get a job fixing up some mongodb/angular.js powered website and I know FUCK ALL about it. Yeah yeah, laugh it up. The last guy kept logging in and breaking shit so the guys would need to call him for "support".
I've managed to get the site back online and get the shopping basket working (paypal shit) but what is really grinding my gears is the fucker has made the search case sensitive. Which is annoying as the version of mongo on the server (3.2.something) defaults to case insensitive. So I'm hunting for where he's flipped this switch and it's driving me nuts.

Anyone got any tips?
>>
>>57458454
have you tried a case insensitive search over all the files for something that sounds like a switch? or some "equalsIgnoreCase()" method?
>>
>>57455334
>So really there is a spectrum between compile-time and no safety
This.

Personally, I prefer my language to worry about compile-time typing issues and memory management, and if I want it not to, I can do that with a keyword.

>>57453581
How in the world did you think it was Javascript and not Java?

Was it a failure to listen, or were you actually told the wrong thing?

>>57458454
>>>/g/wdg


>>57453189
>Trump is against trading with other countries though.
Oh, god. You've drank the kool-aid.

Trump is for trading FAIRLY with other countries, not giving away massive trade advantages out like candy with no recompense.
>>
>>57458469
I was searching for "caseSensitive" which was only throwing up files in node_modules/ which I'm pretty sure I shouldn't be fucking with.

Cheers for the pointer, I'll have a hunt for that.
>>
>>57458486
>>>>/g/wdg
Cheers, I'll ask them
>>
How do I avoid circular references on a 4chan thread object and 4chan post object.
Say i'm only getting a single post, how do I know which topic it belongs to?

Do I put the topic object inside the post object?
Or list of posts in the topic object which is more natural?
or both?
>>
File: 1478621818812.jpg (9KB, 216x298px)
1478621818812.jpg
9KB, 216x298px
Should I invest my time learning PHP or is it just not worth it anymore for web dev? If not what would you recommend?
>>
>>57458731
It's useful, it's just a nightmare.
>>
>>57458701
>Or list of posts in the topic object which is more natural?
This one.
>>
>>57458731
>web dev
Front end: HTML, CSS, JS and the popular JS frameworks.

Backend: LAMP stack, if you are traditional.

Go full stack web dev (both front end and back end), and you are pretty much guaranteed a job.
>>
>>57459027
so if i query the post in the database, how do i know which topic it belongs to?
how to model that one?
>>
>>57459079
By using the thread's primary key that will exist on each post.
>>
>>57458928
Can anyone tell me or link me an article why php sucks so much? Genuinely curious
>>
File: anal beads.png (12KB, 279x429px) Image search: [Google]
anal beads.png
12KB, 279x429px
There are currently over 1600 usages of "trump" on /pol/ right now.
>>
>>57459093
i know that on the database part. how about in the code? how do i model that?

So I have:

Topic
-topicId
-postLists

Post
-postId
-comment

Should I put topic id in the Post object? isn't that circular referencing?
>>
>>57459287
No, in your code, if the post is an element within a property of a thread, the post is inherently already tied to that thread.

If, for some reason, you've separated the post object from its containing thread object, then it's now orphaned.

If you want your logic objects to match your database schema, then you should use an ORM to handle that. You CAN add a threadID to each post object with the understanding that the thread may be used outside of the context of the thread it belongs to.

>postLists
Why would there be more that one list of posts in a thread?
>>
>>57459167
>fuck
>white
>when
so close!
What are you using this for? Doing some machine learning mayyyybe?
>>
>>57459368
>postLists
>Why would there be more that one list of posts in a thread?
It's a typo. Should be postList only.
I'll just do the natural model and put threadid in the post object. thanks
>>
>>57456187
because [1] doesn't tell you much about the hailstone sequence of a number
>>
File: hailstone.png (29KB, 788x230px) Image search: [Google]
hailstone.png
29KB, 788x230px
>>57459723
i got it working pretty soon after i last posted about it last night btw. the source of all my problems was misunderstanding haskell pattern matching. i just ended up reversing at the end instead and it instantly worked
>>
File: anal beads.png (379KB, 1495x883px)
anal beads.png
379KB, 1495x883px
>>57459167
>>57459396
PROMOTIONS

>Doing some machine learning mayyyybe?
Yes, soon.

Filtered out some insignificant words.
>>
File: anal beads.png (273KB, 1399x825px)
anal beads.png
273KB, 1399x825px
Apparently Japan is arguing about religion today.
>>
Is component-oriented-programming really the new meme. Why did unity and unreal have to make it popular

How do you even get a tile-based game working on that. Do you just create a fuck load of game-objects? How do you snap movement to them so that the tiles are aware of whats on them? How would you get components to communicate without having a billion "if other object has this component" checks going on? How can I have say a "this component makes other objects it touches poisoned" without having a fucking ComponentThatMakesOtherObjectsPoisonedSystem object that iterates every fucking instance of a component that uses it.

It's like seeing that shitty code people do littered with "___Manager" classes.
I want this meme to end.
>>
>>57459938
Component based design is supposed to be an alternative to "manager classes" and basic OOP. That said, if your game has graphics, a texture manager is unavoidable if you don't want to load the same texture 80000 times.
>>
>>57459867
what about my shitworld country Philippines?
>>
File: anal beads.png (276KB, 1329x821px) Image search: [Google]
anal beads.png
276KB, 1329x821px
>>57459959
No real trends, that I can see.

I'm working on a deeper analysis using the posts themselves, rather than just a fuckhuge list of words with their associated country.

I'll start storing this information in a database and analyze trends over time.
>>
>>57457199
How does one get a bachelor's without knowing C++
>>
>>57459938
component systems pre-date unity. They're the best way to do generic, complex game objects but they can be an overkill for a simple 2D game. Tilemaps should just be one object with an array of tiles contained inside. Keep in mind Unity itself isn't the best engine for 2D games in the first place, there's lots of other ones out there if you're unhappy with how it manages things
>>
>>57459993
>Tilemaps should just be one object with an array of tiles contained inside.
How would another object interact with an individual tile then

also this isnt just 2d, lots of 3d games have rigid tile-based movement too
>>
>>57460007
The backgrounds are stored in a tile array, usually just a single int referring to the tile type, and you have have another array of pointers that point to actual objects ontop of the tile like characters, items or whatever. You don't want to make every single background tile it's own object
>>
>>57459979
That's some pretty gud software you made anon
How did you do this? The "click" on the map part I mean. Did you use bing map API or something like that?
>>
>>57460108
I didn't make that software; I'm only working with the data.

I'm using Power BI for visualization.
>>
>>57460134
Ok I see, the data harvesting part isn't that hard with the 4chan API
>>
>>57459867
So why aren't the Japs using any Japanese words?
>>
>>57457117
>tfw this has never happened to me
;_;

I should probably make more stuff to put on github...
>>
stuck with math stuff,
given a ship with position p0 and velocity v0, how can i calculate the acceleration i need to apply per tick in order to arrive at a given coordinate p1 with a given velocity v1

i'e tried solving it but it turns into a clusterfuck differential equation, and i dont know how to do it with pure vector math
>>
>>57460272
you want a constant acceleration?
>>
File: giphy.gif (4MB, 350x366px)
giphy.gif
4MB, 350x366px
>>57457117
>its a bot
>>
>>57460338
nope
>>
>>57460379
it seems like you would have a ton of possible solutions then
>>
>>57460394
do help, im not really a math guy
>>
>>57459991
We learn C/Java/(JS/PHP) mainly, most other stuff are elective courses

I head that they teached C++ instead of Java a few years back people were too stupid and so they switched.

My first semester also is some years ago and i just head that they now do Processing instead of Java

lol
>>
>>57459991
Why would you need sepples in uni?
Usually it's C + asm for low-level courses like compilers, OSes, networking... and Java for high level courses like OOP, algorithms, parallel programming.
>>
>>57460989
>C + asm for low-level courses like compilers
brings back memories yo. we wrote it in java but it was very fun to do. type checking was a bitch but you learn a lot

we wrote a compiler for a very simple programming language (https://homepages.thm.de/~hg53/cb-ws1415/SPL-1.2) to ASM
>>
>>57460989
going into simulation heavy environment, you will need to learn c++.

most scientific libraries are written in c++, you have qt and overall its the best compromise between performance and project time.
>>
I just realized what sepples means.

I feel dumb.
>>
>>57461070
We did something similar, it was a compiler for a subset of C written in Java.

>>57461136
I guess that's true, but simulation is pretty uncommon in bachelors programs where I'm from. We have 3-year bachelors degrees so they're a bit bare bones compared to US degrees.
>>
>>57461170
at least you're not bjarne
>>
I downloaded some books but havent started them yet, fug
>>
>>57459938
you can program whatever you want even in those engines like make your own tile array or something
>>
>>57460272
calculate the velocity from the acceleration, not the other way around, if you want a certain velocity then set the velocity according to whatever function you want (if you don't want constant acceleration you can do pretty much anything)
>>
>>57459938
At least it isn't OOP
>>
This thread won't die
>>
>>57459938
What others said, but pair it with Data Oriented Programming. While it has a speed advantage (better use of cache) the approach can be used to break free from the let's make lot of objects stuff.

The best design is the one which is optimal for a given problem. Don't just assume that you need to do everything like it's done in some shitty Java OOP class.

>How can I have say a "this component makes other objects it touches poisoned" without having a fucking ComponentThatMakesOtherObjectsPoisonedSystem object that iterates every fucking instance of a component that uses it.

There are multiple solutions to this problem. You need to decide on the maximum capabilities of your system before designing it, at least you should have an approximate vision. You can't have some overall generic system which solves all of your problems. No such systems exist. Generic design is only good for a certain extent then it has to be specific.

There are multiple solutions to your problems. One would be using a hierarchical tree so you only need to traverse the object and it's sub-objects you touched.
Another would be to use an event system with categories. For example there is a separate list or layer if you wish for objects which can be poisoned with a target selector. Depending on how you implement it these will happen:
1. All objects which are poisonable will check if they're the targets.
2. You have something like a hashmap of all objects so the even will be specific. You could cache commonly used objects (for example a player in a certain area will pretty much send events to the same objects.)

>How would you get components to communicate without having a billion "if other object has this component" checks going on?
Lot of that can be automated. Don't manually do the checks, make a system.

Honestly, these are ideas from the top of my (tired) head. I would recommend reading a game design book so you can get some ideas from actual engines.
>>
File: DELET THIS.jpg (47KB, 1280x720px)
DELET THIS.jpg
47KB, 1280x720px
>>57464269
the OP pic got deleted, what more could you ask for
>>
>>57464697
Your pic is breaking the same rule OP's did
>>
File: 1478720823544.png (584KB, 836x678px) Image search: [Google]
1478720823544.png
584KB, 836x678px
>>57464713
your post is off topic too
>>
>>57464747
Stupid frogposter, go back to france. or reddit.
>>
So a friend made a simple python chat client (server.py client.py) me and a friend are learning python so we want to add to it we're adding encryption, username support and fixing a few bugs - now as for the encryption we want something easy to add for us and easy for the users to remember so we plan on having it client>ROT>affine>server I know it's not really that strong but does anyone have something else we should consider?
Thread posts: 237
Thread images: 29


[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.