[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: 315
Thread images: 28

File: 1481234393653.png (102KB, 1000x1071px) Image search: [Google]
1481234393653.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58123966
Functional programming thread: >>58105321
>>
>>58129408
Debugging the Python code that's supposed to generate a C++ header file.
>>
>parallelize convolutions with Parallel.For, doing essentially no heavy-lifting at all
>they are now instant

Thank you C# :^)
>>
>>58129408
(defn -main
[composite]
(def vectormap [])
(loop [divisor 1]
(if (< divisor composite)
(if (integer? (/ composite divisor))
(do (def vectormap
(conj vectormap
(hash-map :divisor divisor :number (/ composite divisor))))
(recur (inc divisor)))
(recur (inc divisor)))
(print vectormap))))

Didn't even get a reply last thread, I need to get this to work... please

It works in Cider but it refuses to run after it's been compiled or to run in leiningen
>>
>>58129497

Does parallel for work in .NET Core?
>>
>>58129580
Yes.
>>
>>58129580

Don't know, m80, all I know is that it made my convolutions and statistical filtering (min,max,median,avg) lightning quick.

Those fuckers used to take like 10-15 seconds for big kernels.
>>
>>58129538
>>
So I've been reading about facial recognition and to my understanding it work by identifying "points" side of you lips, jawline, etc wouldn't putting a small black square on all those points counter facial recognition?
>>
>>58129538
Do you actually like programming like that, or are you doing it for a /g/, e-peen measuring, pissing contest?
>>
>>58129649
he can't fix his own code so my guess is everything he does is to try to impress people
>>
>>58129646
Nope.
>>
>>58129622
fuck you you colossal piece of shit, I know my code looks like trash, I'm trying to learn so that it's not going to be total shit, but as it stands the shitty fucking tablet I wrote that on doesn't have the fucking processing capacity to actually run the fucking program in less than an hour

I'm trying to move the piece of shit to my fucking desktop where I can just brute force the problem with a six-core

not everyone can afford a formal education in programming, I'm flat as fucking broke in a land of 13,000,000 jobless hoping that maybe one of the things I fucking enjoy can get me out of this shithole, because the alternative is the cold steel of a shotgun barrel on my tongue

>>58129649
>do you actually like programming like that
I literally don't know any other way

>>58129670
fuck you....
>>
File: 15pxmedianpukegril.png (608KB, 680x680px) Image search: [Google]
15pxmedianpukegril.png
608KB, 680x680px
THE SPEED IS UNBELIEVABLE! 15 PIXEL MEDIAN FILTERING IN ONLY A FEW SECONDS!
>>
>>58129708
Yeah but can you do it on the GPU?
>>
>>58129708
what is this and what are you doing?
>>
sixteenth for bringing back builtin TV games
>>
>>58129777
What are some other suggestions that aren't breakout and pong? I want this to be (barely) playable over IR remotes (no key rollover, ~150ms delay)
>>
>>58129766
>>
Can you compile python (a la cpython) to an exe so it's reasonably portable? All my googling ends up with either "hurr python doesn't compile" or "it's only working on your own build". Some autist somewhere probably made a python script that converts python code into C or brainfuck or anything else that can be reasonably distributed.
>>
File: 1234wresd.png (3KB, 347x335px) Image search: [Google]
1234wresd.png
3KB, 347x335px
Is there any relation between the number of bugs and complexity of a program?
>>
>>58129810

Do not reveal the secret!

>>58129760

I could do it with [spoiler]CUDA[/spoiler].
>>
>>58129538
ma nigga.

I was very much into Clojure last month, it looks like a great language... until I realized just how much it relies on using Java (not the JVM, I mean actual Java). The language is basically crippled without interop.

Currently learning Haskell - joining the master race. Come with me.
>>
>>58129809
Quake III
Snake
Galaga
Smash
>>58129831
I heard from some people that 100 LoC per bug is considered "normal"
>>
>>58129839
>Do not reveal the secret!
why not you bastard?
>>
>>58129809
Same guy
I want to simulate Conway's Game of Life and stream the board out to the network in black and white
>>
>>58129855
That's the exact problem I'm having right now

I'm learning Clojure, followed by Scheme, C, and then PHP to pay the bills freelancing until I can get a job

my code compiles but it won't run once it does, says java.lang.String can't be cast as java.lang.Number, which is fucking weird because there's not a single string in that code to my knowledge
>>
>>58129815
>python
fucking give up on that honking pile of crap for things other than literally a couple lines of script
>>
File: preservededges.png (680KB, 680x680px) Image search: [Google]
preservededges.png
680KB, 680x680px
>>58129874

I dunno. However, I do have a secret weapon! Thresholding. Now I can run big median filters and still preserve edges.

Disgusting women could abuse this filter to make it look like they have clear skin!
>>
>>58129815
py2exe has worked for me in the past.

>>58129898
lol
>>
>>58129810
From looking at this gif it looks like you're making a blur tool
>>
>>58129950

Median/Min/Max/Avg are done in roughly the same way as convolutions are, which is how you would accomplish blurring.
>>
>>58129950
It can be any number of things
https://en.wikipedia.org/wiki/Kernel_(image_processing)
>>
hey guys I have a question about the type of projects a student should be working on in order to put on their resume for applications for internships.

Basically I'm curious to what the standard of sophistication a project needs to be at in order for it to not make the application look ridiculous?

I know that the better it is the more likely I'll get a shot. I'm just wondering what the bare minimum would be.
>>
>>58129974
bare minimum
>kernel module / graphic driver development
>game graphic / physics engine
>raytracer or other low lovel advanced graphic application
>>
>>58130008
>graphic
>graphic
>graphic

Hmm, I'm thinking now.
>>
>>58130020
shart in mart
>>
>>58129898
Lolwut

>>58129932
I'm completely confused by py2exe, can it compile into a solid fucking exe file, not a mini interpreter with bunch of dll and pyc files? Basically I'd like to get a single PE which I can run on vanilla winxp (ie not having to bundle thousand dependencies).
>>
File: Suzanne Somers.jpg (53KB, 740x1083px) Image search: [Google]
Suzanne Somers.jpg
53KB, 740x1083px
function fetchComments(commentIds) {
return Promise.all(commentIds.map(id=> {
let comment
return fetch(`${endPoint}/${id}.json` )
.then(res=>res.json())
.then(com => {
comment = com
if (!comment.kids) return Promise.resolve([])//base case
return fetchComments(comment.kids)
})
.then(childComments=> ({
id,
comment,
childComments
}))
}))
}



each hackernews comment has an array of kids which are also just comments

should I refactor so 'comment' isn't a free variable? I've been learning rxjs so not doing so bothers me but making the second .then() return both child comments and main comment in a promise makes the code less readable imo. I guess I also could refactor fetchComments to take the comment and return the comment along with the children but again it seems more complicated (or maybe I'm just bad at using promises?) wat do?
>>
File: wf11.png (90KB, 1134x1043px) Image search: [Google]
wf11.png
90KB, 1134x1043px
Started working on how the interface to Windows API calls should work.
; DLL-CALL ( args.. dll "proc" -- )
; TODO: atm hardcoded for 4 args
FORTHCODE 'dll-call', dll_call
WINENTER $20
mov rcx, [rbx]
mov rdx, rax
call [GetProcAddress]
mov r9, [rbx+$08]
mov r8, [rbx+$10]
mov rdx, [rbx+$18]
mov rcx, [rbx+$20]
call rax
WINLEAVE
DROP 6
ret

The annoying part about the Win64 ABI is the fact that you have to always reserve 32 bytes of 'show space' for the 4 arguments passed in registers and align the stack pointer to 16 bytes, which means it requires a bunch of adjusting and special case handling for < 4 args and > 4 args.
Ideally I would just want to xchg rbx, rsp (rbx is my Forth data stack pointer), but since I don't keep it 16 byte aligned it's not gonna work, and you obviously still need to handle the register passing args.
So much simpler with the 32-bit ABI...
>>
>>58130008
well im working with java. basis is that i want to be hireable. I just finished my first java app ever. very simple gpa calculator.

how far away am i from creating something actually good?
>>
>>58130038
>can it compile into a solid fucking exe file, not a mini interpreter with bunch of dll and pyc files?
Nope. This is IMPOSSIBLE.

It will contain all the dependencies in a single place though.
>>
>>58130048
that really depends on you and what do you want to do in the future.

>very simple gpa calculator.
very cute anon, but you need to do more complex projects to actually learn something, things that would be like working at a real company.

you said you know java, maybe look at programming android applications?

you need to tell more information
>>
>>58130040
shit, i didn't have to wrap the base case in a promise

promises are harder to code with than observables imo
>>
(defn -main
[composite]
(def vectormap [])
(loop [divisor 1]
(if (< divisor (/ composite 2))
(do (when (integer? (/ composite divisor))
(def vectormap
(conj vectormap
(hash-map :divisor divisor :number (/ composite divisor)))))
(recur (inc divisor))))))


Cleaned up the function a bit, turned an unnecessary if into a when statement and ensured there wouldn't be redundant results in the data structure, but it still won't run after it's been compiled

The script runs, it works, I just can't get it into jvm so I can run it on another machine
>>
>>58129855
>Haskell
Does it work well on Windows?
Does it have good graphics libraries?
Does it play nicely with C code?
>>
>>58130083
well this was my first ever. I used it to learn how to use github, dropbox, android studio, etc.

I'm thinking what I want to focus on is the automobile industry. the whole self driving and electric car thing. I believe that's where the industry might be headed. and augmented reality and virtual reality will be able to be explored.

I don't want to do research, however. I strictly want to develop. but apart from that I guess mobile development is still what i prefer. augmented reality apps are pretty interseting.

what do you think I should try to learn?
>>
>>58130083
>very cute anon
also don't make fun of me.
>>
>>58129408
Working on my Discord API client for Swift.
private func createRTPHeader() -> [UInt8] {
defer { header.deallocate() }

let header = UnsafeMutableRawBufferPointer.allocate(count: 12)

header.storeBytes(of: 0x80, as: UInt8.self)
header.storeBytes(of: 0x78, toByteOffset: 1, as: UInt8.self)
header.storeBytes(of: sequenceNum.bigEndian, toByteOffset: 2, as: UInt16.self)
header.storeBytes(of: timestamp.bigEndian, toByteOffset: 4, as: UInt32.self)
header.storeBytes(of: ssrc.bigEndian, toByteOffset: 8, as: UInt32.self)

return Array(header)
}


Found it odd
storeBytes
requires the "as" parameter. I guess that's just to expressly type literals.
>>
>>58129893
>There isn't a single string
If I know my LISP, composite is an argument to the main function, right? Isn't it a string? Usually on Java they are. Just my 2 cents.
>>
Quick question: How annoying is the /wdg/ spillover, if it exists.
>>
make a program that lists all sites ending in .dk, .it, .com etc.

basically you give it as an input and you get a list of those domain names
>>
>>58130596
ok
>>
>>58130596
no
>>
>>58130596
>make a program that lists every site in existence

Just out of curiosity, how big is your data center?
>>
>>58130757
its a big computer
>>
>>58130854
u u
u u
>>
>>58130757
that wouldn''t really be all sites though
let's say you do
.root
and then one of .root\'s children would be what's being asked for, to list the children of one of root's children
>>
>>58130043
arent there fasm macros for all that shit
>>
emacs or vim?
>>
>>58131501
Whatever you prefer :)
Personally, I like emacs.
>>
>>58131501
sublime text
>>
>>58130408
look into doing a REST api. I have no idea what that is but companies will eat that shit up bro
>>
>>58131501
I like vim a lot, but I've never tried emacs. I have to use vim at work anyway.
>>
>>58129497
>Parallel.For
What am I thinking of. Is it Amdahl's law?
Because it sounds terrible to have your program break out into multiple threads suddenly like this.
Really seems more like a feature for shitty programmers to dip their feet into multithreading than something someone who cares about going fast would use.
>>
>>58132045
>parrallel for is a bad idea
dude, might as well code in assembly
C is for shitty programmers to dip their feet into coding
>>
Trying to learn python and am failing horribly at it...

Trying to make a directory crawler, but I get the following error in my code:
IndentationError: unindent does not match any outer indentation level


Here's my small program/script

import shutil, os

def listFiles(folder, indNum):
for file in os.listdir(folder) :
tab = ' ' * indNum
print(tab + file)
if(os.path.isdir(folder+file)) :
print("Jumping into ... ", folder+file)
listFiles(folder+file, indNum+1)

inputDir = input("Please enter the base directory")
listFiles(inputDir, 1)
>>
Why are there two /dpt/s?
>>
>>58132085
Anon I'm not saying you can't use it. It could be nice for a hack job. Like you're coming home drunk on a Friday night and you just want to feel like a super good programmer for a few minutes.
Doing this everywhere is an incredibly poor solution.
It's not amdahls law by the way. I don't remember, but it had to do with the theoretical performance of software where there's sync points/waiting vs fully threaded. I wish these people wouldn't name shit after themselves. You share your name with thousands if not millions. Why do you care?
>>
>>58132045
>Because it sounds terrible to have your program break out into multiple threads suddenly like this.

Sounds terrible, but massively speeds up the program. I'm using it for what it designed to do.
>>
>>58132172
ive no clue what you are referring to
ive read that parallel for is theoretically and practically proven sound, it gets you linear speedups, low overhead etc.
people have figured out schedulers in compilers, how granular the for loop to be etc.

it really is a good abstraction
>>
>>58132102
You have weird indentation obviously. Check that it's always four spaces and that you didn't start a line off with a random space.
>>
>>58132102
Works fine for me, what editor are you using?
>>
>>58132201
>I've read parallel.for
Oh come on anon you're pulling shit out of your ass now. I'm talking CS and you're referring to what's probably Microsoft marketing material.
>it's a good abstraction
I think if they wanted a good abstraction they should have done something different that I won't waste time explaining. You can make threading easy by having abstractions that say when data is ready for processing. I.e. You'd have your parallel.for equivalent but you say at some earlier point in the program that your inputs are ready and m you schedule it to be done at another point (likely right after the parallel.for). That'd be drastically better for non trivial applications and have very very little overhead (it's a simple job system with priority).

