[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: 358
Thread images: 34

File: CLLGenwWgAAZAVv.png (68KB, 600x367px) Image search: [Google]
CLLGenwWgAAZAVv.png
68KB, 600x367px
Web devs are retards edition

Discuss the failures of MongoDB and whatever shitty JS framework that is the flavour of the month

Old: >>55889160
>>
>>55896311
>tfw want to learn programming
>start with Python
>get bored after learning basics
I guess programming is not for me
>>
>>55896320

> not using C

degenerate
>>
Third for C++
>>
>>55896320
>learning Python as your first programming language
Learn a better language and learn more than just the basics
>>
>>55896311
Now put the average internet speed on the graph.
>>
Why is The Elements of Programming Style out of print when The C Programming Language is still in print? I really want to read it but it doesn't seem as readily accessible as K&R is where I live.
>>
So, the code guidelines of my collab asks me to keep the line length under 80 characters. It's a little strict, but it's alright, when I'm coding in C I do that anyway. However in Python that seems a little difficult as you can't add line breaks everywhere (just between arguments for example) which drives me fucking insane desu. So how the hell do I format python code?
>>
>>55896751
Had similar problem with coworker last week.
We compromised on increasing the limit to 140 (I still think its too little).
>>
>>55896766
But the code guidelines of my collab asks me to keep the line length under 80 characters. It's a little strict, but it's alright, when I'm coding in C I do that anyway. However in Python that seems a little difficult as you can't add line breaks everywhere (just between arguments for example) which drives me fucking insane desu. So how the hell do I format python code?
>>
>>55896491
If web page sizes increase proportionally to the internet speed, you have gained nothing.
>>
>>55896491
Not an excuse

There's people with slower connections, data caps and you are also wasting server resources for no good reason except incompetence and laziness
>>
boring thread
op is retard
>>
>>55896320
Python is shit desu. I tried to learn programming through Python a few times and it never clicked for me. Then I learned C and fell in love.

https://www.youtube.com/watch?v=F3ntGDm6hOs is pretty good. The rest of the channel has like 500+ hours of programming a game in C from scratch.
>>
Reminder thag c# is the best beginner language

>Clear syntax
>C-based
>Has All oop principes
>Is type safe
>Excellent IDE (inb4 muh bloat)
>Intellisense
>Has a lot of Resources to learn from
>Welk documented
>Can use in unity, xna, and other engines.
>>
>>55896320

Good. If you don't find programming interesting, you should probably look into a different career path. Maybe civil engineering or graphic design may be more your style.
>>
File: something.png (6KB, 492x376px) Image search: [Google]
something.png
6KB, 492x376px
>>55896888
Trips confirm.

Speaking of which, what's the easiest way to do pic related there?
>>
>>55896751
>>55896766
You add brackets. Like
if (illustration['component_id'] is not None and
illustration['component_id'] not in visited[illustration['type_id']]['components'] and
illustration['component_id'] != 0):
>>
>>55896888
Agreed.

>>55896908
What do you mean? As in setting up the objects or what?
>>
File: I am not a clever man.png (44KB, 245x187px) Image search: [Google]
I am not a clever man.png
44KB, 245x187px
Beginner. Made a base converter in Python.
http://pastebin.com/epvS6mca
I feel like I've been calling myself a beginner for too long but this thing took me three days to make and it was labelled "easy" on the Pro/g/ramming Challenges.
Definitely not as easy as listing prime numbers.

>>55896320
Try getting a book you can leaf through while lying in bed.
Not a PDF file. A real thing with paper between covers.
That's what I did: Java for Dummies, C++ programming in easy steps, Beginners guide to Python, etc.
Think I overshot my abilities when I bought SICP, though...
>>
>>55896863
>Then I learned C and fell in love.
This so much. Programming in python feels like a chore, nothing makes fucking sense, everything just works either way, it gets super slow and every abstraction comes at ridiculous costs. You never know what actually happens under the hood. With C you get some intuition what the best way of doing things is, with Python you just have no fucking clue whether some object is really what it looks like or really some blown up data structure that triggers twenty CPU operations and ten memory accesses when you are just looking at it. To me that's no fun at all.
>>
>>55896888
I don't think you should use an IDE when you start to learn programming. You understand much more what's actually going on if you do everything yourself.
>>
>>55896943
>just have no fucking clue whether some object is really what it looks like or really some blown up data structure that triggers twenty CPU operations and ten memory accesses when you are just looking at it
Alt+F12 on the object, jesus
>>
Is it true that Haskell can't give you a straight pseudorandom integer like
random (1, 10)
or whatever?

I googled it really quick and all the answers were talking about monads and I/O and shit

If that's the case, then whew: meme language 100%
>>
>>55896962
I don't think you should use anything higher level than Assembly when you start programming. You understand much more what's actually going on if you do everything yourself.
>>
>>55896962
An IDE can actually give you more information as to what's happening, you mongoloid.
>>
>>55896965
>Just use some function in some unknown IDE I'm using, jesus
>>
>>55896936
No, I want to make a database like pic-related. Two different lists whose members are associated on a 3rd list with additional data, like a quantity number.
I've tried to do this with ordinary lists but it's a pain in the ass to do that like that.
>>
>>55896969
Not true.
>>
>>55896939
>Try getting a book you can leaf through while lying in bed. Not a PDF file. A real thing with paper between covers.
This. Having something you can physically interact with on more than one level is really conductive to learning. You can write, highlight, and tape other notes to pages, make dogears, etc. It's a great catalyst for active learning.
>>
>>55896978
If you just create a new project in Visual Studio and program something you understand the code that you've written but you don't understand how the compiler works, how to create the files for your program etc. because the IDE already does everything for you.
>>
>>55896991
Or whatever the hotkey for GoToDefinition on your text-editor-with-plugins-totally-not-an-IDE is.
>>
>>55896996
Prove me wrong.
If I just want a random Int for internal code use, how do I invoke it without doing weird shit
>>
>>55896973
That's a bad comparison. I wasn't talking about the language, I was talking about how to actually create an application.
>>
>>55897009
You can literally inspect the assembly with memory addresses and everything that is generated by your code in real-time, see exact memory usage of various objects, etc.

Yes, the IDE generates all of the meta files for you. I'm not sure why anyone would bother to do that manually.
>>
>>55897014
That isn't really the problem I was talking about. The problem is that what you type into your text editor with plugins is way to far away from what your CPU does in the end to develop any kind of intuition for what performs well and what doesn't.
>>
Python is a fine glue and meta language.
My employer's software is comprised of C++ and Java, with Python filling the gaps and binding it together.

If you think there's only one best tool for all job, you need to get more experience
>>
Making my lisp to be able to be embedded in html and executed as a server side language.
>>
I give up.
>>
>>55897060
>You can literally inspect the assembly with memory addresses and everything that is generated by your code in real-time, see exact memory usage of various objects, etc.
That's probably too much for beginners
>Yes, the IDE generates all of the meta files for you. I'm not sure why anyone would bother to do that manually.
I'm not saying IDEs are bad, I was just saying that you should first understand what's going on as a beginner.
>>
>>55896994
You want to make a database or you want to store those objects in memory as your program runs?

If you want all that as global state in memory, the simplest design would be to create a class for each table, then store a public, static List of each of those objects, each of 3 Lists representing a table.

Better practice would be to set up interfaces between an actual SQL database where those tables are stored and interact with the data as needed.
>>
>>55897070
Can you give an example?

What did you do that unintuitively performed poorly?

Most issues like this are common knowledge of application design, such as not doing I/O on a loop, and asyncing out web requests.
>>
File: wnIaRyJ.gif (133KB, 311x366px) Image search: [Google]
wnIaRyJ.gif
133KB, 311x366px
>>55896863
>Intro to C on Windows
>on Windows
>taskbar on top
>>
>>55897094
>you should first understand what's going on as a beginner
That's true to some extent, but why would I care if any of my employees know how to create a solution's meta files manually?

I don't want them to do that manually. I want them to use the process in place that saves time and reduces human error.

Same goes for personal projects. Why should I ever care? At what point am I creating these files by hand? Let the IDE worry about library versioning and references.
>>
>>55897143
>That's true to some extent, but why would I care if any of my employees know how to create a solution's meta files manually?
Because you want to learn how to program

Like I said, I didn't say IDEs are bad, I just think you should understand how they work. Once you do, you can work with an IDE.
>>
>>55897099
>You want to make a database or you want to store those objects in memory as your program runs?
If with the former you mean messing with the data locally on the application then yeah, but just want it to do the numbering and sorting for me while I add/edit/remove objects in all lists without fucking up the data.
>>
>>55897116
https://gist.github.com/rygorous/c6831e60f5366569d2e9
>>
>>55896751
In Python, you can use \ to continue a line of code onto another line.

For example:
correctResponse = False

while correctResponse != True:
print('Type either 1 or 4.')
ans = input()

if int(ans) == 1 \
or ans == 4:
correctResponse = True
print('Good. \
You can follow a simple instruction.')
else:
print('Try again.')
>>
>>55897187
>talking about Python
>some faggot tries to join the argument with a compiler-specific issue in C++

lol
>>
>>55897143
You should at least be able to read some assembly (you don't need to be able to write it). It helps so much when debugging to be able to break in somewhere, look at the registers, step through a few lines of asm, and immediately realize what the problem is, vs stepping around and setting watches like a retarded monkey. Sometimes syntactic sugar can obscure what's really going on and being able to form a clear picture of what the CPU is actually doing is a very useful skill.
>>
>>55897193
Fuck. Fucked my example up.
correctResponse = False

while correctResponse != True:
print('Type either 1 or 4.')
ans = input()

if int(ans) == 1 \
or int(ans) == 4:
correctResponse = True
print('Good. \
You can follow a simple instruction.')
else:
print('Try again.')
>>
I've kind of got a problem/question like >>55896908 has. I wanted to make a look-up program for work/practice, so I shoved what my novice brain thinks should happen in Python: I've got three dictionaries - one that associates a user-input state with a hardcoded county, another that associates that county with all of the towns in it, and a third that associates each town with a "protection code" from the local fire department.

# get input from user
state = input("Enter the state (abbreviation): ")
county = input("Enter the county: ")

# associate state with counties
countiesInState = { 'NY' : 'Nassau'}

# look up appropriate towns
townsInCounty = {'Nassau' : 'Garden City'}

# protection class
classCode = {'Garden City' : '03'}

# return results
print (townsInCounty[county] + ", class code " + classCode[townsInCounty[county]])


and below should be the somewhat end result:

Enter the state (abbreviation): NY
Enter the county: Nassau
Garden City, class code 03


I can print one town easily enough, but I don't know how to associate multiple towns with one key AND associate all of those towns with protection codes on top of that. Am I in over my head? Would this be better in C#/Java? I only really know the basics of single dimension arrays.
>>
File: 1470172365495.png (126KB, 229x345px) Image search: [Google]
1470172365495.png
126KB, 229x345px
>>55896311
>mongodb
snapchat for databases
>>
>>55897181
"Messing with the data locally on the application" means the data is in memory.

Use the 3-object, 3-list solution, it's the easiest way if this is a quick-and-dirty.
Object = row, List = Table, in this case.

If you're working with a fuckton of data (read: millions and millions of rows), you might have to do local I/O to temporarily store your local modified data.
>>
I feel like I'm far enough along programming wise to start working on shit that's not retarded but for the life of me I can't think of anything to program.
>>
>tfw my website is 1.53KB
>>
>>55897200
The point was that "zero-cost abstractions" in C++ of all languages lead to shitty performance compared to using raw structs. Python is approximately 30x worse because you have no idea what the fuck kind of code is being generated.

I shouldn't have expected you to realize that since you're a retarded Python babby, sorry, my bad.
>>
File: cat.png (120KB, 799x1106px) Image search: [Google]
cat.png
120KB, 799x1106px
>>55896311
>MongoDB
Read an interesting article on MongoDB (and NoSQL in general):

http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
>>
>>55897229
I don't even write in Python, faggot.

I was genuinely interested in the issues you had with it, because I was considering dipping into it as a side language.
>>
>>55897116
Strings? I have no idea how Python handles strings or what it's doing to my strings under the hood. In C I can just set up a char* and know exactly what's going on. Maybe I want a mutable string! To get the same results in Python I'd have to use a bytearray and if I ran into any problems and posted on Stackoverflow or /dpt/ everyone would call me retarded.
>>
>>55897206
see
>>55897217

It's basic relational design.

You have a table of States, a table of Counties, and a table of Towns(Cities?).

Each row/object/item/entry in the State table has information about the state, and only about the state.

Each row/object/item/entry in the County table has information about the county, and only about the county, as well as a state ID reference.

Each row/object/item/entry in the City table has information about the city, and only about the city, as well as a county ID reference.

How you represent this in code depends on the language. I'm assuming you'd do much the same in Python as C#; define an object representing a State, and create an object to store a collection of States. Ditto for counties and cities.
>>
>>55897268
For me it's the level of abstraction. I simply didn't understand what programming was until I opened up the memory window in Visual Studio and saw bytes flipping through values as my code executed. Writing C feels like I'm working alongside my computer and building something together with it. Writing Python feels like I'm sucking some mathematician's dick.
>>
>>55897268
You are really talking to two people. Anyway, it's not so much a specific problem, but just the general observation that abstractions have insane costs, which is mainly because stuff that should be static is all dynamic and handled at run time, i.e. classes. The class is not just a static struct and a bunch of associated methods, it's something way more ugly than this. Usually when I try to make my python code more orderly by adding some more abstractions, it slows down noticeably. You kind of always expect this, but not as dramatically.
>>
Gang of four or head first for design patterns ? Just want to learn new shit yo
>>
>>55897310
>Writing Python feels like I'm sucking some mathematician's dick.
lol just wait til you go functional
>>
python is fine for casuals and datafagging
>>
>>55897368
Programming is literally creating, using, and manipulating data.

The fuck do you mean by "datafagging"?
>>
>>55897384
found the compsci cuck
>>
>>55897263
>You can always delete the entire activity stream record out of your cache and regenerate it from your consistent backing store. It may be slow, but at least it’s possible.
>What if there is no backing store? What if you skip step 1? What if the cache is all you have?
>When MongoDB is all you have, it’s a cache with no backing store behind it. It will become inconsistent. Not eventually consistent — just plain, flat-out inconsistent, for all time. At that point, you have no options. Not even a nuclear one. You have no way to regenerate the data in a consistent state.
>When Diaspora decided to store social data in MongoDB, we were conflating a database with a cache.

Very nice. That article looks really, really damaging to mongodb. Was there a response from devs?
>>
Guyz, while commiting with git, can I in anyway comment various files differently or the only way is to commit a few times?
>>
>>55897308
So I assume at some point, I'd end up having a big list/array of counties with each county having a state ID reference, and then an even larger list/array for the county/town relationship? For example, the list for Nassau has 198 town entries alone, although I think this number can easily be trimmed of duplicates and entries that are just [town] FD (fire department).

Side note: we skip the cities in a state and go straight to the state's counties because of how geographically "local" fire departments are in relation to a county rather than n fire departments in a single city.
>>
>>55897438
You shouldn't be committing multiple files at once. Your commits are probably way too monolithic. Git is best with very, VERY small, atomic commits.
>>
>>55897072
I generally agree, but I'm not sure I'd ever prefer C++ to Java in a team environment. It's just so much easier to figure out what someone's shitty (legacy) code is supposed to be doing and untangle it in Java than in C++.
>>
>>55897206
# get input from user
state = input("Enter the state (abbreviation): ")
county = input("Enter the county: ")

# associate state with counties
countiesInState = {
'NY' : ['Nassau']
}

# look up appropriate towns
townsInCounty = {
'Nassau' : ['Garden City','Paris']
}

# protection class
classCode = {
'Garden City' : '03',
'Paris' : '99',
}

# return results
for town in townsInCounty[county]:
print(town+", class code "+classCode[town])
>>
def user():
global lu
global lua
lu = sword , lua = raw_input('Username:')
if lu == lua:
print('yay')
user()

Why does this cause the error
    lu = sword , lua = raw_input('Username:')
ValueError: too many values to unpack
>>
>>55897500
I agree.
They do only use C++ for a small but complex performance critical part. Business logic is Java. Glue logic and maintenance scripts are Python.
>>
>pirate head first c#
>first chapter introduction to ide and creating xaml for windows store app
Is it worth it to learn shit that only use in windows 8 store app?
I think i need recommendation of non-shitty ebook i can pirate.
>>
>>55897438
You can do multiline commit logs. If you can't remember everything you changed, or listing the changes file-by-file is too time-consuming, then you're waiting too long between commits.

>>55897533
That sounds altogether more sane and pleasant than the monolithic heap of shit we have to maintain.
>>
>>55897384
Do u even program bruh?
>>
>>55896863
>learning programming on YouTube
Get the fuck out, Pajeet.
>>
>>55897541
>ebook
Get a physical book, honestly, but if you really want an ebook grab the C# Yellow Book
http://www.robmiles.com/c-yellow-book/

I like the yellow book a lot; it's a bit disorienting if you're not from the UK to see Brit-themed examples but it's really well written. See if you can find a pirate copy of https://www.amazon.com/C-Players-Guide-2nd/dp/0985580127/ref=sr_1_1?ie=UTF8&qid=1470232979&sr=8-1&keywords=c+players+guide while you're at it because it's a great compliment to more academic books. I wouldn't recommend it standalone.
>>
>>55897561
>>55897401
What useful program doesn't create, use, or manipulate data?
>>
>>55897520
>>55897206
Actually fuck that, that's a shitty edit that does not answer your problem. Here's how I would have represented the data in python if I were you:

database = {
'NY' : {
'Nassau': {
'Garden City': '03',
'Paris' : '99',
}
},
'XX' : {
'Nassau':{
'Paris' : '97',
}
}
}

def print_codes(state,county):
for town,code in database[state][county].items():
print(town+", class code "+code)

print_codes('NY','Nassau')
print_codes('XX','Nassau')
>>
>>55897418
Not that I know of.

It's basically an explanation as to why relational databases are used pretty much everywhere, and hierarchical databases have their uses, but are not to be used as the sole method of storage.

Even in simple cases like >>55897308
which looks hierarchical in design, you might later realize that some counties belong to multiple states, or some cities belong to multiple counties, etc, which immediately causes duplicate data.
>>
>>55896943
You don't really understand how to use it. Only thing I can agree on is that debugging happens to be much more painful. Especially when you finally find the shit and see something similar would not even compile in C/C++.
>>
>>55897581
0ooh i have both of them. Thanks man. I will start my programming adventure.
>>
>>55896943

Congrats on writing your first fizzbuzz in C.
>>
>>55897622
Dynamic typing (duck typing) kills Python for me.
>>
EXPLAION TO ME why aren't you using extreme programming for 1-3 person teams
>>
>>55897520
>>55897606
So the way you tackled it was to essentially create a megadictionary/JSON-like data structure to store the state, then the associated counties, and then the towns with class codes? I didn't even know I could do that with dictionaries (but is that limited to Python?).

I get the feeling it would be pretty heavy for all 50 states at the end of it all. Would it still be "worth it" to write it in Python for extended use?
>>
>>55897680
I HVAOE NO EXPLAIONAIOIN
>>
>>55897457
>>55897557
Explains a lot. I've been commiting every 4-8h of coding, so yes, the descriptions are *kinda* blurry when I now look at them.

Thank ya!
>>
>>55897681
Well, to me, that seems like the easiest way to represent your data.

Another route you could go is use other anon's advice and create a relational database, fill it up and use queries to retrieve whatever you want.

Since you mentioned that it's for work/practice, then it won't see much use (as in, you'll be its only user), and the easiest way is the best. If you're designing that program that will have lots of users, lots of adding and editing and whatever, a relational database would probably be the better choice because of how robustly it handles of that (and because of how easy it is to fuck up your data with a simple approach).

> but is that limited to Python?
Well, no, would work in any language that supports disctionaries/maps/hashmaps.

>it would be pretty heavy for all 50 states at the end of it all
Heavily depends on what you want to achieve. For run once and then forget tasks it's perfect.
>>
>>55897015
import System.Random
> randomRIO (1, 10)
6

nothing weird about this
>>
Have you achieved Satori yet /dpt/
>>
>>55897604
the space program
>>
>>55897769
>Well, to me, that seems like the easiest way to represent your data.
I don't know anything about data structures outside of terms I've heard other people use/things I've read; that's going to hamper me real quick if I don't read Intro to Algorithms soon.

>Another route you could go is use other anon's advice and create a relational database, fill it up and use queries to retrieve whatever you want.
This might actually be an option because people at work have been curious about moving from the excel sheet that's currently used for this and it might give our server host reason to give us some free space to work with. There won't be a lot of editing from anyone except myself since I don't recall how often these codes change but it's not exactly rapid, but it would have a handful of users to start, probably 5 or so.

>disctionaries/maps/hashmaps.
Ok, I'm getting a better grasp of terminology. Then this is reasonably transferable to the other parts of the "Big 4".

>For run once and then forget tasks it's perfect.
Yeah, it would be about this. Getting input from the user and putting out that list of codes for the towns in the county, user copies the code they need and closes the program.

Thanks for your help, it's been invaluable.
>>
>>55896939
>Think I overshot my abilities when I bought SICP, though...
You just have to take SICP at your own pace. Don't rush your way through it; take time to read a section over and over until it clicks. But if a particular exercise is really difficult for you, don't be afraid to leave it behind and come back to it later. Maybe something you learn later on will help you understand it better.

That said, don't outright skip exercises. Any of them. They're all valuable learning opportunities -- don't think of them as drills; think of them as like lessons in and of themselves. The assignments themselves are designed to teach. Learn from them.
>>
>>55897680
>extreme programming
ridiculous memeword
>>
>>55897916
what
>>
yo dudes are 10x devs real or is it all bollocks

my intuition tells me it's all nonsense
>>
What's up ni/g/gers.

What languages get used the most in the real world? I know nobody there cares about Haskell.
>>
>>55898099
Java, C# and C++
>>
>>55898083
it's real, most people are shitty as hell as programming, so the ones that are real good programmers can easily be 10+ times as proficient
>>
>>55898099
Java, Java everywhere
>>
>>55898099
The big 4 is C#, Java, C++, and Python.

Learn one of these + SQL and Javascript.
>>
>>55898119
>Javascript
>>
>>55898114
What exactly makes someone "shitty" at programming?
>>
>>55898128
Javascript is already insanely popular, and the world is moving more and more towards it.

JS + HTML5 = runs on pretty much anything in existence.

I hate Javascript, but it's naive to discount its popularity.
>>
>>55898141
They produced buggy and poorly-optimized code, which is also very hard to debug and maintain because it's weirdly structured.
>>
>>55898167
You mean stuff like not checking the n = 0 case, or using the wrong type of data structure, things like that?
>>
>>55898141
this: >>55898167 and they're slower at writing code, fail to produce certain code if it's too difficult or it requires special knowledge like math etc
>>
>>55898083
>are 10x devs real
They certainly can be, if you compare the right developer to the right set of retards.
>>
>>55897205
Why would you cast to int? That's stupid. Also breaks when non-integers are used.
>>
File: anime-sicp.png (179KB, 540x354px) Image search: [Google]
anime-sicp.png
179KB, 540x354px
>>55898190
I was talking more about things like spaghetti code, with goto statements everywhere and constant references back to itself such that if you want to make a small change, you have to modify several different source files. That sort of thing.
>>
>>55897521
You're unpacking the result of raw_input, which is a single string, into the variables sword and lua. Since the return value of raw_input is not a tuple with two elements, that's not possible.

What are you even trying to do?
>>
>>55898226
Alright, then I don't think I'm a shitty programmer. Not a good one either, but not shitty.
>>
>>55898226
int xir = ToInt32(ReadLine()); //surely the user won't type in something like 'cat'
>>
File: 1463432081511.jpg (42KB, 401x349px) Image search: [Google]
1463432081511.jpg
42KB, 401x349px
>>55897207
under-rated post
>>
>>55897207
>>55898429
I don't get it.

I know what mongodb is but I've never used snapchat.
>>
>>55896863
this
>>
File: zzz.jpg (166KB, 1291x779px) Image search: [Google]
zzz.jpg
166KB, 1291x779px
>>55896863
Top fucking kek

Day 212 and this is what you have to show for it if you work in C.

I can see why there's a stampede to learn game dev in C. Clearly, it's an efficient way to produce a finished product.
>>
>>55898202
Potentially stupid on my behalf but I find that input is automatically assumed to be a string.
I wanted to do a simple comparison of numbers for the sole purpose of demonstrating how to have a line of code run on in Python.
Without throwing exceptions (because I'm incompetent that way), you'd have to do checks beforehand to make sure the input is numerical.

A simple way to do that is something like
isDigit = False
while isDigit != True:
print('Type either 1 or 4.')
ans = input()
isDigit = ans.isdigit()
if isDigit == False:
print('Try again.')
ans = int(ans)


The way I tend to do it is more like
isDigit = False
while isDigit != True:
print('Type either 1 or 4.')
ans = input()
isDigit = True
for i in ans:
for n in range(48, 57):
if ord(i) < 48 or ord(i) > 57:
isDigit = False
if isDigit == False:
print('Try again.')
ans = int(ans)


If the above feels like amateur-hour to you, it's because it is.
TL;DR: I wanted to make a demonstration of something else. That fact that it wasn't fool-proof didn't really matter.
>>
File: 1470234554928.gif (506KB, 250x300px) Image search: [Google]
1470234554928.gif
506KB, 250x300px
Will people judge me if I push my stupid programs (like find n digits of pi) to github?
>>
>>55898825
>art = programming language
the guy has made good looking commercial games (the engine), of course he didn't do the art for them!
>>
>>55898825

This must the same guy who's creating the loli sim.
>>
>>55898825
the game is actually in C++
>>
>>55898825
don't you have a street to shit in or something
>>
>>55898825
>Day 212 and this is what you have to show for it if you work in C.
This. Fucking "handmade" fags think that using C and reinventing every possible thing is gonna lead them anywhere. Retarded cunts. Just google "handmade network" and see for youself.
>>
>>55898901
>getting this upset that someone is learning via youtube

wew lad, step it up
>>
>>55898901
>I posted it again, Mom!
>>
>>55896311
Is there a version of this graph that goes further past?
>>
>>55898912
He is only doing it from the ground up to teach people about the entire stack. The people who took the handmade name and made a patreon are the retards doing inane shit for no reason. I guess he kinda is encouraging them though.
>>
>>55898836
Yeah.
>>
>>55897206
Hello Long Island friend
>>
>>55898912
it's in C++, look at the video you can see the source files
>>
>>55898963
you're clearly don't know the difference between writing C (with cherry-picked C++ features) and idiomatic C++.
>>
>>55898983
>>55898963
you*
>>
>>55898983
you clearly don't know everyone cherry picks C++ features
>>
>>55899006
>using one or two of all C++ features while writing procedural code
>using most of C++ features while writing object oriented software
>no difference
sure thing buddy, have you finished rewriting your fizzbuzz in C?
>>
>>55897346
Pls respond
>>
>>55899053
no, gof is full of old, deprecated patterns that shouldn't be used nowaday
>>
>>55899085
Head first then? Or any other recommendation?
>>
File: 1470155081902.gif (1MB, 400x225px) Image search: [Google]
1470155081902.gif
1MB, 400x225px
should I put my github in my resume?
>>
>>55899375
Do you write good code?
>>
>>55899375
That depends, if the employer explicitly asks for GH profile then no, you're supposed to supply it separately but if they don't then it's a good idea to put one so they can check it out.
>>
>>55899045
You don't HAVE to use OOP ffs.
That said, people that use C++ avoiding features or the STL are dumb.
>>
File: 1470094297495.gif (1MB, 600x600px) Image search: [Google]
1470094297495.gif
1MB, 600x600px
>>55899394
>>55899408

I dunno.
Right now it's my dofiles, small python scripts, some bash scripts and some C snippets.
>>
>>55899437
I would just mention it in the interview if it comes up.
>>
What kind of projects would look good on a github?
>>
>>55899524
Wanking tracker
>>
new to programming here

how do I start at a specific point in the loop? for example

tup3 = "a", "b", "c", "d", "e", "f", "g";

for t in tup3:
print (t)


how do I start the loop index at 4 for example, so that the output reads:
d
e
f
g
>>
>>55899657
I realize you can make an if statement such as

for index, t in enumerate(tup3):
if index > 3:
print (t)

but is there a better method?
>>
>>55898825
rendering some sprites is really easy to set up in C/C++ if you know what you're doing, presumably he's been doing game logic stuff and obviously the debugging UI stuff, sure this game doesn't look impressive (at first glance) but have fun making a proper game in python lmfao
>>
>>55899712
and he's doing it to teach, he's doing all the videos/streams etc, he's not just making the game for himself
>>
>>55899712
You missed the point of his series
>rendering some sprites is really easy to set up in C/C++ if
Yeah if you use a library that does all the work for you so all you do is something that ends up as:

loadImage("thicc cock in a cute skirt.png")
drawImage(image, 20,20)

He's teaching people to make an engine from 0, including loading images by hand.
>>
>>55899524
Contributions to open source projects.
>>
>>55899770
i was talking about loading images "by hand" in opengl, you just load the image files and do certain function calls to set it up and then you can sample them in your shaders
>>
>>55899657
You can try slicing the list.
values = ["a","b","c","d","e","f","g"]
for v in values[4:]:
print(v)


Assuming this is Python.
>>
>>55899657
saying something like `for element in collection` will go through from the beginning to the end with only a few exceptions that are not worth worrying about right this minute. the best way to achieve what you want is to start the loop later. this means using the for loop in python differently than you've described. there are two good ways (well, one good and one okay) to do this.

the first is to do it like
tup3=["a", "b", "c", "d", "e", "f", "g"]
for i in range(3,len(tup3)):
print(tup3[i])

which instead generates a range object (or you can just think of it as a generic container) that just gives you a series of numbers. these numbers are just indices for which `tup3` has an element. one neat thing about `range` in this case is that you can go in steps other than 1 (e.g. take every other object, by doing `range(0,len(tup3),2)` or go by 3's or whatever).

the other approach is to slice the object:
tup3=["a", "b", "c", "d", "e", "f", "g"]
for elem in tup3[3:]:
print(elem)


this might actually create a new container with just the elements from tup3[3] onward, which (if you're dealing with a large object) would be a disaster. i forget how python and other languages implement this stuff. i imagine haskell and other lazy eval languages would take a slice and do it really efficiently, but idk.

screenshot is an illustration of how these two approaches would look
>>
>>55899805
>just load the image files

What this means varies depending on the file format. It's not "just" something, it can take a fuck load of effort. Here is 6k loc of "just loading the image files" https://github.com/nothings/stb/blob/master/stb_image.h
>>
>>55899849
also oh what the fuck why does ipython3 load python2.7

i need to look into that...
>>
>>55899805
>i was talking about loading images "by hand" in opengl
Opengl doesn't load images, you have to feed it the pixel data.
To get the data you have to read an image file properly and that depends on the format, handmade hero teaches you how to do that.
>>
>>55899851
>>55899878
i doubt he's showing you how to decode all kinds of formats like jpg etc without using a library
>>
>>55899875
It might load your env python instead of looking for a py3 binary?
>>
https://www.youtube.com/watch?v=USFTH9mcaKw

he's loading bitmaps which are basically raw pixel data, fucking kill yourselves, you're missing the point

this is what i was replying to:
>Day 212 and this is what you have to show for it if you work in C.

it's a ridiculous strawman argument that implies it takes 212 to achieve something like that
>>
>>55899897
He went over how to read bitmap files, sure it's a simple format compared to jpg/png which use compression but he did not use a library,
>>
>>55899822
>>55899849
thanks
>>
>>55899946
you literally just pass a pointer to opengl, skipping the header, and i never talked about using a library, it's still very easy to set up if you know what you're doing
>>
for some bash scripts, how should i handle processing values for using them as psuedo 'return's from functions? i have this function for mounting a windows share checking if its already mounted and echoing a 1 if true 0 if false

function AlreadyMounted {
if [[ $(mount -v | grep 'type cifs' | grep "//${RemoteIp}/$1") ]]; then
echo 1
else
echo 0
fi
}


should i instead just echo something else and call it like
if [[ -z $(AlreadyMounted ...) ]]
, should i be using something that isn't echo? i'm pretty unfamiliar with bash
>>
it's not that hard, just because it's not full retard python babby tier doesn't mean it's all that hard or time consuming

https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml
>>
File: 1415266491058.jpg (35KB, 500x611px) Image search: [Google]
1415266491058.jpg
35KB, 500x611px
why would I need reflection? I never used it so far. someone care to explain?
>>
Does anybody know of an eclipse plugin similar or a way to get the Java explorer views to show aspectj objects?
>>
File: c++_vs_java.webm (1MB, 224x400px) Image search: [Google]
c++_vs_java.webm
1MB, 224x400px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>55898836
yes

>>55896863
>2016
>learning programming with C

>>55896607
>when The C Programming Language is still in print?
meme book
>>
>>55900170
you shouldn't need it under normal circumstances but for example on android, there are hidden APIs which some devices have and some don't, so you can check if they're available and use those on devices that they're present on
>>
>>55899914
it looks like some weird conflict between pip and pip3. i could've sworn this wasn't an issue in the past.

anyway, if someone wants to run ipython with both 2 and 3 (and if you have both installed, presumably you want to access all of your cross-compatible tools like ipython from either version, right?) then one shitty way is to change the file (either /usr/local/bin/ipython or /usr/local/bin/ipython3) to run the version of python you want. for some reason when i do pip install ipython it overwrites *both* and even ipython3 thinks it should run from #!/usr/local/opt/python/bin/python2.7 ... which seems idiotic).
>>
>>55900252
>when the garbage collector kicks in.webm
>>
Do you guys use either Docker or Vagrant?
>>
I'm trying to use vim-fugitive and it's clunky as hell.
Can someone post a quick cheat sheet like, how to git status, git add ., git commit -m "text", etc?
>>
>>55900261
Maybe you should try out pyenv, which is just a python version of rbenv. It might help solve some issues with different installs of 2/3.
>>
>>55900170
It's more useful for library/API design than for everyday programming.
>>
>>55899171
Reeeeeeeeeeeeeee
>>
>>55896311

Good web devs will keep the page below 1kb.
>>
>>55900293
I've used both.
>>
Anyone can recommend a good modern book on raytracing/path tracing?
>>
>>55900675
It's still not production ready so you won't find as many "Build you an EZ raytracer" books yet.

Check out "Two Triangles" and any of Inigo Quilez's blog/tutorial posts to see how Demos do it.
>>
redpill me on Erlang
>>
File: 1449700302216.jpg (145KB, 670x424px) Image search: [Google]
1449700302216.jpg
145KB, 670x424px
Are there any free APIs which let you place orders to brokers?
Also, any learning materials for a beginner in financial programming?
>>
>>55900716

I'm just looking for a book that talks about modern techniques used in raytracing, not a step by step tutorial on how to write one.

I was interested in "Realistic Ray Tracing" by Peter Shirley but I can't find the book online for free.
>>
>>55896808
If the average US internet speed loaded that 750KB page in 0.6s in 2011 and the same is true in 2016 I'm not too bothered.

It takes longer for your browser to deal with that information that it does to download it all.
>>
How the fuck do I generate a random variable with distribution N(0,1) in Haskell?
>>
>>55900853
you don't because randomness is impure
>>
>>55900904
Fuck off bro
>>
>>55900774
>free APIs which let you place orders to brokers
Literally what.

There's only one service that's free (Robinhood), and it's only free because they invest your unsettled funds.
>>
>>55900853
>random
>pure function

Pick one.
>>
Eclipse fucking sucks! Sucks sucks sucks and sucks. I fucking hate dicking around with shit. I want to program, not be my own unpaid computer technician.

Does a fa/g/ have to resort to GnuCOBOL just because he wants to code?

Fuck! Why can't they make simple installers or some kind of fuck? I point Eclipse to the .zip file but it complains that it isn't jar.
>>
>>55900954
>I point Eclipse to the .zip file but it complains that it isn't jar.
PEBCAK
>>
>>55900954
why isn't it a jar mate?
>>
>>55899171
we used design patterns explained at uni
>>
post the most clever code you've ever written
>>
>>55900853
StdGen
>>
>>55900921
If there's indeed no free to use API for placing orders to brokers, which API is the best to use for a beginner?
Please note that I'm looking for an API, not some finished software like Robinturd.
>>
File: dpt.jpg (192KB, 914x1200px) Image search: [Google]
dpt.jpg
192KB, 914x1200px
>>55896320
>tfw want to learn programming
>start with Python
>get bored after learning basics
>>
>>55901041
boolean ifTrue = true;
if(ifTrue == true){
return true;
}
>>
>>55901094
Probably Interactive Brokers.

They've got APIs for multiple languages, and I've used them for actual trading and their setup is robust.
>>
>>55901111
waste of quads
>>
>>55900968
>PEBCAK
What?

>>55900980
Don't know. Downloaded it from Metrix Software - and they claims that it's gonna run under Eclipse.
>>
>>55901151
>What?
https://www.google.com/search?q=PEBCAK

>Don't know. Downloaded it from Metrix Software - and they claims that it's gonna run under Eclipse.
what's in the zip file?
>>
>>55901151
what the fuck is it?

are you trying to import it as a java library?
>>
I wanna learn C
Which compiler should I get for windows?
Visual Studio 2015 Express? Which one? There's a bunch of different versions.
>>
>>55900954
> 2016
> not using emacs as IDE
Pajeet tier.
>>
>>55900782
>I was interested in "Realistic Ray Tracing" by Peter Shirley but I can't find the book online for free.
gotchu senpai
http://libgen.io/book/index.php?md5=0DF98065CC9965E61480524EFFB1A373
>>
>>55901218
the only guy i know who uses emacs is a legitimate autist
>>
>>55901041
uncurry (++) . partition (9 /=)
>>
>>55901238
whats it do
>>
>>55901227
he's probably a good programmer then
>>
General GPU question: is it worth using conditionals if I can avoid a lot of memory reads?

If I understand GPUs right using a conditional means threads in the same warp will have to serialize to an extent but is that offset by fewer memory reads? Basically I'm doing image processing with convolutions like this:

 
center = imageLoad(inputBuffer, pos);
if (center.a != 0.0) {
vec4 tl = imageLoad(inputBuffer, pos + ivec(-1,-1));
vec4 t = imageLoad(inputBuffer, pos + ivec( 0,-1));
vec4 tr = imageLoad(inputBuffer, pos + ivec( 1,-1));
vec4 r = imageLoad(inputBuffer, pos + ivec(-1, 0));
vec4 l = imageLoad(inputBuffer, pos + ivec( 1, 0));
vec4 bl = imageLoad(inputBuffer, pos + ivec(-1, 1));
vec4 b = imageLoad(inputBuffer, pos + ivec( 0, 1));
vec4 br = imageLoad(inputBuffer, pos + ivec( 1, 1));
/* -1 0 1
-2 0 2
-1 0 1
*/
float gx = (-1.0*tl.r) + ( tr.r) +
(-2.0* l.r) + (2.0* r.r) +
(-1.0*bl.r) + ( br.r);


>>55900675

Not a full book but I recently went through it has general concepts but also has decent amount of openGL in there.
https://github.com/LWJGL/lwjgl3-wiki/wiki/2.6.1.-Ray-tracing-with-OpenGL-Compute-Shaders-(Part-I)
>>
>>55901227
I used to think emacs was some crazy bullshit for autists, but then I spent a few months using it and now I can't stand anything else. There's a pretty steep learning curve. If you want the editor to be remotely usable, you have to customize your init file. Since you're a programmer, that shouldn't be too initmidating for you though.

Anyway, after a month of agony trying to learn how to use it, you realize how powerful and awesome it is. Every other editor just seems like a joke by comparison.
>>
>>55901253
Pushes every 9 in a list to the back.
>>
>>55901291
idk, i havent looked at his code, but his ideas seem stuck in the past
>>
>>55901093
How to use this?

Do I just say

import System.Random
StdGen


Or what?
>>
>>55901238
hope this is bait
>>
>>55896311
Guys, please help me out.
I don't have any ideas for personal projects.

So far I've been forking and making PRs on GitHub, but I need something 'mine' to showcase my coding skill to employers.

What should I do?
dpt challenges are too basic for this purpose
>>
>>55901303
memory bandwidth is a huge performance drain so it could easily be worth it, but it depends, the compiler might do the reads anyway or your gpu could be shit at handling the conditional, so you'll have to benchmark it to be sure
>>
>>55901344
>dpt challenges are too basic for this purpose
I don't think you've read through them.
>>
>>55901344
Me too thanks.
>>
>>55901101
Kek!
>>
File: kekwtf.png (168KB, 794x937px) Image search: [Google]
kekwtf.png
168KB, 794x937px
Wew, this was a surprise.
>>
just get a job

github is a meme
>>
Post the dpt challenges again.
>>
>>55901344

Do a TextEditor, I'm working on one right now.
>>
File: o.png (144KB, 1355x1857px) Image search: [Google]
o.png
144KB, 1355x1857px
>>55901384
>>
>>55901373
moderate chuckle
>>
>>55901332
yep, realized that a minute after posting

>>55901335
how so
>>
>>55901384
>>55901402
Stop this shit, the thread gets shitted up with rolls.

Use this site or make your own roller and use the image.

http://better-dpt-roll.github.io/
>>
>>55901373
>buying books
>>
So I've spent about a month learning the basics of Python, but I feel like I'm cheating. I understand what loops are, and why they work along with many keywords. But since It's a higher level language all I have to do Is memorize keywords and syntax to do what i need to do as a beginner. Should I switch to Cpp? If so are there any resources that are compsci beginner friendly? Something recent would be nice too. I've also found that online tutorials seem to teach poor long term skills. Any help?
>>
>>55901411
just the stuff he talks about like compatibility wise and shit, always going on about something or other to do with how some browser ten years ago wont support this shit

he is very stuck in his ways because he is autistic
>>
File: DB_price_simulation.png (64KB, 1304x668px) Image search: [Google]
DB_price_simulation.png
64KB, 1304x668px
>>55901402
Look at that I already did the stock simulator thing in Matlab.
>>
>>55901431
shut up
implement a sudoku solver
or game of life with a gui

you're a beginner so you don't know what to do to get better
>>
>>55901340
Why?
>>
>>55901338
google is your friend
>>
>>55901431
what do you want to do?

why did you start learning python?
>>
>>55901443
very nice. how did you do it and why did you choose matlab?
you can post the code if you want (github or something), for others to learn
>>
I have a list of strings(urls) in python. Is it possible to print them as 1, 2, 3 so you can click the number and open the site?
>>
>>55901465
I've been interested In game development for awhile. I like the idea of making something from the ground up even If It requires hours of mindbending maths. Python for me was my first " Bitch you fucking do this ' moment In my life, atleast In terms of programming. I dabble off and on every year or so and give up after a week, I used to dabble In C++ but never got past functions. Python for me was a training wheel to understand what was blocking my path In C++. Now I want to dive Into that so I can do what I actually want to do. I also like that C++ forces you to understand compsci moreso than Python.
>>
>>55901552
Everything is possible. It's just a matter of time.
>>
>>55901466
I did a very simple thing, I modeled a stock like they do in the Black Scholes model. I used to Euler-Maruyama Method to solve the following stochastic differential equation:

dS_t = r * S_t dt + sigma * dW_t

The problem here is finding the r and the sigma. Therefore I used the following code to determine the trend rate, and the volatility.

This is the code:


trials = 1200;

S = fliplr(transpose(Close));

time = size(S);

time = time(2);

E = mean(S);

temp = zeros(time,1);

for j = 1 : time;
temp(j) = (S(j)-E)^2;
end;

var = mean(temp);

vol = sqrt(var)/E;

rate = zeros(time,0);

for j = 1 : time-1;
rate(j) = S(j+1)/S(j);
end;

lograte = log(mean(rate));

X0 = S(time);
t0 = time;
T = 4500-t0;
N = 4500-t0;

a = lograte;
b = vol/sqrt(365);

t = linspace(t0,t0+T,N);
X = zeros(1,N);
dt = t(2)-t(1);

plot(linspace(1,time,time),S);
hold on;

for j = 1 : trials
dW = sqrt(dt)*randn([1 N]);
X(1) = X0;
for i = 1 : N-1;
X(i+1) = X(i)+a*X(i)*dt+b*X(i)*dW(i);
end;
plot(t,X);
hold on;
end;


title('Share price over time');
xlabel('Time in days');
ylabel('Price in dollars');
hold on;
>>
>>55901452
this and the other times i've seen it posted have strongly reinforced the notion i have of haskell enthusiasts as being ridiculously up their own asses, obsessing over the prettiness of their solutions to first year CS problems which are really the only thing the language is good for
>>
>>55901338
should be easy to figure out if you know the language
>>
>>55901565
When you go back to c++ you will continuously forget to do parentheses and semicolons, enjoy

So are you looking at it for a career or something? You at uni now doing compsci ?
>>
>>55901580
this
>Pushes every 9 in a list to the back.
ooh so fucking clever, you should win a turing award or something
>>
>>55899657
https://en.wikipedia.org/wiki/Duff%27s_device
>>
>>55901576
nice. thanks for sharing
trials = 1200;

S = fliplr(transpose(Close));

time = size(S);

time = time(2);

E = mean(S);

temp = zeros(time,1);

for j = 1 : time;
temp(j) = (S(j)-E)^2;
end;

var = mean(temp);

vol = sqrt(var)/E;

rate = zeros(time,0);

for j = 1 : time-1;
rate(j) = S(j+1)/S(j);
end;

lograte = log(mean(rate));

X0 = S(time);
t0 = time;
T = 4500-t0;
N = 4500-t0;

a = lograte;
b = vol/sqrt(365);

t = linspace(t0,t0+T,N);
X = zeros(1,N);
dt = t(2)-t(1);

plot(linspace(1,time,time),S);
hold on;

for j = 1 : trials
dW = sqrt(dt)*randn([1 N]);
X(1) = X0;
for i = 1 : N-1;
X(i+1) = X(i)+a*X(i)*dt+b*X(i)*dW(i);
end;
plot(t,X);
hold on;
end;


title('Share price over time');
xlabel('Time in days');
ylabel('Price in dollars');
hold on;
>>
>>55901608
Perhaps I just like torturing myself, It's mostly for me to gain some knowledge of computer science and to begin a path down programming lane. And I oddly enough memorized the parenthesis and semicolons. I probably spent more time memorizing those two things than anything else.
>>
>>55899657
for(i=4; i<=7; i++)}{
printf( "%s", tup3[i])
}
>>
>>55901576
cool. are there any good introductions to mathematical finance that you'd recommend?
>>
Making progress on the Rust tutorial. So far I like it.
>>
can you guys give me something to work on ?

im bored and need something to occupy my mind, or I'm back to being unproductive again
>>
>>55901716
Play video games and watch porn like a normal person.
>>
>>55901648
How old are you?

Sorry if I'm being a bit curious I'm just interested in why you want to get into programming

I started pretty late myself, purely to get a job
>>
>>55901716
do something no one can do:

like averaging 2 integers in C
>>
>>55901580
It's great for solving 1st year CS problems. For other things the issue is a lack of library support because the userbase is so small. As the language increases in popularity (which it's doing at an explosive rate), more libraries will become more mature and full-featured. In the meantime, it's only being used to solve 1st year CS problems like compiler implementation, theorem proving, and microservice implementation. Whatever.
>>
>>55901716
Onset detection.
>>
>>55901674
>>55901643

Alright guys.

First of all two great resources to get started with:

https://www.youtube.com/watch?v=rvYfNz2H3Uk
https://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method

I wrote the script in Matlab because I already did a lot of university projects involving differential equations in Matlab. I'm not a great programmer and I just feel comfy with Matlab.

The script I wrote works if you go on yahoo finance, and then download the "historical prices" as a .csv file. Put that csv file in your Matlab folder, and then click "import data". It should run correctly if you do that.
>>
>>55901757
20. Don't have any plans to go to college for It. I plan on doing economics. Unless I can learn enough In several years and have it as a backup plan.
>>
File: Mamimi_FLCL.png (261KB, 699x478px) Image search: [Google]
Mamimi_FLCL.png
261KB, 699x478px
>Trying to study and practice my code.
>Can't focus.

Bummer.
>>
>>55901758
Anyone can do that you just have to define "averaging" in a stricter sense than the purely mathematical one. It's either that or use a different data type.
>>
>learn some language
>google "<language> performance"
>pick any open source software
>apply performance hacks to program
is this a good generic idea for learning new languages and to gain employment points?
>>
>>55901776
Whatever.
>>
>>55901758
use floats, then cask to integer. done
>>
any HCP+IoT developers?
>>
>>55901792
i don't like that guy's voice do you have anything else
>>
>>55901224
Thanks!

>>55901303
I'm working on a CPU raytracer, but it looks like there's a ton of interesting things in it, I'll take a look at it too, thanks.
>>
>>55896311
How does application programming differ from web development? Is the difference that significant? I guess you work more with arithmetic operations and the like, or am I mistaken?
>>
File: Come_on.gif (4MB, 200x200px) Image search: [Google]
Come_on.gif
4MB, 200x200px
>>55896888
>c#
>microshit
five rupees have been threw at you Pahjeet
enjoy for new sandals
>>
>>55901792
i'm so sick of faux handwriting
>>
If I want to mess about making a game should I use GameMaker or Unity?

I know a litttttttle C++ so I wouldn't want to be entirely using built in tools.
>>
File: imaeg.png (79KB, 600x367px) Image search: [Google]
imaeg.png
79KB, 600x367px
>>55896491
>>
>>55901872
you need to deal with OS and GUIs
>>
>>55896751
that's why you should embrace functional programming and then forget about it
>>
>>55896311
how do I learn C?
"The C Programming Language" is boring
>>
>tfw love C#, it's a beautiful language
>tfw it's only on Winshit

FUCKING MICROSHIT FUCK YOU REEEE
>>
>>55901860
>>55901901
I'll write a little pdf in latex for you guys explaining what's happening in my script.
>>
>>55901951
mono
>>
>>55901650
MISSING
SEMICOLON
senpai pls
>>
>>55901650
WONT COMPILE
THERE IS NO MAIN FUNCTION

STEP UP YOUR GAME
>>
>>55901951
>love C#, it's a beautiful language
kek
>>
>>55901951
Just do java
>>
File: 1361581109101.png (356KB, 724x3267px) Image search: [Google]
1361581109101.png
356KB, 724x3267px
>>55901951
>FUCKING MICROSHIT
It's something I hadn't thought about before but... how's programming on an Apple product? A Mac, say?
Having never used any of their stuff, hearing the Apple Store being described as "a walled garden" makes me wonder.
>>
>>55901951
You can literally program on Linux and OSX in Monodevelop.

You can deploy C# to Linux, OSX, Android, and iOS, and tons of embedded systems.

C# is open source.

The hell are you on about?
>>
>>55901939
I never read a book about C. I knew programming before coding, so what I did is to assemble little algorithms for having my personal projects done.
In one month or so I was proficient enough in C for being paid making projects to university dudes with money. I was 16.
>>
>>55901951
>it's a beautiful language
Something less shit than Java doesn't make it beautiful.
>>
>>55902074
It's not really bad, for anything the App Store doesn't have there's brew.sh
>>
>>55902078
>I knew programming before coding

what did he meant by this?
>>
>>55902078
>I knew programming before coding
what
>>
>>55902083
Haskell is pretty beautiful (from a mathematical standpoint) but is shit for having projects done. I don't think there will be never a compromise between functionality and elegance. Lock at JS for example: shitiest language is universal.
>>
>>55901951
>it's only on Winshit
Are you a time traveler from a decade ago?

C# has been cross-platform and open-source for a while now.
>>
>>55901716

cmon guys give me something at least
>>
>>55902126
Rust?
>>
How to get high salary in programming?
>>
>>55902103
I meant that. People often confuse being able to solve a problem with an algorithm, with being a codemonkey. You will find plenty of rails developers who actually don't know to program (solve problems)
>>
>>55901716
>>55902139
>pick random linux program that you like/find very useful/whatever
>make web UI for said program
>>
>>55901860
This is essentially what he's saying in the video.
>>
>>55902159
Learn Haskell.
>>
>>55902083
For me, it's that C# is comfier to program in compared to the other major languages.
>>
>>55902163
aren't coding and programming synonyms?

the meaning you attribute them is not widely recognised (i.e. what the fuck are you talking about?)
>>
>>55902163
Quit making up your own dumb bullshit to make yourself feel superior.

Coding and programming are synonyms.
>>
>>55902203
>comfy
Comfy is a state of relaxation, retard, not a description of syntax.
>>
>>55902227
Uusi tråådi
>>
>>55902188
nice thank you. what's the point of the last step though? aren't DEs usually just kept with their derivative things intact (by which i mean not multiplying by dt)?
>>
>>55902234
Dumbass
>>
>>55902204
>you program in every language and non languages
>you code in C, java, python, ruby...
is that easy to understand for you?
>>
>>55902224
Yes, I am in a higher state of relaxation when I use C#.

Much like memory foam that molds to my ample thighs, C# has syntax and standard features that are pretty damn intuitive.
>>
>>55902220
>itt: people who never went to school
>>
>>55902267
I have a bachelor's degree in a technical field, faggot.
>>
>>55902240
That last step is essential for something called "discretization", which the following link will explain to you:

https://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method

Down in the article there is a little Python code solving a stochastic differential equation as well, take a good look at that.
>>
>>55902246
>>you program in every language and non languages
>programming in non languages

what do you even mean
>>
>>55902137
Is it really though? Without (proprietary) .NET framework, there's no point in using C# at all.
>>
File: 1447278982315.png (103KB, 500x500px) Image search: [Google]
1447278982315.png
103KB, 500x500px
I have no idea what to program anymore. I'm in a rut.
How do you guys get ideas for useful programs?
>>
File: trash bobby.jpg (132KB, 500x378px) Image search: [Google]
trash bobby.jpg
132KB, 500x378px
>>55902093
>brew.sh
>made by a ruby codemonkey that can't even reverse a binary tree
>>
>>55902315
https://github.com/dotnet/core
>>
>>55902292
oh i see.
>>
>>55902224
>Comfy is a state of relaxation
Hurr durr I don't know what an adjective is.

Maybe you should refrain from commenting on things that have to do with language.
>>
>>55902349
you resolve problems you have
>>
>>55902281
but that's worse, as you seem to be uneducated.
>>
>>55902401
Program a gf it is.
>>
>>55902436
>*make up dumb bullshit*
>anyone who doesn't agree with my dumb bullshit is uneducated

k
>>
>>55901989
>>55902013
ironically i always remember about them while doing vector math
>>
>>55901210

2015 express Community Edition is correct. VS Code is microsoft's answer to Atom.

Also please, if it's your first C-style language try and learn c++11. C is almost certainly older than you are and you'll be working up hill with memory management and old voodoo.

>>55902349
contriboot to open source software. Either you learn or you make good things.
>>
File: 14664093517370.jpg (54KB, 604x425px) Image search: [Google]
14664093517370.jpg
54KB, 604x425px
If you're sobright in this thread, can you help me?
I'm 22 y.o. Is it too late to start programming? Which language should I master first?
I've started with js a month ago and now on the middle lvl algorithms on codecamp. Wise anons, give me advices please.
>>
>>55902349
>>55902349
I would like you to make a graphics program for interactively generating marbled paper textures as SVGs.
see: https://en.wikipedia.org/wiki/Paper_marbling
>>
>>55900675
fundamentals of computer graphics has a few chapters devoted to it afaik. Also you need to learn linear algebra first (vectors n shit, not that hard)
>>
>>55902670
>I've started with js a month ago and now on the middle lvl algorithms on codecamp. Wise anons, give me advices please.
what's wrong with that? just keep going.
>>
Lurking around internet I came to the realization that to hurt a codemonkey feelings you just need to say to them that programming is a more general thing that only coding.
>>
>>55902755
I'm keeping, but saw some posts on other board that it is too late and other stuff, and that it is better start on C++ or just C
>>
>>55902349
Get a job
>>
>>55902828
it depends on what you want to do. web dev will pay the bills and you won't need anything other than js. learning other languages can help expand your mind though since they force you to think in different ways. definitely try C at some point and something functional like scala.
>>
>>55902984
I've started erlang last night, for thinking what to choose: erlang or haskell
>>
>>55902670
No, but why would you want to?
>>
>>55903060
I always wanted, and it is well-paid too.
>>
>>55903132
Fair enough, it's a good thing to get into and can be very rewarding I you enjoy it

What do you do at the moment?
>>
File: python-008.jpg (330KB, 600x504px) Image search: [Google]
python-008.jpg
330KB, 600x504px
is mandatory indentation a form of autism?
>>
>>55903227
>https://www.freecodecamp.com/challenges/wherefore-art-thou

At this point right now. For the first time it was really hard, but now so-so, can manage with it. One thing i don't know is how many other algorithms/other things like react i should know to be like junior
>>
>>55903326
yes, just as mandatory boilerplate and class wrapping
>>
>>55903326
like semicolons
>>
>>55901210

MSVC is a terrible C compiler. If you want to learn C on Windows, look up MinGW-w64. It's distributed through a few packages, but the one I'm most able to recommend is MSYS2

https://msys2.github.io/
>>
File: well then.gif (2MB, 320x240px) Image search: [Google]
well then.gif
2MB, 320x240px
i can't get wrap my head around on when to use pointers on c++, please help
>>
>>55898235
Not sure if this thread is dead or not, but I was just playing around in Python. What I wanted to achieve there was the ability to save whitespace by putting two variables and assigning them on the same line using , .You mentioned tuples, and that gives me another idea.
>>
>>55903326
Not really. But aversion to it often is.
>>
>>55903809
Pass pointers to functions so that functions can access the data via pointer.
>>
>>55903809
Do you want to use the tool (pointer) for something else?

or do you want to modify the tool to do something else?
>>
File: pepe_triste.jpg (10KB, 242x208px) Image search: [Google]
pepe_triste.jpg
10KB, 242x208px
>>55903873

what's the difference between:

TYPE x;

TYPE function(x){...}

and

TYPE x;

TYPE function(&x){...}
>>
>>55903809

Raw pointers are useful in C++ when:

1. Interfacing C code, and anything that uses C-style strings
2. Creating classes that own and manage other heap objects. Smart pointers may not always be appropriate if you need a finer control over the freeing of memory, especially where cycles exist.
3. Anywhere that pointer arithmetic makes sense (i.e. a custom array/vector class), or just offsetting an ordinary array
4. Function pointer arguments
5. Handling DMA in an OS
>>
>>55903901

i don't to modify it, just use it's data
>>
>>55903333
I mean as a job

By react do you mean the js framework?

Honestly I'd try just to get an entry level job where you can get some professional experience once you know your way around basic concepts, otherwise you are just going to be stabbing in the dark
>>
>>55903917
void fn(Type x) will COPY the variable you pass in to the function. You will not be able to modify it in the body of your function.

void fn(Type &x) will REFERENCE the variable you pass in when you call the function. You WILL accidentally modify it inside the body of your function.

Use (const Type &x) unless you have a good reason to remove the const or the &.
>>
File: index.jpg (11KB, 204x248px) Image search: [Google]
index.jpg
11KB, 204x248px
>>55904156

nice, thank you
Thread posts: 358
Thread images: 34


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