/dpt/ — Daily Programming Thread

Previous Thread: >What are you working on, Jow Forums?

Attached: DPG.png (934x1000, 389K)

Other urls found in this thread:

imgur.com/a/jQUav
en.wikipedia.org/wiki/Julian_Assange#Hacking
sourceware.org/glibc/wiki/Release/2.28
twitter.com/NSFWRedditImage

What could a boxplot like this show me?
Every box is a feature of the dataset.
What other sort of plot could be useful for me?

Jesus what a mess of data.

Attached: Selection_008.png (1552x856, 51K)

ur mom lol XD

is gnuc an acceptable untyped lambda calculus?

Does anyone know if there's anywhere i could possibly find a
listing of movie/release dates similar to IMDB's calendar (https:// www. imdb. com/calendar)?

I'm working on writing a script that exports those into an icalendar file regularly,
so it can be imported to say, Google Calendar and similar but i wanted to avoid having to resort
to scrapping that specific imdb page since it's agaisnt their ToS (Not that i think it would matter to them at all thought)

Even a listing containing already released movies for a given year would work, as long as it had outside of the US dates aswell,
but i've been having no luck messing with OMDB and other similar stuff, these pretty much are only usefull for fetching movie metadata.

>Issue: C - array pointer linker

For some reason, I am having a SIGSEGV issue with array pointers.

I use a globally defined struct array object_t GAME_OBJ[512];. Functions have the parameter object_t *obj but that is simply &GAME_OBJ[i] passed onto it in some way. For now it has worked, but somewhere in my way to remove an object, my game crashes.

Within object_t is a link to the previous object_t, and a link to the next object_t. When an object is made, it'll use the freespot available in the array, and set the links. When an object is removed, it should set the previous objects next link to the current object next link, and it should set the next objects previous link to the current objects previous link; then, it should tell the program that it is the freespot.

Somewhere in the removal function it's causing a problem.
bool first = false;

if ( object == frstobj )
{
frstobj = (object_t*)obj->nxt;
first = true;
}

if ( obj == lastobj )
lastobj = (object_t*)obj->prv;
else
obj->nxt->prv = obj->prv;

if ( !first )
{
obj->prv->nxt = obj->nxt;
}

obj->prv = freespt;
freespt = obj;
But I am not sure where.

I think I may need to redo the entire struct system. I found this thing a long time ago on something called the backaward linked list (something like that) and I thought it would work.

That depends highly on the question you want to answer. The boxplot just reduces your daily subset into a simpler form, but without knowing what this is all about, you learn nothing.

Looks like you have a bit of a spike on day 13, but the significance of that might be questionable.

What's the question you wanna answer?

Can a language with Idris/Haskell-like type system have a quick compiler? Or they have unavoidable bad compilation time asymptotics due to the complexity of such type systems?

Attached: c5c4828d079da5a327be766c9108f3b6.jpg (1060x801, 74K)

Does anyone here know how to add a .py module to Python in Visual Studio Community 2017 or even IDLE?

Is there a better alternative to Visual Studio? How is it better?

Thank you.

Attached: 1531216572745.jpg (480x360, 13K)

what is the closest language to python that is actually fast? it's slow as hell i've heard but very useful in many situations so what would be the faster version of it?

Attached: 9d0.png (344x326, 31K)

what is the erlang programming language and what are its uses? and what is haskell with its uses?

lua is nice

What's the use case? For scientific programming, Julia looks like a viable option. Not quite as mature yet, but slowly getting there.

I don't know about webshit.

There's no such thing as "actually fast" without dropping down to C.

There is.
[spoiler]Dropping down to Pascal. C grammar sucks.[/spoiler]

So if i understood correctly your code does this:

