/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

learnprolognow.org/lpnpage.php?pageid=online
twitter.com/NSFWRedditVideo

What did Dijkstra mean by this?

He's an academic and unable to see the worth of practicality.

I think he's trying to tell us to use C#.

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.

>Java is "practical" when Haskell code is shorter, safer, and more efficient

*tips*

That's irrelevant if it's not readable, easy to write, and Entreprise friendly.

>readable, easy to write
It is if you learn it.

>Entreprise friendly
What does this even mean?

haskell is straight up trash

>>Entreprise friendly
>What does this even mean?
shit

Can haskell even extend multiple classes?

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

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

Haskell doesn't have OO classes. It has type classes, which are souped-up interfaces.

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

Vicious circle.

>Vicious circle.
Exactly. It's the same reason with any product. Look at Texas Instruments for example.

>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

People who only know one paradigm, or absolutely hate one paradigm without understanding it, are misguided.

What should I use Prolog for?
Is there some efficient way to learn it?

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

>good luck verifying correctness
>in Haskell

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

you forgot to shit on OOP

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)

But then what she said would be hypocritical.

Promises and delivers, I should say.

>you can't program serious applications like that
What is Erlang?

Object-oriented programming is a successful and useful paradigm, that had been abused for a while.

...

learnprolognow.org/lpnpage.php?pageid=online

that's the joke. smug FP tards often say OOP is shit

also
>she

why didn't they just use Data.Aeson ?

>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?

thou shalt not bear false witness

Because they'll find out you genius when you can't even read or write

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.

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

>giving a shit about some companies arbitrary demands
they brought it on themselves really

what?
obviously its a bad idea if you dont know what the fuck you're doing, meant for hobby programmers mostly

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.

>giving a shit about some companies arbitrary demands
Do you want the job or not?

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.

>i got nothing to lose right?
Self-respect, and the knowledge that you're not a fraud, that you don't belong.

But user, 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.

not me, nice try faggot

>Self-respect
i get what you mean, but unpaid bills are even worse

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)?

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.

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

>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

x86 ASM
Python
C (and later C++)

Quartz is the macOS compositor, what you're thinking of is XQuartz, which is the X11 port.

>a reasonable, functioning Adult.
That sounds retarded, better kill myself then.

trying to find motivation to work on browser #113 some more. it's been like 6 months.

Is this in order? Could you switch C and Python here? since i'm already learning C.

Oh, that makes sense, thanks for clearing that up (I've never really looked into it).

Preferably but not necessarily.

Would this be cool too?
C -> x86 ASM (maybe study assembly alongside C) -> Python

Just remember that you only have yourself to blame.

Capitalism is a shit. I want to live in a meritocracy

Come to Russia.

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.

how are they mutually exclusive?

It's easier to blame "capitalism" and "the system" than to accept the problem is oneself.

...

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),...]

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.

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?

mem::drop(her)

>Implying you have any chance
Try to make a move, but make sure to film it and put it on youtube.

garbage collect her

She makes a valid point.

os.DevNull

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.

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

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?

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.

yes of course, upgrade to windows 10 HAHA

?

My friend has VS on W7. And i bamboozed microsoft by sticking with windows 8.0.

Declaratively, or using a GUI builder.

what do you mean?

Fuck her and allow the GC to free her

BUMPERINO

>GUI builder
But what does GUI builder use?

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

IMGUI

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

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.

python

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

This is because A * != A.

You need to push_back &p and &q, not p and q if you're storing pointers.