/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

stackoverflow.com/questions/4114095/how-to-revert-git-repository-to-a-previous-commit
twitter.com/NSFWRedditVideo

i would F her in the A

C++ has a reason to exist

Who was in the wrong here?

Idris is the future.

How would I pay my third house without C++? Thanks C++!

Java is the C of OOP languages.

>It would be easier to just get a girlfriend than to attempt to program general intelligence.
Reminder that women do not possess general intelligence.

Im learning sql
my brain kinda brainfarts on all these different joins
is 'inner join t1 on t1.a = t2.a' the same as
'where t1.a = t2.a'
also is there a difference which u put before or after the '=' sign?

Please create something that can go through a directory (and its subdirectories), examine the content inside the .zip (a .cbz) and check if the images are .PNG with a .JPG filename and then report back with a log file.

I might pay if it's done quickly and if it works without any issues. Windows btw.

history says Linus

Linus gives Linux away for free, and yet he's still a millionaire.

...

How so?

kys

That would be sepples but

>I might pay if it's done quickly and if it works without any issues.

Java is nothing like sepples.

me no get it
me dum

first for Erlang

is this a meme like internet explorer
is erlang slow

Use a real operating system, not an ad-covered vending machine

>windows
>not an operating system

Explain, in 150 words or less, why is that. (5 marks)

dumb frogposter

An operating system allows you to fully operate your computer. Windows does not allow you to fully operate your computer.

it isn't emacs

Nigger-rigged up a solution on Windows. I just wrote a 3 line script for starting vim that loads uncap.exe when vim starts and kills it when vim exits.

you're thinking of Ocaml.
Erlang is fine.

For something to be considered an operating system, it must be agreeable to me. That is a necessary (but not sufficient) condition in my definition of an operating system. I find Windows disagreeable, therefore Windows it not an operating system.

And Linux does? You can't even run all the software you need to get work done on it!

>An operating system allows you to fully operate your computer
What does "fully operate" even mean, and how do you figure something has to have this property to be an OS?

>You can't even run all the software you need to get work done on it!
I can. Don't blame me for your career decisions.

>is 'inner join t1 on t1.a = t2.a' the same as
'where t1.a = t2.a'
No, they are different. A join is how you're relating two tables or statements together. A where is specifying a condition for what it is that you're selecting

>also is there a difference which u put before or after the '=' sign?
Yes

>to fully operate your computer.
next to no OS's have FULL control of your computer. But i know this was just a joke.

i'm not sure i believe your premises user

>Linux can't run any good software because of my career decisions
Pardon me if I fail to see a cause and consequence relationship there, my friend.

>Epileptics are the only people who can think because they can use 100% of their brain

who is this titty temptress?

>I can
So you're a NEET? Alright.

Josh, you don't seem to know the definition of operating system (see me after class).
1 mark

0 marks

You accept the terms and conditions when you install windows, Brad, so that's not a valid answer.
2 marks

>is erlang slow

It's an interpreted language, so it's not going to get you C-like performance for number crunching. Of course, you can interop with C just fine with virtually no overhead when you need to while still getting Erlang benefits everywhere else.

But yes, it is a meme for the most part. At least, I can guarantee you that nobody posting here has a project that would in any way benefit from Erlang's strengths.

I was responding to
>You can't even run all the software you need to get work done on it!

>filename

You would be limited to very few career choices if "can I get this work done using only the software available to Linux?" were a criterion, user.

Yes, it's shit.

An operating system is a method of, via the means of a human-computer interface, such as a keyboard, aiding the user in making the system operate as they wish.

Windows IS an OS product line. Windows 10/DOS is an OS.

Excuse me?

What about claims that its highly concurrent and if done right is way faster than for example java for certain applications (server)?
is it meme because its functional and people just dont bother to learn it, or because it just not very capable?

I've started making Windows builds of my software have worse user experiences than builds for GNU/Linux and Mac. Things like longer loading screens and occasionally ignoring clicks. It gradually gets worse and later includes error messages suggesting the user's operating system is unsupported, sometimes making the user agree to try to change to a supported operating system (listing Ubuntu and OSX as examples) at some point in the future before being able to close the (modal) error message.

If it does not eventually partition the HDD and automatically install Ubuntu on it, you're doing it wrong.

Tannenbaum. 30 years later and still an irrelevant sore loser.

read this sentence.

thank you.

>ubuntu
every time

>creator of the most used operating system in the world
>irrelevant
Whatever you say, lincuck...

He's right, you know

>most used operating system in the world
[citation needed]

it's in every intel management engine
not a proud legacy, it seems to me

>want to reset commit bc I forgot to create a .gitignore
>type git revert HEAD, bc that's what I remembered
>deleted everything
it's not like the code wasn't massively spaghettifying by this point but still, fml

I don't use bitcoin what can you pay me with

why don't you revert the revert?

steam, gift cards, idk

> import apt package from python
> read the manual
> do your shit in 10 lines of code

ME12 is the first ME based on Minix and x86
previous versions used a ThreadX microkernel
so no, it's not the most popular operating system in the world

>C++/WinRT is pure header files
Gives me hope that Rust bindings shouldn't be too bad.

