[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: 312
Thread images: 27

File: 1480590811928.png (389KB, 934x1000px) Image search: [Google]
1480590811928.png
389KB, 934x1000px
What are you working on, /g/?

Old thread: >>57881933
>>
File: dijkstra.png (44KB, 643x220px) Image search: [Google]
dijkstra.png
44KB, 643x220px
What did Dijkstra mean by this?
>>
>>57887365
He's an academic and unable to see the worth of practicality.
>>
>>57887365
I think he's trying to tell us to use C#.
>>
>>57887341
I'm working on a match-3 game on android for a university assignment and I have no idea how to make a grid and fill it with objects. All I know is that I'll need two-dimensional arrays. Kill me pls I'm so retarded.
>>
>>57887391
>Java is "practical" when Haskell code is shorter, safer, and more efficient
>>
>>57887365
*tips*
>>
>>57887406
That's irrelevant if it's not readable, easy to write, and Entreprise friendly.
>>
>>57887419
>readable, easy to write
It is if you learn it.

>Entreprise friendly
What does this even mean?
>>
>>57887406
haskell is straight up trash
>>
>>57887422
>>Entreprise friendly
>What does this even mean?
shit
>>
>>57887419
>>57887422
Can haskell even extend multiple classes?
>>
>>57887422
>It is if you learn it.
That's like saying that it's nice to be an hostage is nice if you get Stockholm Syndrom.

>What does this even mean?
It needs to have a wide selection of libraries, and companies like Oracle that you can pay to take the blame and fix your shit when your mismanaged Entreprise project inevitably goes wrong.
>>
>>57887422
>>Enterprise friendly
Generally that the subject is actively and widely used through out an industry leading to widespread and integrated compatibility between a variety of products used by that industry.

Basically, Enterprise Friendly = Popular
>>
>>57887449
Haskell doesn't have OO classes. It has type classes, which are souped-up interfaces.

>>57887457
>>57887457
>It needs to have a wide selection of libraries
I understand that NOW Java is way ahead, but when both were relatively new that could not have been an argument. Library support is a vicious circle.

>>57887468
Vicious circle.
>>
>>57887478
>Vicious circle.
Exactly. It's the same reason with any product. Look at Texas Instruments for example.
>>
>>57887478
>I understand that NOW Java is way ahead, but when both were relatively new that could not have been an argument. Library support is a vicious circle.

Haskell has an unfamiliar syntax and rules without having a clear advantage, by the time enough people got used to its weirdness to make it halfway usable it's no surprise Java was miles ahead.
>>
functional programming in general is shit, especially for anything non-trivial, like in mathematica it's easy to dick around with simple stuff, but good luck with verifying correctness and optimizing performance for anything remotely complex, you can't program serious applications like that
>>
>>57887510
People who only know one paradigm, or absolutely hate one paradigm without understanding it, are misguided.
>>
File: .png (46KB, 200x200px) Image search: [Google]
.png
46KB, 200x200px
What should I use Prolog for?
Is there some efficient way to learn it?
>>
>>57887510
>good luck with verifying correctness and optimizing performance for anything remotely complex, you can't program serious applications like that
Many "serious applications" do need to be programmed like this. Medical, transportation, military, etc.

Currently this is done by programming in one language and proving in another, but functional programming promises a unification.
>>
File: 1479525480878.jpg (50KB, 720x720px) Image search: [Google]
1479525480878.jpg
50KB, 720x720px
>>57887510
>good luck verifying correctness
>in Haskell
>>
>>57887422
>>57887478
>What does this even mean?

Java is designed in such a way that it is extremely explicit and you can "lock down" and hide implementation details from anyone that shouldn't be fucking with them.

The point of "enterprise-friendly" is that you compartmentalize and design your code base in such a way that it can be maintained by 3,000+ people across a codebase that is millions of SLoC.

Whether or not that is true, another aspect to it being "enterprise-friendly" in the current era is that there is support you can pay for in case something goes wrong, massive quantities of examples and libraries, and a large set of (localized!) tools and frameworks geared towards huge dev teams working all over the world.
>>
>>57887516
you forgot to shit on OOP
>>
File: Weird Output.png (75KB, 1097x541px) Image search: [Google]
Weird Output.png
75KB, 1097x541px
Can anyone help me with my Python/Sub processed bash script?


Using Paramiko, I am logging into a device remotely via SSH and executing a grep. However, I am noticing that the script is emitting unexpected output, see the picture for an example. Can anyone understand why the script is not behaving properly when it actually should be (compare the bash manual checks)
        for cve_id in cve_id_list:
print '[I] rpm -qa -changelog ' + 'openssl' + ' | grep ' + str(cve_id)
stdin, stdout, stderr = ssh.exec_command('rpm -qa -changelog ' + 'openssl' + ' | grep ' + str(cve_id)[1:-1])
output = stdout.readlines()
type(output)
print '[O]'.join(output)
>>
>>57887531
But then what she said would be hypocritical.
>>
>>57887510
>>57887527
Promises and delivers, I should say.
>>
>>57887510
>you can't program serious applications like that
What is Erlang?
>>
>>57887531
Object-oriented programming is a successful and useful paradigm, that had been abused for a while.
>>
File: haskelel2.jpg (745KB, 1920x1080px)
haskelel2.jpg
745KB, 1920x1080px
>>57887528
>>
>>57887519
http://www.learnprolognow.org/lpnpage.php?pageid=online
>>
>>57887540
that's the joke. smug FP tards often say OOP is shit

also
>she
>>
>>57887552
why didn't they just use Data.Aeson ?
>>
>>57887570
>she
It's They/Them/Xhem you shitlord
>>
is searching for a job really that difficult without education?
why not just lie on your CV?
>>
File: 1464763565326.png (56KB, 782x790px) Image search: [Google]
1464763565326.png
56KB, 782x790px
>>57887604
thou shalt not bear false witness
>>
>>57887604

Because they'll find out you genius when you can't even read or write
>>
>>57887604
If you lie on your CV and the interviewer or recruiters find out, you risk getting blacklisted and silently rejected by every company under the sun.
>>
>>57887604
if you're shit or mediocre it could be hard depending on your location. if you're good or great and have a portfolio and previous experience and such then it shouldn't be too difficult to find a job
>>
>>57887614
>giving a shit about some companies arbitrary demands
they brought it on themselves really

>>57887619
what?
obviously its a bad idea if you dont know what the fuck you're doing, meant for hobby programmers mostly
>>
File: yotsubaGetOut.jpg (106KB, 560x510px)
yotsubaGetOut.jpg
106KB, 560x510px
>>57887650
It's not good for anyone to lie on your resume.
You're making the world a worse place, I think you should kill yourself.
>>
Trying to keep inspired to just like make game.
Once again I made a discrete event simulated ai-ant-farm that I think is fun but bores everyone else.

Just going to keep lurking until someone with a good idea needs programming and wont vanish.
>>
>>57887650
>giving a shit about some companies arbitrary demands
Do you want the job or not?
>>
>>57887686
if they're not gonna respond to my app if i dont have an education, i got nothing to lose right?
>>
Today I found out that Ogame is still a thing after close to 20 years.

Of course the fuckers deleted my high school account. I think I'm going to write a bot for it and ruin some no-lifes' scores.
>>
>>57887698
>i got nothing to lose right?
Self-respect, and the knowledge that you're not a fraud, that you don't belong.
>>
>>57887677
But anon, I'm a neet and I have literally nothing to say about me.
Sorry for being useless
>>
Working on my terminal emulator, gave up on Wayland, too much effort for no gain.

Working on optimizing performance on macOS instead, but apparently the issue is Cairo itself being slow as fuck with the Quartz backend, it spends 36% of the time on cairo_fill, which should be the fastest thing to do since it's just drawing a line or rectangle.
>>
>>57887768
not me, nice try faggot

>>57887712
>Self-respect
i get what you mean, but unpaid bills are even worse
>>
>>57887768
Create a GitHub, start some useful projects, and contribute to Open Source.

What companies want to see is that you're Passionate, that you Know your Shitâ„¢, and that you're a reasonable, functioning Adult.

Life isn't something that happens to you, you have to make it happen.
>>
What languages would one have to learn to become a l33t (elite) h4x0r (hacker)?
>>
>>57887774
Shouldn't you be using some sort of a native API on macOS (Cocoa or whatever it's called)? Since otherwise people will be forced to have Quartz installed in order to run your program.
>>
>>57887810
Machine language
And I'm not talking assembly here, I mean 1's and 0's
If you can't even master that, then don't bother
>>
>>57887510
>in mathematica it's easy to dick around with simple stuff, but good luck with verifying correctness and optimizing performance for anything remotely complex
Wolfram Alpha is literally written in Mathematica