Just because you like it doesn't mean it's a good abstraction anon. In a non-trivial situation the small parallel for might evict other threads and destroy the cache for them. You may end up with far slower performance by using it if you're in an environment where you're not already painfully inefficient.

But I'll concede that it's fairly unlikely the C# pajeets will write good enough code for it to matter. Just beware of shared state. I'd imagine they don't even warn you about that.
>>
>>58132303
my source is 6.172 mit course, im not pulling shit out of my ass, it has nothing to do with C# either
>>
>>58132323
>it has nothing to do with C#
Ok how about you tell me what it's called then?

Because there's no way it's "proven sound".
Anyone who has done a moderate amount of parallel programming can see the issues here. If it's a good tradeoff is another issue. But this abstraction has clear cost and you should be aware of it.
>>
File: sci_recommendedMathList.png (974KB, 3840x2400px) Image search: [Google]
sci_recommendedMathList.png
974KB, 3840x2400px
>>58132288
Sublime... It works now!
import shutil, os
def listFiles(folder, indNum, numDirsLeft):
if(numDirsLeft == 0):
return
for file in os.listdir(folder):
tab = ' ' * indNum
newPath = os.path.join(folder,file)
print(tab+file)
if os.path.isdir(newPath):
listFiles(newPath, indNum+1, numDirsLeft-1)