#1
if first then first = next (Drops first from list)
#2
if last then last = previous (drops last from list)
else next.previous = previous (drops any in the list not on the edges and count > 2 )
#3
if not first then previous.next = next (restore next link to changed object in #2)
#4
Flag previous as a free spot

the code looks correct so far, the only stuff i can point out is that you're using "object" instead of "obj" in #1, if that's the actual code, and maybe you're forgetting to unflag the removed object as no longer being the first?

C is inherently faster than Pascal for all intensive computational purposes.

#4 (correction)
link previous to freespot
replace object with freespot

to be completely honest. i'm talking about a variety of uses from scientific programming to hacking(no meme) so a general language very similar to python but faster and my priorities are definitely learning hacking and scientific programming.

In short, no because CPUs are designed in a procedural manner rather than functional, so every operation has to be translated to a procedural design.

Ruby or Perl if you want to keep simplicity, Scheme is a good and fast algorithmic language, using Racket instead might help you get around its quirks, but C++ is necessary you want to design a fast, complex system

Anyone? How to add a .py module to IDLE?

use unix

Question:

Why is Go so much more popular than Dart? This seriously confuses me.

What is unix? I only started learning programming 2 days ago.

Wait-wait-wait, a "quick compiler" and a "compiler that produces quick code" are completely different things.
Pic related. (Visit imgur.com/a/jQUav if you want more info)

Attached: qfli0f7.png (1209x680, 40K)

>> Has any useful libraries for scientific programming
>>fast

At this point, your options are Fortran, Sepples, and Julia.

>> Similar to Python
Julia.

Dart has inheritance and if you care enough to change languages you're fucking done with that shit

thanks, i'll go with fortran then. can you tell me what the best languages are for hacking?

Look at who promoted Go vs. who promoted Dart.
Think of Go. Does that remind you of any big names? What about Dart... yeah.
And since the begining Dart was being promoted as a replacement for JavaScript. People don't want to replace JavaScript (fuck me many people do), just look at how popular it is.
But Go... people have been wanting a systems language to replace C and others for a long time, so it was easy for Go to grow in that niche since it was empty

Yes () I was talking about a quick compiler. To produce quick code, the functional architecture in the Haskell code has to be converted to an efficient procedural architecture for the x86 bytecode in runtime, this is why Haskell is slow to compile, because every step might have to be translated differently to assembly according to context. You can't just use a regular pattern like C's for loops.

thanks, i'll go with fortran then. can you tell me what the best languages for hacking are?

You haven't forgotten to lift today, have you, user?

Attached: dyel.png (397x640, 177K)

Why fortran? C++, R and Python are defacto scientific programming languages in 2018. Learn one of them if you don't want it to be useless.

The best languages for hacking are C and Perl because of the freedom they give you in manipulating the data because of their weak type system and procedural design, along with their easy access to raw syscalls. Perl has a bit more abstraction on top though.

Go and Dart are both promoted by Google and have many of the same people behind them.

What's the definition of hacking here?
For hacking I would say Python since it's quick to prototype things in, as in "hack things together real quick".

It's a football dataset with yards, punts, etc.

Trying to predict the winner.

>C++
Stopped reading right there. The fuck outta here with your meme languages

Perl is entirely designed around this principle, but my definition of hacking is more about freedom to manipulate data and to interact with the operating system.

This is why perl is described as the perfect hacking language, you glue together many small modules using basic but powerful language tools to make it do what you want quickly and painlessly.

someone answer plox

Is it C++? No? It's shit then. Learn C++ and stop wasting time

I see.
You're correct on both counts.

Then say quick prototyping.

Julia is definitely your best bet here, if you want speed, quick prototyping, and scientific programming. If you're fine with two out of three of these, there's lots of options.

I did this for a laugh

Attached: 2018-07-10-194514_394x480_scrot.png (394x480, 6K)

>open a new tab in browser
>type something in url bar
>made a mistake, instinctively hit Ctrl+W to erase the last word
>tab closes

LORD, give me PATIENCE with this SHIT technolgy

I chose FORTRAN because I've heard a lot about it but the others that were mentioned, namely lua, Sepples and Julia I've literally never heard of and I don't want to learn obscure languages.

I just want to hack systems and do some scientific programming. What would be the best language for hacking other systems? Sort of like how Hillary's emails were hacked.

>people want better C
Literally just C with better standard library, like define the fucking API for threading and add compiler flag for platforms that supports it. Now do the same for utf8, directories and file paths, basic data structures.
Maybe smarter compiler like, recursive macros and maybe some kind of modules instead of headers.
Saner types without the _t ending so every faggot doesn't have to rename uint32_t to u32.
>Solutions proposed
GC
Uglier syntax than ATS
Name mangling
nonstandard ABI
Anything but what people want from C

>I just want to hack systems
C.

>tfw you get a comfy code refactoring day
Is there any better feel, lads?

Attached: images.jpg (259x194, 8K)

Being at home with your loved ones.

>trying to build ogre3d v2-1
>following the """official""" guide
>keeps complaining about missing library files
>have to modify cmake files and/or copy library files across folders
so this is the power of FOSS...

>you get a comfy procrastinating-while-looking-busy day
FTFY
Making something new is better. Throwing something away completely is even better.

>using library that uses cmake
your own fault. Cmake is shit and anybody relying on it should be shot, so most sepples "programmers".

I have to teach my small dinosaur dev team full of people who have almost no background in actual development or computer science how to use git, and I'm actually going to kill myself.

I know only inflicting your code upon others if it compiles first is a foreign concept, but goddamn.

>try to write a """simple""" powershell script to change default audio device, to switch from my headphones to speakers without the gui
>turns out its borderline fucking impossible and I had to reverse engineer how wangblows stores the default device

>Sepples I've literally never heard of
kekels
It's codename for C++

Attached: 948238472384723.png (454x699, 434K)

No, seriously. Where can I learn to hack emails or other things just like what happened to Killary?

Shut up, retard. You aren't being funny at all.

In case you're not baiting (you are), it was a case of "boomer fuck gets tricked by literally a Romanian taxi driver"

C. Learn the Python API so you can move the slower parts to C while using Python for everything else.

Are .jar files the standard way a java application is ran?

.class files are java bytecode. Jar files are zip files with .class files and some metadata.
Jar files are usually distributed but technically you could only distribute .class files.

There's native Java nowadays.

So in a way more or less, because of convenience, .jar files are the standard way to run a java application.

BUMP

For users yes. In development phase you won't build the .jar file but just run the .class files I think at least, but that's for the IDE to handle.

>using an IDE for python
very epic

That stuff is just social engineering or phishing sites which boomers fall for.

I'm trying to write some self-modifying code. It seems that executing something the first time after it has been modified is very slow, several hundred ns. I guess it probably has to reload from memory, but why should that invalidate the cache of the CPU which is modifying it? Maybe it is something else.

Who the fuck still uses java applets in the year 2018 when IE is the only major browser that still supports them?

What else do I use then?

>.class files.
Aren't .class files compiled .java files with .java files being the actual source code?

>en.wikipedia.org/wiki/Julian_Assange#Hacking
What about this? How would one go about hacking the NSA and the Pentagon? Is Julian the King of hackers?

A .java source gets compiled to java bytecode in the extension .class which is interpreteted at runtime and possibly JIT-compiled at runtime if considered to be a "hot spot".

>glibc doesn't support c11 threading API
>musl supports it but
>tcc doesn't support c11 atomics
so you can't use c11 threading if you want to use tcc with glibc.
Fuck tcc for lack of support.

Literally no one can answer this. Julian confirmed for the greatest hacker of all time, hacked the motherfucking NSA and the Pentagon. I only wish someone here could guide to to his path.

>>glibc doesn't support c11 threading API
It's actually planned for the next release: sourceware.org/glibc/wiki/Release/2.28
The patch set has existed for a while.

PyCharm is a pretty good IDE and probably better than VS. PyDev is pretty nice too.

If you're talking about importing, then "pip install setup.py" in a module directory usually does it. If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.

Just use inline assembly

yeah well tcc still doesn't support atomics so you might as well just start using gcc extensions because gcc/clang are only compilers that support c11. Clang supports almost all of gcc extensions.

>Java is so needlessly complex you're actually recommended and encouraged to learn an IDE before you program in the language.

Attached: 1507006217937.jpg (451x512, 31K)

I'm going to go out on a limb and say that the bottleneck is your algorithm
But lua and julia are nice, too bad both have 1 based indeces

You can use simple editor and makefiles for java if you want to.
It's just that people writing the guides suggest you to use IDE.

I want to set up VS Code to run with a MinGW compiler whose path may change
e.g. it could go from F:/MinGW to E:/MinGW
How would I do this in VS Code's intellisense thing so that I don't have to change it all the time?

What?
>If you're talking about importing, then "pip install setup.py" in a module directory usually does it. If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.
Yes I want to import it but how to do it? What is pip install and which directory should I put the file in?
>If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.
Where is this directory in VS Studio 2017? I found one folder which says that you can put the modules there but the module still doesn't work in the Studio itself.

How are PYcharm and PYdev better than VS 2017?

Perhaps get used to launching it through a .bat file that does the check and copy over the appropriate config

I wish Google had gone full evil and included an open-source Dart VM in Chrome.

It would have caused an ungodly schism between Javascript and Dart in the web ecosystem, but at least we wouldn't have to deal with the current Javascript hegemony where it is creeping into every fucking thing including desktop apps.

>principles of model checking
>principles of cps
You sound like a guy from one of my unis research group

I doubt you can, hows the program supposed to know where it is? Unless the MinGW dir is in the PATH envvar

How would I go about doing that?
No experience with making .bat files.

D-Dave?

>No experience with making .bat files.
.BAT files are extremely simple and you can get the gist in 5 minutes assuming you're not doing anything extremely complex. Just search in your favorite search engine a tutorial about it.

>a*glo
Then probably not

Y-Yuri?

just solved an online programming screen for a job application. the task was to see if a number N could be found by subtracting and adding the elements of an array.
Example: N = 2, array = [1,2,3,4]
Yes, 1+2+3-4

Before I post my solution I would like to see how you would solve it

Hello, /dpt/. I have a very simple question to ask you.

I have started to try learning a programming language and chosen C++ for reasons. My only problem is that the book most recommended for learning C++ as an absolute beginner is The C++ Programming Language by Bjarne Stroustrup the designer of the C++ language. Though the thing with this book is that it DOES presume that you have some background knowledge in programming even though it says it doesn't. For example it talks about compilers and several other things in the very start of the book without mentioning what they are that I don't understand.

So is there a book that can teach me the very basics of CS so I can start with this book already?

You coudl start out by trying all the combinations.

I think you mistook the c++ programming language for his other book (programming principles and practice using c++ or something like that). The former is not for c++ or programming beginners, the latter is for beginners of programming of any kind

Sounds like a fairly complex problem actually, from a mathematics point of view. Sure, you can just brute-force the fuck out of it, but I'm not sure if that's the point..

What's that new hip language used to make desktop applications that isn't javascript, but very similar to it? No, it's not java I'm trying to think of.

that's what I tried at first but my solution uses O(n) time complexity