Wolfram Research's entire stack for their cloud shit is Mathematica
>>
>>57887810
x86 ASM
Python
C (and later C++)
>>
>>57887825
Quartz is the macOS compositor, what you're thinking of is XQuartz, which is the X11 port.
>>
>>57887809
>a reasonable, functioning Adult.
That sounds retarded, better kill myself then.
>>
File: image.png (2MB, 1920x1080px) Image search: [Google]
image.png
2MB, 1920x1080px
trying to find motivation to work on browser #113 some more. it's been like 6 months.
>>
>>57887840
Is this in order? Could you switch C and Python here? since i'm already learning C.
>>
>>57887854
Oh, that makes sense, thanks for clearing that up (I've never really looked into it).
>>
>>57887883
Preferably but not necessarily.
>>
>>57887900
Would this be cool too?
C -> x86 ASM (maybe study assembly alongside C) -> Python
>>
>>57887860
Just remember that you only have yourself to blame.
>>
>>57887934
Capitalism is a shit. I want to live in a meritocracy
>>
>>57887963
Come to Russia.
>>
>>57887963
In a meritocracy, dropping out of school and lying on your resume would not gain you any favors.

Meritocracy means you would have to be a better person, instead of relying on your parents.
>>
>>57887963
how are they mutually exclusive?
>>
>>57888067
It's easier to blame "capitalism" and "the system" than to accept the problem is oneself.
>>
>>57887963
>>57887986
>>57888082
>>>/pol/
>>
tmp = empty_array()
for i=1 to 4: {
generate_random_values(array1)
generate_random_values(array2)
generate_random_values(array3)
generate_random_values(array4)
for j=1 to 4: {
tmp += array1+array2+
array3+array4
}
}
save(tmp)


is there other way/better way of doing this?
i mean, instead of creating 4 arrays each time and concatenate them?

keep in mind that array1,array2..,, array4 are in the form
array = [(1,0,1),(0,0,1),(1,0,0),...]
>>
>>57888082
>>57888082
>>57888103
Capitalism at best is a measurement of popularity. You should go back to /r/eddit where you belong. Now I'm going to leave this thread, fap to my waifu and terminate my playthrough.
>>
>>57888121
have an array of arrays
>>
so I showed the girl in my programming class Haskell and functional programming in general and she said it's autistic and a waste of time? do I still try to fuck her or should I free() her?
>>
>>57888165
mem::drop(her)
>>
>>57888165
>Implying you have any chance
Try to make a move, but make sure to film it and put it on youtube.
>>
>>57888165
garbage collect her
>>
>>57888165
She makes a valid point.
>>
>>57888165
os.DevNull <- girl
>>
How do you even create a GUI without OOP?

It is just too damn convenient to have all these templates you only need to fill in.
>>
>>57888165
cat girl > /dev/null
>>
I have two questions I'd like some pro-expert input on. Regarding files:

1. Files, particularly images have metadata. It could be exif-data, some nasty shit the OS adds onto it like "tags", "rotation" or god knows what else. Main point is: there is an image beneath it all.

This shit mentioned earlier? It changes the hash beneath. If two users upload the same image, it will have a different hash because either of them did something stupid.

My question: should I also track the hash of the "stripped" file? I figure "yes", which brings me to #2:

Any great database table structures for describing files and their metadata, plus location?

An image doesn't have the same implicit metadata as a rar - e.g dimensions. Nor does an image have the same metadata as a gif or a video - duration and number of frames.

I want to solve this in the database, so I can make everything searchable.

please don't say "store it in an arrayfield xD"..
>>
>>57887365
So, how has Haskell changed since 2001, compared to how Java has changed since 2001?
>>
>C#

Is there a way to install visual botnet without upgrading to windows 8?
>>
>>57888328
I have VS 2015 installed on Win 7 so it should work unless they literally nigger rigged it to force people to upgrade. Perhaps you're missing a service pack or some required update.
>>
>>57888328
yes of course, upgrade to windows 10 HAHA
>>
>>57888328
?

My friend has VS on W7. And i bamboozed microsoft by sticking with windows 8.0.
>>
>>57888279
Declaratively, or using a GUI builder.
>>
>>57888159
what do you mean?
>>
>>57888165
Fuck her and allow the GC to free her
>>
>>57888121
>>57888121
BUMPERINO
>>
>>57888377
>GUI builder
But what does GUI builder use?
>>
>>57888300
>My question: should I also track the hash of the "stripped" file?
In general, probably not. Unless someone actually edits an image, then the OS will not tamper with the contents of the file.

Unless you explicitely want to track only the image itself and NOT the metadata, in which case convert the image to a stripped PNG or a .y4m and hash that.

>I want to solve this in the database, so I can make everything searchable.
If you want to make the metadata searchable, store the metadata in an actual SQL database along with the hash of the image.
If you want to be able to search for similar images, that's much more complicated.
>>
>>57888279
IMGUI
>>
>>57888400
What's your language?
>>
In C++, is there a way to store pointers to objects in a List container? Compiler's giving me an error that push_back() function can't be used with objects.

Rough pseudo-code:

class A //Parent class
class B//Inherits from class A
class C//Inherits from class A

Object p(float, string)//class B
Object q(float, int)//class C

std::list<A*> objectlist;
objectlist.push_back(p);
objectlist.push_back(q);

I'm thinking of using smart pointers but I'm not really sure if it's a good idea or not.
>>
>>57888401
Depends how the underlying framework works.
But you don't have to use OOP, there are GUI frameworks in C, and ultimately it all compiles down to machine code.
>>
>>57888439
python
>>
File: source2.jpg (59KB, 554x197px) Image search: [Google]
source2.jpg
59KB, 554x197px
Webscraper noob here again

How would i write the
 doc.DocumentNode.SelectNodes()


method to encompass these Xpath properties from pic related?

I need Link, Price, Title and Description
>>
>>57888443
This is because A * != A.
>>
>>57888443
You need to push_back &p and &q, not p and q if you're storing pointers.
>>
>>57888328
I've installed it on 7 just a few weeks ago mate
>>
>>57888448
>there are GUI frameworks in C
And they failed to provide object-less environment.
>>
>>57888165

Do neither. Find someone else. Consider a woman who doesn't already write programs.
>>
>>57888469
Have you seen Xorg?
>>
>>57888477

a woman like you, ruby-chan? :3
>>
>>57888453
Oh, i'm using C3 and HTML agility pack, if someone just saw this post and didn't see the others

I can find one attribute, but i'm lost when i have to find every single one
>>
>>57888498
>C3
c#, obviously
>>
>>57888484
Who uses Xorg directly at the end of MMXVI?
>>
>>57888429
>If you want to make the metadata searchable, store the metadata in an actual SQL database along with the hash of the image.

Yes, this is the exact plan. To be honest, I've remade my models/tables a dozen times already, and all I gain by doing it is more unfinished candidates.

>If you want to be able to search for similar images, that's much more complicated.

More complicated yes, but my plan is to use software like opencv, create more metadata so that I can search using a query. The entire image store will be used for training.

>In general, probably not. Unless someone actually edits an image, then the OS will not tamper with the contents of the file.
>Unless you explicitely want to track only the image itself and NOT the metadata, in which case convert the image to a stripped PNG or a .y4m and hash that.

The plan would be to simply strip all metadata. Some Windows versions actually change the image if you rotate it in the image viewer. Insanity, but it happens.
>>
>>57888515
Every higher-level GUI framework in existence, until we can finally replace X with W.
>>
>>57888518
>The plan would be to simply strip all metadata. Some Windows versions actually change the image if you rotate it in the image viewer. Insanity, but it happens
That's actually perfectly normal. For JPEG files it's possible to indicate the rotation in the metadata, but that setting isn't always correctly interpreted, so if you rotate it it'll generally be done the hard way.
>>
>>57888492

Neither of the descriptions (woman, doesn't write programs) apply to me. Get fucked, Anon.
>>
>>57888545
It's digital rape.
>>
File: Orc Grunt.jpg (184KB, 850x658px) Image search: [Google]
Orc Grunt.jpg
184KB, 850x658px
>>57888350
>>57888356
>>57888369
>>57888463

nvm fixed it by pirating
>>
>>57888583
That's my fetish
>>
>>57888461
Thanks man, it worked!
>>
>>57888121
LAST BUMP

ANYONE?
>>
>>57888672
I have no idea what you're even trying to do, since your code is so stupid it makes no sense
>>
https://www.youtube.com/watch?v=LG8ZK-rRkXo
These are fun to watch
>>
>>57888523
Yet that's framework what uses, not a usual programmer who makes some GUI program.
It's not like frameworks are programmed by robots, but we have different programmers, who descend down to machine code in order to make an assembly language on top of that. But it doesn't make me coding in binary, if I make some fizzbuzz.
>>
>>57888692
what i'm asking is:

is there a better way of doing this?
arr = []
for i in range(size):
->generate 16 arrays
(e.g. a1,a2,...,a16)
for j in range(size):
arr += a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16
save(arr)
>>
>>57888740
Okay. What is your point?

OOP is a nice way of making GUIs, I agree.
It's not the only way.
>>
>>57888587

>Orc Grunt.jpg
That is some subtle trolling, Anon.
>>
>>57888749
yes
make an array of arrays
>>
>>57888749
If a1+a2 means memberwise sum, then just generate one array array with values in 0..16 instead of 16 arrays.
If a1+a2 means concatenation, then just generate one array 16 times longer.
>>
>>57888769
i dont get it

explain it pls
>>
"I is the first, fourth, eleventh, sixteenth, ... letter in this sentence. When "ord('C')ord('C')" is a single number for a computer scientist, call that number Y. What is the Yth prime in the sequence? Numbers don't have ifs, ands, or buts."

Anyone know what ord('C') is supposed to mean?
>>
>>57888771
>If a1+a2 means concatenation, then just generate one array 16 times longer.

yeah they mean concatenation, but the arrays random values in them

so its 16 different arrays in each loop
>>
>>57888749

You know you can have an array of arrays, right? If you ever find yourself using variable names like a1, a2, a3, ..., use a goddamn array instead.

>>57888775

You make an array, call it a.
The elements of a are arrays.

So like...
a = [ [1, 2], [3, 4] ]
>>
>>57888801
arrays of arrays where?

in the second loop?

write the pseudo code to ilustrate your answer
>>
>>57888750
It can't be said that GUI builder is a way of making GUI if we are talking about OO and declarative ways of making GUI.
They just belong to different categories.

Anyway, how to make GUI in declarative way?
>>
>>57888827
HTML is a prime example of declarative GUI. You write some XML describing what you want and the browser gives you a GUI.
>>
>>57888793
Doesn't matter, just make one array with 16 times more elements. It's still random numbers even if the array is bigger.

Either there's something you're not telling me, or you have a fundamental misunderstanding of programming ...
>>
>>57888823
Dude, are you trying to add every corresponding element in one array to other element in second array or what?

What are you trying to accomplish?
>>
File: 1474251055928.jpg (30KB, 600x375px)
1474251055928.jpg
30KB, 600x375px
>>57888765
Fuck you Ruby. Your superiority over everyone makes me hate myself for not being as good a programmer as you. This makes me want to go on a spree targeting impolite software engineers everywhere.
>>
>>57888453
Anyone?

maybe it would be easier if i rephrase: how do i check in pic in this post for Title and Description and Price so it can give me the link? I'm using C#, html agility pack and xpath
>>
>>57888922
Have you tried learning by yourself?
People on the Internet won't be holding your hand through everything.
>>
>>57888935
I'm trying for the last 4 hours, i've managed to get one element but i can't figure out how to search through man elements

This whole thing is way above my head because i'm still learning basic OOP stuff but i won't back off
>>
File: thisIs4chan.jpg (134KB, 981x714px)
thisIs4chan.jpg
134KB, 981x714px
>>57888965
That's the spirit. Now I actually have no idea how to do what you're doing, so good luck with that!
>>
How should I organise this?

I have two completely separate screens, PlayScreen and LevelSelectScreen.

I will use different classes for both, so I want to keep them separate.

How do I do this properly?

Should I just have folders for each type of thing?
Eg
LevelSelectFolder.Sprites.Glows;

PlayScreenFolder.Sprites.Glows;
>>
>>57888781

>Anyone know what ord('C') is supposed to mean?
Return unicode code point of 'C', which is 67.

>>57888823

Replace
>Generate 16 arrays
with
>Generate array of 16 arrays

I'm not sure what problem it is that you're trying to solve, so I can't really elaborate beyond that. But under no circumstance should you be making a bunch of variables just named a1, a2, a3, ... especially when they are correlated.

>>57888887

If it makes you feel better, I have never been paid a cent to write software, and I'm aiming for a PhD, which means I'm probably going to end up doing research, rather than writing programs every day (although granted, research does involve some code writing, part of that can be left to undergrads).
>>
>>57889000
Is this Java? then why the actual FUCK did you give your packages capitalized names?

RECTIFY THAT SHIT
NOW
>>
File: 1asd.png (29KB, 1000x1000px)
1asd.png
29KB, 1000x1000px
>>57888871
look pic related

in A, i generate the first 16 columns and then repplicate in the next 16 lines
the values in B, i generate the next 16 columns and then repplicate in the next 16 lines

you get it?
>>
>>57889039
Dude you are retarded, period
>>
>>57889035
>Is this Java?
It is

>why the actual FUCK did you give your packages capitalized names?
The tutorial I followed to learn Java a year ago told me to

>RECTIFY THAT SHIT
>NOW
o-okay
>>
>>57889039
So you're still not telling me why you're not just generating one big array instead of doing that.
If you just want random values, it's as simple as that.

But you really don't want to tell me why you won't do that, so we're running in circles.

It's impossible to help you. Good luck.
>>
>>57887266
>You need to get the batch shell object references and re-instantiate all those objects back to the host and all of its clients
what exactly does this mean?
>>
>>57888781
It's basically C in ASCII.
>>
What is taught in a CS degree?

I'm quite good at programming, but all employers want a degree as standard.
>>
Who adderall here? I'm thinking of trying it.

>Side effects of Adderall include nervousness, restlessness, excitability, dizziness, headache, fear, anxiety, agitation, tremor, weakness, blurred vision, sleep problems (insomnia), dry mouth or unpleasant taste in the mouth, diarrhea, constipation, stomach pain nausea, vomiting, fever, hair loss, loss of appetite, and ...
>>
>>57889228

A combination of software engineering and computer science theory (data structures, automata, algorithms...). Some universities are heavier on the theory, some are heavier on the practical.
>>
dfdfdffgsdfgsgs
>>
I want to learn how to use network sockets so I can better understand an IoT project I'm working on.

Should I go through a WinSockets or Berkeley Sockets tutorial? Is there any loss/benefit to picking on or the other?

I have a Windows machine with Linux VM.
>>
>>57888133
>Capitalism at best is a measurement of popularity.
what do you mean by popularity? you can provide value without people liking you as a person.
>>
>>57889259
I've tried Modafinil and it's decent.

I'd try moda before you go for adderall, anon. It's safer as you can't abuse it, get addicted etc. Adderall is an amphetamine, whereas moda is not.
>>
>>57889259
Have you tried using other nootropics first? I have never used adderall but I think creatine, caffeine, and l-theanine has improved my concentration and output.
>>
>>57889228
There's a bunch of theory like the math behind big-O notation, algorithmic efficiency, automata, proof of correctness, systems design and modeling, data structures and algorithms. You're going to learn several languages with different paradigms and use them to create various small projects.
>>
>>57889259
I don't need that shit. I pride myself on being at the top of my game while still pure.
>>
>>57889301
I'll look into it. Thanks

>>57889304
I've never tried anything. The side effects of most medications scare me.
>>
>>57887341
what is the story behind this girl?
>>
>>57889277
>>57889324
Sounds like a mixture of terribly boring and fun at the same time.

>You're going to learn several languages with different paradigms and use them to create various small projects.
If I had a portfolio of several rather complex projects in different languages, C#, Java, JS, HTML, CSS and Python. Would this make me as employable or experienced as a degree holder, in the eyes of an employer?

I don't enjoy learning by reading books or listening to lectures. Finding information that I need as I need it is the only way I don't get bored. Never read a programming book, but I know quite a bit.
>>
>>57889389
>If I had a portfolio of several rather complex projects in different languages, C#, Java, JS, HTML, CSS and Python. Would this make me as employable or experienced as a degree holder, in the eyes of an employer?
It'll certainly a good thing, but if you don't have a degree what the employer will be (rightly!) scared of is that you don't know the theory.

You need to impress them on the math and the "boring" stuff, or you won't be as good as a degree holder in their eye. They'll make you invert a binary tree on a whiteboard if they have to!

>I don't enjoy learning by reading books or listening to lectures. Finding information that I need as I need it is the only way I don't get bored. Never read a programming book, but I know quite a bit.
That's not so good if you don't enjoy learning for the sake of it. It doesn't make you unemployable, but definitely don't put that forward too much.
>>
>>57889352
Modafinil is OK to use on off days when you're tired or need to get something major that doesn;t req imagination done, but using it regularly can be harmful and in the long run can fuck with your sleep.

Creatine + caffeine + theanine is a common stack that is very safe, and you should still notice gradual improvement.
>>
>>57887923
bump
>>
>>57888453
Cmon anon, you pointed me like an hour ago, is it possible you're not here now?
>>
>>57889445
>>57887923
Yes, it's perfectly fine.
Don't let people tell you that there's only one way or that there's a right answer.

If you enjoy learning and you don't give up, you'll get there either way by sheer curiosity.

If you want to do "hollywood hacker" stuff, those are pretty much the most common languages, but you're free to make your own path.
>>
>>57889259

If you do not have a medical need for it, do not use it. Sacrificing your health for a little more productivity is foolish. If you are too sleepy, caffeine should be sufficient. If you are too distracted, meditate, then try again.

>>57889389

>Sounds like a mixture of terribly boring and fun at the same time.
The theory isn't really that boring. Or at the very least, it grows on you a little.

>If I had a portfolio of several rather complex projects in different languages, C#, Java, JS, HTML, CSS and Python. Would this make me as employable or experienced as a degree holder, in the eyes of an employer?
Probably. You may want to consider an internship.

>>57889389

>I don't enjoy learning by reading books or listening to lectures. Finding information that I need as I need it is the only way I don't get bored. Never read a programming book, but I know quite a bit.
Most of the stuff you will need for the test will be on the lecture slides. I nonetheless recommend attending all of the lectures. If you have programming assignments, you will want to be in regular contact with your professor to clear up ambiguities. Many professors will dedicate class time to discuss the homework.
>>
>>57889287
bump
>>
>>57889287
They're both fairly similar, but Berkeley sockets are less insane.

At the end of the day it doesn't really matter, since if you can learn one it'll be easy to learn the other.
>>
>>57889420
>You need to impress them on the math
I have A grades in math, physics and electronics at A level. I don't know how much harder it gets at university, but I doubt a lot.

>They'll make you invert a binary tree on a whiteboard if they have to!
I don't know what this means, but I've designed simple CPU, RAM, SSD etc out of redstone in Minecraft without looking at guides or anything. Created my own bytecode language etc.
I guess this doesn't mean a lot to a 50yo employer though..

>That's not so good if you don't enjoy learning for the sake of it
I enjoy learning, just not via reading books or lectures.
>>
>>57889515
I'll apply for an internship or look for a decent job
I might go back to uni if I can't find anything

I dropped out of a physics degree, 21 hours of lectures and 20 hours of coursework a week.

CS degrees that I've looked at are only 12 hours of lectures a week. Might be manageable
>>
>>57889571
If you want to work in industry you'll have to learn how to deal w/ other people and other people's work.

If you don't know what anybody else is talking about, they'll simply not hire you, or hire you and you'll end up the office idiot. Good engineering and good code in is far, far more than functionality. it is also about useability, for other engineers as well as the end-user.
>>
>>57889571
>I have A grades in math, physics and electronics at A level. I don't know how much harder it gets at university, but I doubt a lot.
It gets much easier, but if you don't know the CS theory, you can't make it up.

The good thing is if you're good at math, you might already know the mathematical definition of big-O, which is more than most programmers know about the subject.

>I don't know what this means, but I've designed simple CPU, RAM, SSD etc out of redstone in Minecraft without looking at guides or anything. Created my own bytecode language etc.
To be honest, that is not very impressive from a technical point of view, as in most programmers could do that in their free time, but it shows passion.
It shows that you like programming, and that's a very good thing. Employers love a rockstar ninja 10x-er who eat code for breakfeast, even if that's just a bad stereotype.

>I enjoy learning, just not via reading books or lectures.
That's fine. How you learn is meaningless, as long as you actually do learn.

The problem with a lot of self-taught people is they only learn the fun stuff and not the theory, so they can't solve many hard problems efficiently and often they don't even know how to find an efficient solution.

For example if you don't know what a binary tree is, learn yourself some data structure, it's a pretty basic thing. Rarely used in your day to day code, but you're expected to know this.
>>
>>57889571
>Minecraft
Get out of here you vidya fag
4chan is 18+
>>
>>57889366
yuki nagato from some weeb show

it's the classic /dpt/ pic
>>
File: question mark cat.jpg (51KB, 400x323px) Image search: [Google]
question mark cat.jpg
51KB, 400x323px
>making basic 2D game
>client-server
>both players see same screen
>create objects on server with UUIDs
>send object data to clients
>create objects on client based on this data, store them in a dictionary with UUIDs as keys

is this the best way?
>>
>>57889672
Use Python and pygame for the game. Not sure about networking side.
>>
File: IMG_20161116_111659.jpg (665KB, 1944x2592px) Image search: [Google]
IMG_20161116_111659.jpg
665KB, 1944x2592px
When I finish cooking my lunch, can you help me with some R?
>>
>>57889684
Nobody here knows R.
>>
>>57889683
Thank you for the input but my question is exclusively about networking, I'm experienced in making basic games otherwise
>>
>>57889683
>Use Python and pygame
>>>/reddit/
>>
>>57889684
I read a R tutorial once.
>>
>>57889693
Shit.

>>57889719
Fuck.
>>
>>57889738
Just rewrite R in haskell! It'll solve all your problems, I promise.
>>
>>57888357
>>
>>57889672
PSA: Don't bother helping this guy, he will sperg out on you.
>>
>>57889752
https://tweag.github.io/HaskellR/
>>
>>57889648
Thanks for the help and advice. I'll buy a university text book and go through it

>>57889666
i did this when i was maybe 16, currently 21
>>
>>57889764
I'm actually impressed, autism knows no bound.
>>
>>57889763
what makes you say that anon
>>
>>57889779
https://hackage.haskell.org/package/inline-r
>>
>>57887859
both are absolute shit, like seriously. i'm guessing you'll be on python 2 for your course, and python 2 isn't deprecated just because the self-proclaimed language designer says so, and the differences between 2 and 3 are minuscule anyway, if you know one you'll figure out the other one easily
>>
>>57889603

Err... I'm suggesting an internship ON TOP OF the degree.
>>
>>57889805
i'm just here to talk about programming senpai
>>
>>57889818
So...is that you or not?
>>
>>57889672
The server should be the only authority that has anything to say about what's going on in the game.
The clients should merely act as input sensors and state representation.

For instance, when you send that UUID to the client, and the client does something with the object, verify on the server side that the player should still be in possession of that object, and only then react to the action. And so on.
>>
>>57889757
Anyone?
>>
>>57889831
>The server should be the only authority that has anything to say about what's going on in the game.
>The clients should merely act as input sensors and state representation.
no way
>>
>>57889847
Wow, >>57889763 was right
>>
>>57889847
>>57889831
What I'm asking is, are UUIDs as dictionary keys the best efficient way? That's mainly what I'm unsure about. With any given game or program I'd just be using references to objects as variables
>>
>>57889847
I know this is like a 101 but you wouldn't believe how many people are out there that trust the client with the data.
>>
>>57889854
>>57889828
>>57889805
just keep your autistic bullshit on /vg/ please...
>>
>>57889855
It depends entirely on your use case.
>>
>>57889857
I am the guy who asked the question originally, any idea regarding >>57889672?
>>
>>57889805
jesus christ

he shouldn't even be doing networking he should learn plain non-python programming and lots of other things first
>>
>>57889855
Use a list. Proven to be best in all and every case.
>>
>>57889899
this
>>
>>57889899
agreed
>>
File: 0_20161208_124630.jpg (390KB, 1920x1440px) Image search: [Google]
0_20161208_124630.jpg
390KB, 1920x1440px
>>57889764
I'm using plain R. My issue comes from being unable to print out those vectors in the data frame. It only saves the last vector for print out and I can't use variable[i] in the data frame
>>
>>57889911
>>57889907
these
>>
>>57889847
Are you trolling?
>>
>>57889875
What do you suggest for a simple 2D game as I described above?
>>
>>57889949
a linked list
>>
>>57889855
Without any further assumptions, I would say yes.

But stepping back a bit, is client/server the best efficient way? No.
>>
>>57889961
why's that better than IDs?
>>
Make sure it is single linked. With that many objects your game has, you can't afford to keep double references.
Don't worry about reverse traversal, only Mexicans go back.
>>
>>57889984
dude its like a list
and its linked
>>
>>57890013
Nah, it should be an on-disk SQL database instead of just a linked list.
What if he wants to search for objects?
>>
const UInt32 SWP_NOSIZE = 0x0001;
>>
File: fired.png (4KB, 486x77px)
fired.png
4KB, 486x77px
>>57890105
>UInt32
Stop.
>>
>>57890105
static constexpr const unsigned long long one = 1;
>>
File: 1479075180398.jpg (21KB, 514x536px) Image search: [Google]
1479075180398.jpg
21KB, 514x536px
>>57890013
>>
>>57890125
what did he do
>>
>ask question
>devolves into shitposting between third parties and one guy autistically replying to himself over and over
yikes
>>
>>57890170
Jani went rogue and nuked a lot of threads.

https://yuki.la/qa/767364#p767588
>>
>>57887341
nothing that'll be helped byu refering to that book
>>
>>57890125
>Manager
I didn't even know that capcode existed.
>>
>>57890238
Janitors are blue
Mods are purple
Managers are pink
Admin is red
And Developers are also blue (I think a darker shade, but I'm not sure)
>>
>>57890275
Janitors do not have capcodes.
I knew about all of the others, but manager but be a somewhat recent one.
>>
>What are you working on, /g/?
Messing around with the Doom source code. I ported all the X11 stuff to SDL2 and now am having an issue where events seem to be completely fucked, eg. after releasing keys they remain pressed (or even weirder, seem to toggle on/off on occasion) for a few tics/frames and can't figure out why it's happening. Why did I decide to subject myself to this?
>>
File: snap110.png (39KB, 503x172px) Image search: [Google]
snap110.png
39KB, 503x172px
>>57890312
Manager is a pretty old one, it just rarely posts publicly.

According to the screecaps of MRq, Janitors have capcodes on /j/, though they of course arn't allowed to post publicly.

Last I checked during the shitstorm the MRq pictures were an insta 30 days autoban, so I'm not posting them, but picrelated is part of it.
>>
What are some good resources for Java beyond pajeet tutorials on youtube? I'm looking at going through Head First Java and Java Concurrency in Practice
>>
>>57890455
Effective Java 2ed. is probably the closest thing to a "canonical" book for Java, if you haven't yet read it.

Internet tutorials (for anything, not just Java) are almost universally bad, and even when they aren't bad you're typically better off buying/pirating a quality book on the subject. I wouldn't really bother wasting your time looking up shit on youtube or whatever, with the possible exception of things like conference talks and the like.
>>
>>57890455
Core Java for the Impatient.
Effective Java.
>>
>>57890490
>>57890501
Thanks a lot guys. Glad I got some actual responses instead of

>java
>>
>>57890455
>java
>>
This might be a dumb question, but how do you learn best practices in a language? I'm talking after you go through the books and are pretty comfortable with a language, how do you know what the best practices in 2016 are? The only things I usually find are the odd post on Medium or another site like "C in 2016" or something similar. Of course reading the odd post on Stack Overflow will give you an idea but is there a more "centralized" way to learn this?
>>
>>57890544
Talking to other developers. Sometimes there are good books to help you e.g. Effective C++, Fluent Python.
>>
>>57889764
You know
This might be worth checking out in the future
>>
File: 1473442521136.png (21KB, 900x900px) Image search: [Google]
1473442521136.png
21KB, 900x900px
>GHC warns when tabs are used
>>
>>57890707
Kill yourself, dumb frogposter.
>>
>>57890707
Use atom, it will convert tabs to spaces
You stupid fucking frog
>>
>>57890744
I want my source files to have tabs for indentation, not spaces.
>>
I'm receiving text via a socket using Python.

If I just print it the text looks alright, but if I redirect/pipe it somewhere (e.g. do ./myscript.py > output) the text gets mangled with "^@" scattered all over.

What could be the reason for this and how do I deal with it?

I suspect encoding shenanigans.
>>
in ncurses can you format strings with %[whatever] like you can with printf
>>
>>57890755
That's stupid
You're stupid
>>
>>57890823
There is literally nothing wrong with tabs for indentation and spaces for alignment.
>>
>>57889571
>I don't know what this means

Then you have no chance.
Pic related.
>>
>>57890832
It means your code is less portable
How indented is a tab?
>>
>>57890885
Doesn't matter in the slightest, which is the point.
>>
>>57890889
Yes, it does
At what point do tabs turn into indentation?
>>
>>57890931
Wait, I thought you were referring to how large they appear (how many spaces they correspond to). What do you mean?
>>
>>57890945
How many spaces should a tab count as in Haskell?
>>
>>57890993
Doesn't matter as long as you aren't a drooling retard that mixes them. Haskell always compiles fine for me besides the pointless warning.
>>
>>57891014
What if you are handling someone else's code?
>>
>>57891022
Then I follow their convention or I convert it to mine, depending on whether I'm making a contribution or not.
>>
>>57891039
It's better to only have 1 kind of invisible character
>>
>>57891039
>>57891076
Whoops, I mean it's better for there to be only one of each kind of invisible character
>>
>>57891076
What editor can't subtly display whitespace characters?
>>
>>57891098
The point is a tab and spaces look the same, and even worse, it depends on the editor
Imagine there was a double-space character
>>
>>57891120
Sounds like a problem for the people using that shitty editor, not me.
>>
so im a new programmer building a bit torrent client form y first project. i actually made an irc bot so decided bit torrent would be cool.

so far i have -

peer
b'\x13BitTorrent protocol\x00\x00\x00\x00\x00\x10\x00\x05\x94z\xb0\x12\xbd\x1b\xf1\x1fO\x1d)\xf8\xfa\x1e\xabs\xa8_\xe7\x93-DE13D0-XZH554Y7HrfU'

out of a list of 40 peers all of which tells me their ip and port number i can only establish a connection with 1/40. earlier today i got 3/40 but right now this is the only peer i can connect with out of a list of 40 ips? i have no idea what's going on also the list tells me they're all on port 6881?

secondly does anyone know anything about the pieces and how all this works?
>>
>>57891151
3 spaces or 4?
>>
>>57891199
Who the fuck uses 3 spaces
>>
Guys, I have gone through multiple tutorials, involving some of sicp and other tutorials involving python, Java, php, JavaScript, MySql, html, and CSS.

Now how the hell do I actually make something? As soon as I try to do anything I see yen rabbit holes and feel like I need more tutorials. And this is before I even think about fancy libraries, which may as well be written in ancient Greek.
>>
>>57891014

Mixing tabs and spaces only fucks up if you expect that a tab equals a specific amount of spaces. A tab equals a tab character, which has a width that can be variable depending upon who views it, but which is constant throughout the file. The best means with which to indent is smart tabbing, whereby tabs are used for indentation, and spaces are used for alignment. No two lines may be considered aligned by spaces unless they contain an equal amount of tabs, and all tabs in the line are exclusively at the beginning of the line.
>>
>>57891497
Yeah, that's what I meant. Already said tabs/indentation and spaces/alignment was fine.
>>
>>57891458
Just think about what you want to do, separate the problem in small manageable chunks and start somewhere.
>>
File: King Chapter 7.3.jpg (42KB, 675x148px) Image search: [Google]
King Chapter 7.3.jpg
42KB, 675x148px
Are differing character sets still an issue these days? Has anyone encountered a problem remotely similar to pic related?
>>
>>57891610
>Are differing character sets still an issue these days?
In terms of a ASCII range (0-127), not really. EBCDIC exists, but only the most retarded and ancient IBM mainframes uses it. You also have the Japanese still using shit like SHIFT-JIS (which modifies a few ASCII characters).
In terms of the extended ASCII, yes. There are still retarded companies like Microsoft and Oracle who use archaic things like code pages, and things like UTF-16 when doing unicode.
>>
>tabs vs spaces
this isn't 1997
>>
>>57891774
This. Text based languages are gonna die out sooner or later.
>>
>>57891791
i got emojis in my code and these niggas worrying about spaces lmao
>>
>>57891791
You're gonna die out sooner or later, fag.
>>
>>57891791
People have been saying that since forever.
But that's a gross misunderstanding, making pretty visual languages isn't going to make the fundamental complexity magically disappear, in fact it's harder to deal with .
>>
>>57891807
>>57891809
>>57891813

Text based languages can't hope to compete.
Visual languages are infinitely more expressive.
>>
File: internet.jpg (168KB, 1024x768px) Image search: [Google]
internet.jpg
168KB, 1024x768px
>>57891825
4/10 bait
>>
>>57891825
Just because you keep saying it, it doesn't make it any more true.
>>
>>57891825

It is significantly easier to describe a recipe by writing down the list of instructions than it is to draw a picture of each stage.
>>
>>57891984
>creates listbox
>enters each entry without caring about whitespace or escaping
>>
>>57890345
I spent like 4 days trying to figure out what was causing this and it turns out its a bug in SDL. Fuck me.
>>
Is Modern C a good book?
>>
>>57892016

So now you have an object. Try describing what you intend to do with that easily in a visual manner. An object is just a means of encapsulating state, and is nothing without methods.

Now what looks nicer, a flow chart or a list of clean, easily readable lines.
>>
File: a listbox.png (7KB, 363x251px) Image search: [Google]
a listbox.png
7KB, 363x251px
>>57892099
>Ruby in charge of knowing what he's talking about
>>
can osmeone expalin to me how a one class can you use a populated list from another class? i don't understand where these objects are floating around and what's referencing them.

for instance if i had say -

class otherClass(more):
'''how do i get access to the self.anime list in this class?'''


class animeImage(something):
def __init__(self):
self.anime = []

def nextClass(self):
return otherClass(self)


this might seem dumb but im really bad at understanding OOP principals and referencesto objects etc.
>>
>>57892241
>OOP principals and referencesto objects
That's exactly why people start with C.
>>
What is the practical purpose of Java interfaces?
>>
>>57887341
currently implementing a neural network learning algorithm with backpropagation for class.

Also I found out I don't know what happens if you are able to give every neuron a different activation function.

I might put it in and give it a try.
>>
>>57892241
You can't reference an object inside another function like that, you have to either pass it as an argument or declare it outside the function.
>>
>>57892206

What I see is a window.
What I don't see is a program, something that uses that window in a meaningful way.
>>
>>57887422

Enterprise friendly = Pajeet friendly
>>
>>57892431
What are you talking about?
Any GUI that is used for user input, BECAUSE IT'S BETTER THAN TEXT INPUT, could be part of a visual programming language
>>
>>57892282
I'm learning about neural networks now. Seems they're really simple. The hard part is backpropagation and getting the weights right for your desired output.

Do you know how genetic algorithms work? Backpropagation is gradient descent calculus stuff but wouldn't a genetic algorithm just be adjusting the weights randomly over thousands of simulations? Sounds pretty simple.
>>
How do I declare in a C++ header file that a function may return both a variable or a numeral?
ie:
#ifndef DATE_H
#define DATE_H

class Date
{
private:
int m_year;
int m_month;
int m_day;

public:
Date(int year, int month, int day);

void SetDate(int year, int month, int day);

int getYear() { return m_year; }
int getMonth() { return m_month; }
int getDay() { return m_day; }
};

#endif


what if in the implementation .cpp file the getYear() function has, for whatever reason, a for loop with a nested if that returns the control variable if true and a literal -1 if not?
basically what if it can be:
return index //if true or instead
return -1 //if false
>>
>>57892566
ignore the "both"
>>
>>57892566
//returns -1 if error
>>
>>57892566
You don't. You don't implement the method in both the header and translation unit.
>>
>>57892601
so the header shouldn't have any "return" statement in such a case?
>>
>>57892638
It shouldn't have a block for the implementation at all, just a declaration.
>>
>>57892644
alright, thank you
>>
>>57892510

Let me see if we are on the same page here.

You are talking about developing programs using a visual interface, rather than a text based programming language. You are showing an example of some sort of visual input window as an example, and I am failing to see the point you are making with this.

I am raising concerns about the ability to represent program logic (nothing to do with input methods) using a visual programming language.

Most of a program is not the part that the user sees.
>>
>>57892735
dam threads bump at the 301st post? I thought >300 it would no longer bump.a couple years
>>
>>57892758

It was supposed to be at 310. Maybe it was changed?
>>
>>57892777
i dont know but i didn't type that part at the end of my post and i use recaptcha so i don't know what the fuck it was

>>57892758
>a couple years

think i just got a minor ddos attack there
>>
>>57892735
You could represent it the same way or differently.
I assume you use a GUI text editor.
>>
>>57892735
>I am raising concerns about the ability to represent program logic
Visual relationship modeling is faster and less error-prone than writing classes from templates.
>Most of a program is not the part that the user sees.
Users should have visibility into everything that a program is doing to their computer.
>>
UT switching from Scheme to Java instead of Haskell for an intro course I think
>>
>>57887365
UT switching from Scheme to Java instead of Haskell for an intro course I think
>>
NEW THREAD!

>>57892879
>>57892879
>>
>>57892881
dumbass
>>
>>57890756
You're dumping binary that doesn't correspond to a printable character. ^@ is 0x00. If it's every other character, it could be utf16 that's being interpreted as ascii.
Thread posts: 312
Thread images: 27


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