inputDir = input("Please enter the base directory")
listFiles(inputDir, 1, 3)

DESU, not a huge fan of Python's use of indentation to mark blocks of code... Do you get used to it after a while?
>>
>>58132402
>Do you get used to it after a while?
Yes surprisingly.
>>
>>58132303
>But I'll concede that it's fairly unlikely the C# pajeets will write good enough code for it to matter.

stay mad nigger
>>
As to your other point, C# already has Tasks.
>>
>>58132442
>see C# task in task manager
>end process
feels good :^)
>>
>>58132466

nod an argubend xD
>>
>>58132475
you know what an igbo is?
>>
>>58132487

no
>>
>>58132527
the (only) non borderline retarded black ethnicity
>>
>>58132554

These igbo women are quite attractive.
>>
File: 1481992034859.jpg (263KB, 764x551px) Image search: [Google]
1481992034859.jpg
263KB, 764x551px
>>58130757
I will upload all the internet into my brain
>>
>>58132606
>only 2d chess
>lol

hey maybe we could make a little chess competition using our own alpha-beta searches on lichess or something, here on dpt
>>
>>58130040
javascript
>>
File: 1470464058486.png (106KB, 673x780px) Image search: [Google]
1470464058486.png
106KB, 673x780px
Why the fuck doesn't C++ support non-trivial designated initializer lists? There's no excuse for this shit.
>>
File: eg3.png (18KB, 674x352px) Image search: [Google]
eg3.png
18KB, 674x352px
>>58133143
operator overloading
>>
>>58133170
Yeah and just throw away my constness? no.
And that's fucking disgusting.
>>
>>58133185
you can do it in a const fashion, do it yourself
>>
>>58133202
I'd rather just manually fill out the stuff I need in a function or something than that pile of shit you posted above.
But above all, I'd rather the C++ standards committee got off their fucking assess and standardized a basic fucking feature that C has had for almost 18 years.

Fuck the committee. GNU doesn't even have an extension for it, what the fuck.
>>
>>58129408
hellooooo masterthread, what's popping?

thought i'd start a flame war:

> "What does object-oriented programming do better than functional programming, and why is it the most popular paradigm when everybody seems to say functional programming is superior?"

Saw that today.
>>
>>58130040
this doesn't seem right.. think you should read the API docs again. you shouldn't need to recursively call an API just to get nested comments
>>
>>58133228
C++ will never be a good language.
People need to accept that.
>>
>>58133252
But it's so easy to make it a good language.
It's as if the committee doesn't WANT C++ to be a good language.
>>
>>58133258
No, it isn't.
C++ will never be good.
>>
>>58133143
y u no link list
>>
>>58133258
>>58133284

And to add to this, you can't just add, you need to remove.
To make C++ good, you would have to remove EVERYTHING, because everything is shit, and start from the ground up.
AKA make a new language.
>>
>>58133300
Because you're fucking retarded.
>>
>>58133309
u spicy
>>
File: 13dd7f68bcf828d5.jpg (14KB, 375x366px) Image search: [Google]
13dd7f68bcf828d5.jpg
14KB, 375x366px
>>58129692
>>
File: ham.gif (40KB, 405x200px) Image search: [Google]
ham.gif
40KB, 405x200px
>>58132402
Just use racket. i was into clojure as well but its so freaking slow you can only use it for java style applications and you have to wait for jvm to wake up... and annoying uberjars sometimes work, sometimes they dont...
>>
>>58133665
im fucking retarded... I meant >>58130191
>>
File: Untitled-1.png (12KB, 830x167px) Image search: [Google]
Untitled-1.png
12KB, 830x167px
i'm trying to remove the protection on a certain piece of trial software. it decompiles fine and and doesn't appear to be obfucscated but there are some parts of the code where visual studio is throwing up errors.