It's a meme because you can serve 10,000 concurrent users on a single thread in C using OMQ and nobody posting here is even close to needing that level of concurrency. If you're actually bumping into issues then you start looking for solutions, otherwise it's a case of YAGNI and you can much more easily implement whatever you're working on in a more mainstream language with more resources, more libraries, and better tooling.

"Faster" is kind of a meaningless term without a very specific scenario that can be benchmarked. Erlang doesn't do anything performance-wise, even concurrently, that can't be achieved in any other language - it just offers that functionality out-of-the-box in a VM that's been proven with decades of usage in critical systems.

i'm not the one who claimed it. i think he can be right if he throws in a ton of qualifiers

meh, the whole thing was becoming overly complex and intertwined and only a few hours of work was put into it

let me anticipate, though: i should have said "new ime"

>could either enter one line into his terminal, or give up and complain on Sup Forums
>would rather give up and complain on Sup Forums

whatsapp uses it and they've been able to keep their team small; discord uses elixir, which runs on the erlang vm. i'm sure they have some blogs touting this

i can't do it now because i have an exam coming up. Do you know python?

there are lots of programmer-for-hire sites

nope

well i meant does it give the same result and the answer is yes found it out myself

hi there,
why not use powershell ?

how would powershell go through .cbz files and for PNG images with a JPG filename?

nope, i'm too stupid for that

Just call the right functions. It can access anything .NET so inspecting ZIP files and checking the first 16 bytes of every member whose extension is jpg doesn't seem out of reach imho.

Not really, but would it be an optimal choice? Remember that people spend billions writing special programs, macros and styles that only work for MS Office.

In a better world we'd all be using textual formats whenever they made sense, and shit like HTML-email would be executable offenses.

But we don't live in a better world, so while you're right, you're just making the pain more acute bro.

In ubuntu,
When I use cd /Documents/
It doesn't go to Documents?!?
But in Lubuntu it does. Weird as hell.

fuck off
not programming

This is actually not that hard, just use find to find all the zip files, then unzip them to /tmp, use find again to find all the .JPG files and then use file to see what type it is.

> Windows
Oh. Okay. Sorry buddy, it's a bit more involved then. Windows don't really have the tools for quickly hacking together this sort of thing.

Might be something in .Net you can use though, so some PowerShell wizards could probably knock something out.

...

unzipping millions of .zip files that exceeds 2TB will take a lot of time

cd ~/Documents
is not the same thing as
cd Documents
which is not the same thing as
cd /Documents
those do different things.

What you likely want is to go to your documents folder. It's probably in ~/Documents, but it might be ~/documents. Remember that most Linux filesystems are case sensitive. (Just like NTFS, but Windows is very good at not lettign you know that.)

But it's likely faster than looking up the manpage for gunzip and see how to do it without the unzip, testing and then shipping that.

Implementation time + execution time is what we're aiming for here, since it's a one-off job.

If I were to do it in Emacs, I'd use Emacs's built-ins for this, and it would be faster, but we're not doing that, so I'm sticking with what I know how to do in order to get the thing done with less faffing. Version 2 would be a good time to do the smart thing.

Is git actually worth learning how to use?

Python 3 code from last thread

# free as in free beer cuz' I'm bored.
# untested

root = pathlib.Path('/home/faggot/my_gayporn_folder')

PNG_HEADER = bytes.from_hex('8950 4e47 0d0a 1a0a 0000 000d 4948 4452')

def find_zips(subdir=root):
for f in subdir.iterdir():
if f.is_dir():
yield from find_zips(f)
else if f.suffix == 'zip':
yield f

for z in find_zips():
with zipfile.ZipFile(z) as zf:
for member in zf.namelist():
if member[-4:] == '.jpg':
with zf.open(member) as member:
if member.read(16) == PNG_HEADER:
print('{} is actually a PNG'.format(member))

Yes, all of your software should be version controlled. Also, to get a job you need a basic understanding.

Gee, I wasn't expecting a reply. I asked the question earlier and got torn apart. Rightly so aswell.

It was my misunderstanding of the filesystem tree as well. Thanks anyway.

Should of actually posted it in the Linux threads as well. My bad.

would sorta work actually. But for this kind of job, won't fork as much I believe.

is it easy to understand the design patterns book from the gang of four if you know only c#?

yes

Don't really have anything to compare to, but is sub 1ms per frame for this on a Snapdragon 820 alright?

~1ms for my whole library, rendering and update

no ideia, but I can say I've played tetris at 2000fps using sfml.net in my laptop

import sys, glob, zipfile
for comic in glob.iglob(sys.argv[1] + "\\**\\*.cbz", recursive=True):
zip = zipfile.ZipFile(comic, "r")
for image in zip.namelist():
if image.lower().endswith(".jpg"):
with zip.open(image) as jpg:
if jpg.read(8) == b"\x89PNG\r\n\x1a\n":
print(comic, image)


Probably doesn't work. Requires folder as command-line argument.

What is man supposed to use when here's just no good statically typed and compiled language?
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also not even statically typed
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters, also uglier than sepples
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros
>haskell
generates garbage 1GB/s
>chapel
cannot use libraries that was compiled with it...
>ats
Jesus Christ
fun{
a:t@ype
} list_length
{n:nat} ..

>1GB/s
nothing wrong with this

If you already did the commit, then revert back to that commit. np. Do git log .. etc etc


stackoverflow.com/questions/4114095/how-to-revert-git-repository-to-a-previous-commit