how to fix this error?
>>
>>58133307
Yeah the committee has this problematic view that they don't create dialects just because their features all work together. But they (if they want a good language) promote the idea of only using subsets. It's a dialect in everything but name. And it pisses me off that they're wasting so much time (from other people) just because they're retarded.

Schools should just teach C.
>>
>>58133915
C has its own problems.
Schools should teach a proper language.
>>
>>58133791
Assuming intptr is a aptly named it'd be easy to just cast it to a byte* and multiply by sizeof(int)*stride.

Not sure why an intptr wouldn't support multiplication though. Odd.
>>
>>58133923
>C has problems
What problems? Nothing on the scale of other languages today.
>>
>>58133948
Very poorly typed, lacking in functionality, no module system, nothing like package manager, etc. Lots of extra nonsense.
>>
>>58133966
>Very poorly typed
Sure, it's not the best, but it's not that bad.
At least it's not dynamically typed.
>no module system
So? Also, C++ has no module system.
>nothing like package manager
Your system's package manager.
Your system has a package manager, right?
Also, same with C++.
>Lots of extra nonsense
Like what?

For its purpose, C is very well designed.
You need to think why C is designed the way it is, and it will make a lot more sense.
>>
>>58133966
On the other hand, its fast, no silly abstractions, simple, shit ton of libraries.
>>
>>58133979
>At least it's not dynamically typed.
Not good enough
>So? Also, C++ has no module system.
Yes, it doesn't.
>Like what?
All sorts of trivialities and features that make C not be a simple lanugage.

>For it's purpose
That's the problem, it's an outdated language designed to be portable (despite being based on principles that aren't as portable as they could be, especially these days), and ran by people determined not to update it.
>>
>>58133998
>Not good enough
>All sorts of trivialities and features that make C not be a simple lanugage.
>despite being based on principles that aren't as portable as they could be, especially these days
Why don't you actually give some examples. Everything you've said is vague and doesn't actually say anything.
>>
How many people do I need to take out to perform a coup and take control of the committee?
>>
>>58133923
Schools should teach multiple languages but also make sure their curriculum actually teaches people how computers work.

We can do jazz hands all day while speaking of the unsafe programming boogeyman but all that shit is always something to think about while you're writing in some other compiled/interpreted language. At some point, a programmer has to know these things. I'm not talking in-depth understand of low level system internals, but basic understanding of how computers work. Basic C is straightforward without the bloat of C#, or Stroustroup's insanity in current year C++. Even if not C, something else that teaches these things without added distractions.

And before you start listing off things you wish C had that your favourite language does, different languages have different applications and paradigms, so they have different toolchains and featuresets which is why I started my post saying schools should teach multiple languages. There is no one catch-all language, and trying to force a language to become is why we get kitchen sink trash like Ruby, PHP, and others.

>>58133966
>Very poorly typed
C is actually a strongly typed language. Implicit casting rules aside, it gives you a lot of shit for trying non-kosher things.

>no module system
Module systems come in many shapes and sizes. And I'm pretty the way libraries are organised for dynamic linking makes it qualify as modular. Languages like python do basically similar shit that C does with #includes.

>nothing like package manager
It uses your development platform's IDE's library manage or your OS has a package manager that can download / install / uninstall libraries at will. What more does it need in that avenue?

>lacking in functionality
>Lots of extra nonsense.
Translation: "Doesn't do what I want in my favourite language / I am full of shit"

Let's actually get to the crux of your argument.

What do you think is the perfect language for the thing(s) you think people use C for?
>>
>>58134036
Because there's just SO MUCH of it.

.h and .c for example
#include, and the way macros are done in general
lack of scoping or something like namespaces
no lambdas
the way arrays are done
many of the libraries
no type inference
very limited type system
>>
>>58134062
>but also make sure their curriculum actually teaches people how computers work
You mean teach a language without "function calls", for loops, while loops, malloc, etc?
If you want to know how a computer works, C isn't the way to go
>>
>>58134062
>What do you think is the perfect language for the thing(s) you think people use C for?
I don't think there is a language that's "a good C"
There's C, which is mediocre at being C, and there are languages that are good but aren't C like at all, and aren't good for C's purposes
>>
>>58134070
>You mean teach a language without "function calls", for loops, while loops, malloc, etc?
So...Befunge?
>>
>>58134093
no, assembly++
>>
>>58134065
>#include
It's a simple paste of the contents of a file into the current one.
It's easy enough.
>the way macros are done in general
Sure, AST macros are nicer. However, I would prefer some macro system than no macro system at all (like a lot of modern languages).
>lack of scoping
C has lexical scoping.
>something like namespaces
Namespaces are not a feature appropriate for C.
It would ruin C's conceptually simple ABI.
>no lambdas
Closures are a proposal for the next standard version (C2X).
>the way arrays are done
It leads to far less copying, and is easier for the compiler.
>many of the libraries
Third party libraries shouldn't be considered when judging the quality of a language.
>no type inference
Type inference is a crutch for languages with complicated type systems.
C's type system is pretty simple, so it wouldn't be much of a help.
>very limited type system
It gets the job done. What you're probably complain about is no generic types, or whatever, another feature not appropriate for C.
>>
File: sicp.jpg (167KB, 480x640px) Image search: [Google]
sicp.jpg
167KB, 480x640px
>>58133251
https://github.com/HackerNews/API
>The v0 API is essentially a dump of our in-memory data structures. We know, what works great locally in memory isn't so hot over the network. Many of the awkward things are just the way HN works internally. Want to know the total number of comments on an article? Traverse the tree and count. Want to know the children of an item? Load the item and get their IDs, then load them. The newest page? Starts at item maxid and walks backward, keeping only the top level stories. Same for Ask, Show, etc.

>I'm not saying this to defend it - It's not the ideal public API, but it's the one we could release in the time we had. While awkward, it's possible to implement most of HN using it.

nope, you have to do it this way
>>
Is https://www.bountysource.com/ search broken?
>>
>>58134070
>without function calls
How so?
>>
>>58134122
>It's a simple paste of the contents of a file into the current one.
>It's easy enough.
It's shit.

>namespaces are complicated
They don't need to affect the ABI, they can just be treated as longer names

>third
I'm talking about the built in ones

>a crutch for languages
No, it saves time and makes code better adapt to changes.

>it gets the job done
Not good enough

>>58134141
Function calls are just push pop and goto
>>
>>58134141
He's just a shitposter saying that assembly goto labels are different from function call abstractions.
>hurr one compiler doesn't do it the way I do it in my flavour of assembly, all of it is bad
>>
>>58134143
>just push pop and goto
But the C model of function calls corresponds to a set of CPU instructions. Just like an increment is usually a mov and an inc (or add).
If we're to remove function calls just like that we shouldn't have arithmetic either.
>>
>>58134143
>It's shit.
What else could you possibly expect #include to do?
>they can just be treated as longer names
Which fucks with the ABI.
If it's mandated by the language to implement the symbol as "namespace_symbolname", then there is no point, as you can just do "namespace_symbolname" yourself already.
>I'm talking about the built in ones
There is only one built in library: the standard library.
Calling a header file a library is wrong and misleading.
>No, it saves time and makes code better adapt to changes.
Hardly. It's just so people don't have to type std::vector<std::string>::const_iterator or whatever.
>Not good enough
Provide an actual argument.
>>
public static bool InRange(Vector3 target, Vector3 destination, Vector3 rangeMin, Vector3 rangeMax, bool checkX, bool checkY, bool checkZ)
{
return
((checkX && Mathf.Abs(destination.x - target.x) >= rangeMin.x && Mathf.Abs(destination.x - target.x) <= rangeMax.x) || !checkX) &&
((checkY && Mathf.Abs(destination.y - target.y) >= rangeMin.y && Mathf.Abs(destination.y - target.y) <= rangeMin.y) || !checkY) &&
((checkZ && Mathf.Abs(destination.z - target.z) >= rangeMin.z && Mathf.Abs(destination.z - target.z) <= rangeMin.z) || !checkZ);
}


Am I overthinking this?
>>
>>58134182
Everything 'corresponds to CPU instructions'.

>>58134168
C seems to be "good high-level abstractions" when convenient and "close to the machine" when other things are convenient
>>
>>58134210
>everything corresponds to CPU instructions
No there's plenty of things that don't in modern languages.
There's things that are translated into a varying set of simpler code.
C++ templates for instance.
>>
>>58134195
Make Vector3 a generic type, then you can compare two Vector3<T>s (where T can be compared) and give back a Vector3<Bool>
>>
Is there a way to force child classes of an abstract class to implement a specific constructor?
>>
>>58134232
>Make Vector3 a generic type
Not quite the goal, but I like your Vector3<bool> idea. I probably didn't think of it because I always associate numerical values to Vectors, which is not necessarily true when I think about it.
>>
>>58134250
No that's child abuse.
>>
>>58134469
>raising your child classes to follow your constructor methodology is child abuse
>>
File: 1475497611378.jpg (16KB, 365x346px) Image search: [Google]
1475497611378.jpg
16KB, 365x346px
>>58134250
yes, just use pubic final abstract class Foo
>>
>>58134250
Declare the constructor? I haven't done OOP in a long time but isn't the point of an abstract class that it provides declarations of what has to be implemented when you inherit from it?
>>
If I believe I can reduce the number of necessary classes, should I always do that?

It comes at the cost of having quite complicated classes.
>>
>>58134535
choose for yourself
>>
>>58134535
If a data type doesn't actually represent any actual data, trash it.
>>
>tfw to smart to program
>>
>>58134545
>>58134556

I believe it would be good, since you would have to add less classes to extend the functionality.

As things stand, I have a SubstanceParser and a Substance class, so one would have to write a WhateverParser and a Whatever class to parse Whatevers.

If the Substances could "parse themselves", one would only need to write an analogous Whatever class.
>>
>>58134568
OOP was a mistake.
>>
>>58134557
>six trig functions
Is he counting sec/cosec/cot?
And does he even know about the hyperbolic trig functions?

>sum/difference identities
This is high school stuff. It doesn't take long to derive.
>>
>>58134574
so was your conception.
>>
>>58134574

Sometimes, I feel like that too.

But all commercial software development is OOC.
>>
File: C ++.png (13KB, 422x238px) Image search: [Google]
C ++.png
13KB, 422x238px
>>58134574
OOP was THE mistake
>>
>>58134590
so was your defecation
>>
>>58134593
>OOC
I meant, OOP
>>
File: 1481539961641.jpg (17KB, 353x332px) Image search: [Google]
1481539961641.jpg
17KB, 353x332px
>>58134595
you might want to give it another try
>>
>>58134608
Are you fucking retarded?
What he said was pretty obvious.

It's not surprising that someone who defends OOP is an idiot, though.
>>
>>58134620
No, she's saying that she's a girl and so she doesn't shit.
That's also why she doesn't understand programming paradigms
>>
>>58134620
just because its clear doesnt mean its not retarded
>>
>>58134636
This. OOP is clear and retarded. It's clearly retarded.
>>
File: 1477825178477.png (785KB, 524x753px) Image search: [Google]
1477825178477.png
785KB, 524x753px
>>58134643
there is an extra thread for unskilled functionalwheenies like yourself. you might want go there
>>
>>58134650
/dpt/ accomodates all forms of programming - functional programming, non-OOP non-functional programming, shit programming, etc.
If you want a thread dedicated to OOP then make it yourself.
>>
the reason why OOP is the dominating paradigm in commercial software development is that it allows for the easiest templating.

you dont have the time to build programs from scratch, so you turn everything into a library of classes and draw from that.
>>
>>58134650
but fp can be oop?
>>
>>58134663
>/dpt/ accomodates all forms of programming - functional programming, non-OOP non-functional programming, shit programming, etc.

i would argue /dgt/ is adequate only for the latter.
>>
>>58134675
go ahead, argue
>>
>>58134663
yes, except fp. they chose to have their own circle jerk thread to live out their passive aggressive butthurt about oop
>>
>>58134665
The reason OOP is popular because it was a forced meme that promised to fix all of your software development problems, make programs reusable, and solve world hunger.
People eventually began to realise that it doesn't do any of those things, and it's actually a terrible way to design programs, and causes far more problems that it solves.
You still have fags like >>58134650 who still live in denial though.
>>
Daily reminder that anti-OOP-fags are the Amish People of the programming world and not taken seriously.
>>
>>58134704
You haven't understood, have you?
Allow me to put this in terms you'll understand

class Programming {}
class OOP : public Programming {}
class FP : public Programming {}


std::vector<Programming*> dpt;
std::vector<FP*> fpt;

..
dpt.push_back(new OOP()); // OK!
dpt.push_back(new FP()); // OK!
fpt.push_back(new FP()); // OK!
fpt.push_back(new OOP()); // BAD
>>
Is the child of an abstract class forced to initialize all of its variables?

Or only of all its methods?
>>
>>58134593
>But all commercial software development is OOC.
Doesn't change anything. People have held odd beliefs on large scales before. Nothing is to say that wouldn't happen in programming.
>>
>tfw no bonus on your last paycheck
REEEEEEEEEEE
>>
>>58134754
should have used oop instead of fp
>>
>>58134758
B...but I write muh enterprise Java code.
>>
>OOP isn't a mistake
Then why is it one letter short of OOPS?

>FP isn't masturbatory
Then why is it one letter short of FAP?
>>
Is it possible to point at a class, without initializing a specific object?

I want to tell an object it has to use the methods of said class.
>>
Why do OOPfags always act like functional programming is the opposite of it?
It's a false dichotomy.
>>
>>58134782
why would you expect them to know or understand this?
>>
>>58134780
in java, yes
>>
>>58134804

Wonderful! How do I do this?
>>
>>58129893
The argument to your main will be a String in Java.
>>
>>58134810
Foo foo;
foo.insert(dick);
>>
>>58134820

while (You) {
fuck.off();
>>
when did this
mything.foo();


become more sexy than this?
mything_foo(struct mything *self);
>>
>>58134843
>_foo
>>
>>58134843
are you mentally challenged?
>>
>>58134804

how?? never heard about this.
>>
>>58134877
delete the system32 folder, it blocks this functionality :)
>>
Are there any machine learning models that generate a signal?

All machine learning is either classification (output is basically an enum) or regression (output is a single float value).

I want a model where the output is a continuous signal.
>>
>>58134896
yeah, i invented one the other day but it's still a secret
>>
>>58134896
Can you not just take something that outputs a single float, and just fire it continuously?
>>
>>58134954
That would output the same float every time.

I want it to learn how to generate specific signals.
>>
fuck these MIT scrubs
>>
>>58134663
>If you want a thread dedicated to OOP then make it yourself.
>OOP leaves /dpt/
>FP leaves /dpt/
What does remain here?
>>
>>58134843
>
mything_foo(struct mything *self);

(Incomplete) Declaration
>>58134843
>
mything.foo();

Function call
>>
File: fragzeichen.jpg (91KB, 1280x720px) Image search: [Google]
fragzeichen.jpg
91KB, 1280x720px
Do I need to know anything other than C, Scheme, and Javascript?

That seems to cover low-level, high-level, and net-level. Surely anything else is redundant.
>>
>>58134978
based C programmers
you can go join the oop plebs for all i care
>>
>>58134896
>I want a model where the output is a continuous signal.
This can't be solved with DISCRETE machines, nigga.
>>
>>58134963
Do you not have continuous input?
>>
>>58134978
Imperative/declarative/procedural/event driven/structured/automata-based programming paradigm programmers.

Only complete morons think OOP and FP are the only two paradigms.
>>
>>58134988
Then how do you play music on your DISCRETE computer m8.

Of course the signal will be discrete.
>>
>>58134986
>C
>low-level
>>
>>58135003
>applying it's not
>>
>>58134986
Anyone who claims to be good at C should also have a decent understanding of assembly languages in general.
>>
>>58135013
C and assembly are very different
>>
>>58134986
>surely anything else is redundant
Well you learned C.
Anything more high level than C is probably best done by just doing C metaprogramming or writing your own language that compiles to C.
>>
>>58135019
Chicken Scheme compiles to C.
>>
>>58135000
>declarative
Haskell remains here
>>
>>58135003
>>58135009
Calling any language "low level" or "high level" on a absolute scale is pointless.
You could basically argue that anything is low level or high level.
It's only useful to compare the "level" of languages with each other:
"C is lower level than Scheme".
>>
>>58135013
No practically anyone can be good at C. It's not hard.
But to be good at writing efficient programs you need to know your platform. Which is entirely different from knowing assembly.
>>
>>58134989
I do, but it can't be transformed into a signal easily.

For example, lets say you want a ML model that learns how to output a single tone.
You have a single input (pitch) and a single output (the waveform of the input pitch).
In this specific case, the input would be constant.
>>
>>58135028
You could make time an input
>>
>>58135024
Maybe I didn't make myself clear. Those paradigms but excluding the specific sub-categories mentioned would remain. FP and OOP were explicitly excluded.
Unless you argue that haskell is not a functional programming language for some reason.
>>
>>58135018
>>58135027
Knowing assembly give you an even deeper understanding about C and programming in general.
You'll learn about calling conventions, syscalls, how the runtime stack actually works, and so on.
You don't need to be amazing at assembly, or even be able to write anything that isn't trivial, but it just gives you a better understanding about programming.
>>
>>58135047
How would you encode time as an input?
>>
>>58135061
uh
>>
>>58135058
>Knowing assembly give you an even deeper understanding about C
Not C specifically.
>programming in general.
Probably, depends on who you are.

I agree that having some familiarity with ASM is very useful. But it's not like you can't be a good C programmer without it. You will be jumping through some hoops to avoid it but it works.
>>
>>58134877
If you want to get a Class object then use
Foo.class
to turn a class name into a variable. If you want a Class from a random object then you can use the getClass() method for that object.

If you mean how to limit access to only certain methods or whatever then change variable type. So for example:
Object o1 = new String();

String s = new String();
Object o2 = s;

Both object 1 and object 2 are Strings, but the compiler will not allow any string-specific methods to be used. So
s.charAt(1)
will work fine but
o2.charAt(1)
is not allowed and will not compile even though it refers to same string object.
>>
Are there any good books on procedural programming?
>>
Levensthein distance so im reading this shit to implement something and im thinking why cant you just take sizeof (string A) - size of(intersect A,B) that should do it no? (intersect as operation on sets)
>>
>>58135026
>Calling any language "low level" or "high level" on a absolute scale is pointless
Except high level languages apply to languages that have any abstractions, in the opposite to low level languages (i.e. assembly and machine code itself).
Calling C low level just because it can operate directly with memory is not right. Pascal also can, C++ also can, but they are not called low level, aren't they?
>>
>>58135083
String is not a set, its a list.
>>
>>58135081
Does procedural programming really need that much explanation?
It's sort of the 'obvious' way to program. You just call functions of data, to modify the data into a form that you want.
>>
>>58135000
You forgot
print *, 'Non-structured programming\n'
goto 1
>>
The ability to examine and manipulate a Java class from within itself may not sound like very much, but in other programming languages this feature simply doesn't exist. For example, there is no way in a Pascal, C, or C++ program to obtain information about the functions defined within that program.


This triggers the Sepplesfag.
>>
>>58135101
Depends on how well you want to program. I've recently discovered for myself that I'm not that good at developing procedural code on a larger scale. Yet it's being done all over the place and it overall seems like one of the best ways of programming.
So I'd like to learn more to get in the right mindset at least.
>>
>>58135108
Please, anon.
We don't talk about that anymore.

Also, that is actually covered by straight imperative programming.
>>
>>58135118
sounds like a good feature
>>
pitch can be related to time
changing the iterator value over the indices of a wavetable array resamples the waveform to a certain pitch

I don't know anything about machine learning, but you could provide a target pitch in hz, a variable iterator value for the wavetable, and the output would the correct iterator value applied to a function that loops over the wavetable array constantly?
>>
>>58135118
With all the junk C++ has come up with you'd think they'd at least have some decent introspection/reflection by now.
>>
>>58135147
all dependent on a set sample rate, of course
>>
>>58135147
I should also say that for anything other than whole chromatic scale shifts, the iterator will be a float value, meaning that the correct amplitude of any index on the wavetable exists in a "phantom index" between two integers that must be interpolated

so the output that governs the signal would be a float applied to an array at a constant sampling rate
>>
>>58135164

Reflection is for .NET programmers.
>>
>>58135118
I still don't understand why that would be useful at all.
>>
Does anyone have the list of /g/ programming challenges image????
>>
It's here boys!

https://docs.python.org/3.6/whatsnew/3.6.html
>>
How the fuck am I supposed to write a file in Rust? https://doc.rust-lang.org/std/io/struct.BufWriter.html has no option to write a BufReader.
>>
>>58135542

https://doc.rust-lang.org/std/fs/struct.File.html
>>
>>58135541
>PYTHONMALLOC environment variable can now be used to debug the interpreter memory allocation and access errors.
I don't get why so many programming languages have to try and insert themselves to every single use case.

Surely if you're doing python you're not doing weird memory shit. Why not use a language that's built around that then?

This shouldn't be needed if they do their job right.
>>
So im writing fuzzy search using levenshtein distance, currently i've set it up so it returns result if levensthein distance is lower than strlen / 2. And it gives pretty good results. How do i determine best treshold?
>>
>>58135653
use fuzzy search to tune the hyper parameters as well
>>
>>58135632
Python tries to be a general purpose language

What it should be, is a general purpose *scripting* language
>>
Wooo!

https://www.youtube.com/watch?v=wrwwa68JXNk
>>
>>58135689
I can't tell if that voice is synthesized or not
>>
>>58135653
Okay so this is pretty interesting, this could actually be useful

"kernel config gentoo" matches kernel-config-4.4.6-gentoo

"Pic tures" matches Pictures

"music" matches music
>>
>>58135061
man 3 clock
>>
Finished my feed downloader. Now it's time to speed it up.
use std::env;
use std::error::Error;
use std::fs::File;
use std::io::{BufReader, BufWriter, Read, Write};
use std::path::PathBuf;

extern crate hyper;
use hyper::client::Client;

extern crate rss;
use rss::Channel;

const SUFFIX: &'static str = "torrent";

fn torrent(client: &Client, out_path: &str, name: Option<String>, url: Option<String>) -> Result<(), Box<Error>> {
let name = name.ok_or("no name")?;
let mut buf = PathBuf::from(out_path);
buf.push(&name);
buf.set_extension(SUFFIX);
let path = buf.as_path();
if !path.exists() true {
let url = url.ok_or("no url")?;
let mut response = client.get(&url).send()?;
let file = File::create(path)?;
let mut writer = BufWriter::new(file);
let mut body = vec![];
response.read_to_end(&mut body)?;
writer.write(&body)?;
}
Ok(())
}

fn feed(client: &Client, out_path: &str, url: &str) -> Result<(), Box<Error>> {
let response = client.get(url).send()?;
let reader = BufReader::new(response);
let channel = Channel::read_from(reader)?;
for item in channel.items {
if let Err(e) = torrent(client, out_path, item.title, item.link) {
println!("{}", e);
}
}
Ok(())
}

fn main() {
let client = Client::new();
let mut args = env::args().skip(1);
let out_path = args.next().unwrap();
for url in args {
if let Err(e) = feed(&client, &out_path, &url) {
println!("{}", e);
}
}
}
>>
C++

 auto i = {1,2,3};  


what does this create?
>>
gimme a cool project to do to learn F#
>>
>>58135759

An object of type std::initializer_list<int>

Yeah...
>>
>>58135759
an array of autos
>>
>>58135774
what is that good for?

>>58135777
doesn't seem to be an array

can't access i[1]
>>
>>58135759
refugees
>>
>>58134963
I don't think you understand how digital signal processing works.
>>
File: BlogPost-Fig2-Anim-160908-r01.gif (560KB, 570x262px) Image search: [Google]
BlogPost-Fig2-Anim-160908-r01.gif
560KB, 570x262px
>>58134954
This is what DeepMind did for WaveNet

https://deepmind.com/blog/wavenet-generative-model-raw-audio/
>>
why are there two threads
>>
>>58135791

Initializer lists are an array-like object that's really only supposed to be used as syntactic sugar for certain constructors. Under the hood, it's a temporary array, but you can only really access members of it through a ranged-based for loop (it responds to begin() and end() methods, but not the [] operator).

Literally its only purpose is to serve as temporary storage to be copied away into a buffer of some sort.
>>
>>58135857
One is for real programmers, the other for people who just want to shitpost
>>
>>58135759
A compiler error.
>>
>>58135893
i can't tell which is which
>>
File: out.webm (407KB, 500x525px) Image search: [Google]
out.webm
407KB, 500x525px
>>58129408
>>
>>58135805
I don't think you understand that doing the same thing twice will yield the same result.
>>
>>58135755
what an abomination of a language
>>
>>58135759
An initializer list with T = int.
>>
>>58135932
Never heard of seq2seq?
>>
>>58135919
Quite nice. I'll buy one.
>>
>>58135942
Thank you. Have the optimized version:
use std::env;
use std::error::Error;
use std::fs::File;
use std::io::{BufReader, BufWriter, Read, Write};
use std::path::{MAIN_SEPARATOR, PathBuf};
use std::sync::Arc;
use std::thread;

extern crate hyper;
use hyper::client::Client;

extern crate rss;
use rss::Channel;

const SUFFIX: &'static str = "torrent";

fn torrent(client: &Arc<Client>,
out_path: &str,
name: Option<String>,
url: Option<String>)
-> Result<(), Box<Error>> {
let name = name.ok_or("no name")?;
let name = name.replace(MAIN_SEPARATOR, "-");
let mut buf = PathBuf::from(out_path);
buf.push(&name);
buf.set_extension(SUFFIX);
let path = buf.as_path();
if !path.exists() {
let url = url.ok_or("no url")?;
let mut response = client.get(&url).send()?;
let file = File::create(path)?;
let mut writer = BufWriter::new(file);
let mut body = vec![];
response.read_to_end(&mut body)?;
writer.write(&body)?;
}
Ok(())
}

fn feed(client: &Arc<Client>, out_path: &str, url: &str) -> Result<(), Box<Error>> {
let response = client.get(url).send()?;
let reader = BufReader::new(response);
let channel = Channel::read_from(reader)?;
for item in channel.items {
if let Err(e) = torrent(client, out_path, item.title, item.link) {
println!("{}", e);
}
}
Ok(())
}

fn main() {
let client = Arc::new(Client::new());
let mut threads = vec![];
let mut args = env::args().skip(1);
let out_path = args.next().unwrap();
for url in args {
let client = client.clone();
let out_path = out_path.clone();
threads.push(thread::spawn(move || {
if let Err(e) = feed(&client, &out_path, &url) {
println!("{}", e);
}
}));
}
for thread in threads {
thread.join().unwrap();
}
}
>>
>>58136023
C programmer here

wtf is this
const SUFFIX: &'static str = "torrent";
>>
>>58136032
I suck at explaining, so I'll quote the docs:
let greeting = "Hello there."; // greeting: &'static str

"Hello there." is a string literal and its type is &'static str. A string literal is a string slice that is statically allocated, meaning that it’s saved inside our compiled program, and exists for the entire duration it runs. The greeting binding is a reference to this statically allocated string. Any function expecting a string slice will also accept a string literal.
>>
>>58136023
>optimized
You sure you don't just mean threaded?
>>
>>58136056
My goal was to make it faster and I did that with treading. That's optimizing imo.
>>
File: 1482007225219.jpg (58KB, 600x415px) Image search: [Google]
1482007225219.jpg
58KB, 600x415px
when adding a project to a git repository how to i achieve that it doesnt take the toplevel folder too

I want to add Project Foo to repository Bar. when I do that it is:

Bar/FOO/src/...

instead of
Bar/src/...
>>

fn torrent(client: &Arc<Client>,
out_path: &str,
name: Option<String>,
url: Option<String>)
-> Result<(), Box<Error>> {

WHAT THE FUCK HAHAHAH
absolute clusterfuck
im learning rust myself, just because it's such a meme
>>
>>58136067
Is it rust you say?
Maybe it is considered optimizing if that's what you're working with.

I'd probably just be more specific in that case.
>>
>>58136077
What's wrong? I don't like Rust myself but that signature looks perfectly reasonable. Care to elaborate what's so clusterfuck about it?
>>
>>58136077
You could wrap those arguments in a struct to improve readability. I didn't see the point in that for such a trivial program.
>>
>>58136091
>>>>>>&&&&&&<<<<>>>>>>(((()))
just use C man
>>
>>58136119
>&************************************(*)

wow it seems like C suffers from similar symptoms
>>
>>58136124
except almost every line is like that on rust
>>
>>58136124
>>58136135

as it turns out, the inner workings of a computer are hard to represent as a language

use whatever language has the best tools and stuff
>>
rust kinda looks like perl
>>
>>58136147

>rust kinda looks like crap
FTFY
>>
>>58136153
Isn't that what he said?
>>
>>58134896
>output is a single float value
and it's changing based on different inputs, not good enough?
>>
>>58136153
You'd know what crap looks like!!!
>>
>>58136153
much more human readable than C++

what gets me on job interviews and shit is reading quickly others' C++ code.
>>
>>58136153
Is it worth learning in your opinion? I'm learning it to create meme spaghetti code to laugh at
>>
>>58136153
>ruby kinda looks like crap
FTFY
>>
>>58136023
>letletletletlet
>>
>>58136218
>endendendendend
>>
>>58136240
lua?
>>
>>58136240
what?
>>
>>58136240
>(foo (bar (faz (fag (trap (just (fuck (my (shit (up))))))))))
>>
>>58136331
>ERROR: mismatched parentheses near (
>did you mean ( ?
>>
>>58136331
up . shit . my . fuck . just . trap . fag . faz . bar $ foo
>>
>>58136359
>Not eta-reducing
up . shit . my . fuck . just . trap . fag . faz . bar
>>
>>58136331
&((*just)->fuck->my->shit->up)
>>
>>58136418
shit_t my = *((just *) fuck - up)
>>
>>58136141
>the inner workings of a computer are hard to represent as a language
Absolutely not.
>>
>>58136546
nice example of a language that represents the inner workings of a computer

I will surely look into it
>>
discovering the java reflection package doubles your programming abilities, seriously.
>>
>>58129692
>cold steel of a shotgun barrel on my tongue
>learning meme programming languages

Basically the same thing fambamalamadam. Kill yourself :)
>>
>>58136571
Trying to identify and manipulate the state of a machine in fine detail defeats the object of using a high level language in the first place.
Assembly illustrates beautifully how it is possible with very little complexity, and as an extension possibly even C, mostly due to its bare-bones nature.
The more syntactic sugar a language throws on, the less computationally accurate it naturally becomes.
>>
>>58129692
>in a land of 13,000,000 jobless

ehm ... spain?
>>
>>58136875
>This is ill-formed in C++17.

isn't everything ill-informed in C++?
>>
Does someone here have experience with Java reflection?
>>
>>58136900
>>
Is it possible to do this
Object obj = Class.forName(objectName).newInstance(); 

with anything other than Object as type?
>>
>>58137069
for example, with
CustomObject obj = Class.forName(objectName).newInstance();

?
>>
>>58137079
cast it
>>
>>58137110

so that is the only method and acceptable?
it seems extremely type-unsafe, but if thats how it is ...
>>
why use OOP when you can use functional programming with a DB?
>>
>>58137148
why use fp when you can be productive and get things done
>>
>>58137148
why use functional programming with a DB if you can use OOP?

OOP simply integrates DB functionality into the language itself, why do whiners complain about it
>>
New thread:

>>58137159
>>58137159
>>58137159
>>
>>58136398
Wrong
Thread posts: 315
Thread images: 28


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