/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: sicp gabu.jpg (1152x720, 83K)

Other urls found in this thread:

gmplib.org/manual/Contributors.html
twitter.com/AnonBabble

post yer code

Attached: __.png (484x984, 60K)

c++ is disgusting. would rather write java than that shit

Attached: C.jpg (1920x1080, 393K)

That is rust, but it did take inspiration from the worst syntax out there.

Haskell

I'm rewriting the Linux Kernel in SBCL, ask me anything.

Why don't you know Ocaml, user? It's only the best programming language in existence.

Attached: 5249050.png (400x400, 159K)

oh thank god, I was just thinking c++ looks a lot fucking worse than I remember

WPF based Kiosk app for a gaming convention. CEF (Chromium Embedded Framework) is kinda slick.

public PlayerScheduleController(ApiBadge badge, Dispatcher dispatcher = null)
{
if (System.Diagnostics.Debugger.IsAttached && !Cef.IsInitialized)
{
Cef.Initialize(new CefSettings() { RemoteDebuggingPort = 8088 });
}

_dispatcher = dispatcher;

CefSharpSettings.WcfEnabled = true;
_badge = badge;
_viewModel = new ViewModels.ChromeBrowserPageViewModel
{
PageBody = GetSchedulePage(),
ScriptProxy = new SchedulePageScriptingProxy()
};
_viewModel.ScriptProxy.AddTicketForTimeslotEvent += AddTicketForTimeslot;
_viewModel.ScriptProxy.ReleaseTicketEvent += ReleaseTicket;

_page = new Views.ChromeBrowserPage { DataContext = _viewModel };
_page.ChromiumIsInitialized += (sender, e) =>
{
_page.Chromium.LoadHtml(_viewModel.PageBody, System.Configuration.ConfigurationManager.AppSettings["leona:kiosk:baseuri"]);
_page.Chromium.JavascriptObjectRepository.Register("kiosk", _viewModel.ScriptProxy, false, null);
_page.Chromium.JavascriptObjectRepository.ResolveObject += (a, b) =>
{
var repo = b.ObjectRepository;
if (b.ObjectName.Equals("kiosk"))
{
repo.Register("kiosk", _viewModel.ScriptProxy, false, null);
}
};
};
}

C++'s syntax is equally as horrible.

Which ones should I get for Christmas?

Attached: 15026422252132.png (1140x813, 292K)

JavaScript rocks!

Attached: js-rocks.png (1000x494, 286K)

>ViewModels.ChromeBrowserPageViewModel
>System.Diagnostics.Debugger.IsAttached

I'm really not surprised modern browsers are ass.

>obvious C++ shill trying to poison the well by pretending to be anti-C++ in blatantly retarded ways
Sad.

Buy a noose, instead.

Attached: 1379244503469.png (716x586, 657K)

Is this Java? I can't even tell

anyone has link to a good arbitrary precision library for this one
struct Customer
{
string Name;
long long GenderID; //TODO: Find a fix for values larger than 2^64
}

Looks like C# to me.

>trying to poison the C++ well
it'd just be shitting in a toxic waste dump at that point. No one actually thinks highly of C++ except for its stockholm victims.

>The GNU MP Bignum Library

you!

Attached: luarocks.jpg (573x892, 113K)

C#. Part of a controller for a page/view in a Windows Presentation Foundation based desktop application.

is this for a job or something?

why not use raw HTML/CSS/JS?

We need that sizeof webm

use microsoft method
uint64_t GenderIDhi;
uint64_t GenderIDlo;

Thanks, will check it out. Can I easily allocate the bigint in heap instead of stack?(c++ limits to 8MB)

Hey Soulja Boy, crank it somewhere else.

That's what any OOP language looks like when you let Enterprise hell take over.

no idea
>gmplib.org/manual/Contributors.html
>Marc Glisse improved gmpxx.h: use fewer temporaries (faster), specializations of numeric_limits and common_type, C++11 features (move constructors, explicit bool conversion, UDL), make the conversion from mpq_class to mpz_class explicit, optimize operations where one argument is a small compile-time constant, replace some heap allocations by stack allocations.

I buy it.
But I'm not sure if it's a C++ shill or fp shill posing as a C programmer to discredit them from the root.

Then again maybe this is paranoid thinking.

Soulja Boy tell em

gmp does allocate its memory on the heap.

typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);

>the absolute state of procedural programming

>non free

>use fewer temporaries
Maybe if you copy a bunch and don't use pod (as you should). Which is common in sepples (their obsession is warranted due to the complexity they hang on simple scope entries and exits and everything in between).
>replace heap by stack
Wise man.

imagine asking /dpt/ for C# help on the job lmao

Method of using high and low integers is free

Don't blame Khronos' silly naming conventions on an entire programming paradigm.

P pointer
FN function
I don't know what is so hard to understand

Lisp is the most powerful programming language.

Can you stop posting your spaghetti?

LISP Is Super Powerful

It needs to be able to interact with a barcode scanner and thermal printer installed on the kiosk. People walk up to it, scan their convention badge to log in. At which point they browse the live schedule, get tickets for games/events, etc, then print out their tickets right at the kiosk.

The app basically pulls the pages off the convention website and wires them up to be able to interact with the local hardware. It might be possible to get them wired up to do all of that all through a browser, but I'm more of a back-end guy, and I had 3 weeks to get this off the ground last year.

>PlayerScheduleController
Looks like a class name
Also, use using directives and aliases if you keep running into long names and seperate browser initialization/settings from the main logic.
What an autistic question

>What an autistic question
No it is not.

i'm a fucking noob that's gonna drop out soon but at least i tried

Attached: Untitled.png (296x275, 6K)

>sometimes he barks but it's because he is autistic

>I don't know what is so hard to understand
The NGSLENGCSPERGTARDIMAGINARYFRIENDS part.

scheme@(guile-user)> (run)
((width . 400) (height . 480) (key_frame . #t) (pts . 0))
((width . 400) (height . 480) (key_frame . #f) (pts . 6))
((width . 400) (height . 480) (key_frame . #f) (pts . 12))
((width . 400) (height . 480) (key_frame . #f) (pts . 18))

Getting closer, lav is a pain in the ass to use and wrap around.

Attached: snake.gif (400x480, 443K)

>GTARD
>Jow Forums tard

>all procedural languages have the same naming conventions

Attached: 1511614480230.png (645x729, 41K)

Guys, i get 'TypeError: an integer is required (got type range)' in python when i try to use range in the 'year' for the 'yeardayscalendar(year,width):' for the instance of the calendar module. How do i iterate through a range there when an integer is required? Im really in programming so sorry if this is a brainlet question

what are some good books on vulkan for someone with no experience in graphics programming?

really new*

If I want to get a basic CRUD webapp up quick using JavaScript, which Node framework should I use?
Maintainability/performance aren't important in this case

post code.

...

use PHP

>AddTicketForTimeslotEvent
>ReleaseTicketEvent
>AddTicketForTimeslot
>ChromiumIsInitialized
>SchedulePageScriptingProxy
fucking fired. Learn to naming conventions fffs

year = range(1901,2001)
for i in s.yeardayscalendar(year,1):

>implying C isn't the quintessential and only relevant procedural language

seola though...

Hey, I know OCaml. It's my work to write OCaml code.

And how is a single library using a naming scheme like that supposed to reflect on an entire language and paradigm?

That kind of thing would never happen in an OOP language.

I see why you feel this way. That's too many pointers.

use a for loop

OOP has literally nothing to do with this. It's a fucking function pointer that you need to load at runtime. Any statically typed language needs to call their types something.

Yeah, naming is a bit of a clusterfuck through the whole thing. Decisions went back and forth about whether to use 'Event' in names or not, because that is what the related entities are referred to IRL, but not wanting to use Event since it has meaning in the language, etc. That and it basically being a horribly rushed clusterfuck all together. But it worked well enough when the convention rolled around, and it worked pretty well by the end of the convention with me pounding patches straight into the live system as problems popped up.

>only procedural languages produce such horrors
>it's just a coincidence, though; i swear

True. You'd have much worse cases in oop. And this case would just be some class you're given from an abstract factory with arbitrarily complex initialization despite the fact that you probably only use this in one place in your code.

And I'd probably prefer that actually.

>And I'd probably prefer that actually.
One AbstractFactoryBean has been deposited to your account.

public class ANONISAFUCKINGIDIOTWHODOESNTKNOWHOWTYPESWORKANDPEOPLECANNAMETHINGSWHATEVERTHEYWANT {
}
Oh my god, OOP is such a disgrace! Only it's capable of producing something like this.

Installing ArchLinux on a desktop i made from extra parts, uwewu

Literally never happens. It's a symptom of procedural brainletism.

>Literally never happens
It does though. Here is a completely valid example right here:

...

Infinite loop detected. Aborting.

>Here is a completely valid example right here
That's just what happens when procedural brainlets try to use a real programming paradigm.

Reminder that Haskell's celebrated type system actually corresponds to an inconsistent logic.

Prove it.

In x86_64 assembly, does the div instruction always use the d register? The book I'm using implies it's only for word operations, but I just attempted a dword division with some junk in the d register and it screwed it up. If so, do I always need to empty the d register before doing division if I don't want to use its contents?

If it were mathematically inconsistent then it wouldn't be compile-able. Perhaps what you mean is that their type system is aesthetically ambiguous and does not work exactly as-documented. Assuming you can back that claim up, anyway.

Why do you call C a procedural programming language?

Like, don't all languages just read from top to bottom procedurally?

>inb4 someone posts a language that reads upside down

Attached: blue_screen_of_death.png (320x240, 75K)

>Prove it.
Want me to prove it using Haskell's type system?

>he doesn't know about Curry-Howard isomorphism

>*sent to India as charity*
Much shame.

>If it were mathematically inconsistent then it wouldn't be compile-able.
What kind of brainletism is this? You're an embarrassment to functional programmers.

functional
fac :: Integer -> Integer

fac 0 = 1
fac n | n > 0 = n * fac (n-1)

Because the fundamental unit of code is a procedure, rather than e.g. a function or a method.

>makes a statement
>can't support his arguments

kys

>being a typical hasklette
>joke naturally goes over her head

wikipedia.org/wiki/Procedural_programming
You may notice that they point to structured programming as the basis.
And the 'top to bottom' bit isn't true because of control flow. How you've decided to view your code isn't something that paradigms specify.

You really don't seem to understand that point that you're literally arguing about naming conventions, which has literally nothing to do with paradigms. No sane language forces how you need to name your identifiers on you. It happens that Khronos happened to pick a particularly ugly one, but it is consistent at least.

To be less contrived, are you going to argue that
class EGL {
public static Object getProcAddress(String name) {
// ...
}
}

interface glGetPerfCounterInfoINTELInterface {
public void glGetPerfCounterInfoINTEL(/* A fuckton of arguments */) {
// ...
}
}

class myOwnShit {
public static void main(String[] args) {
glGetPerfCounterInfoINTELInterface perfCounter = (glGetPerfCounterInfoINTELInterface)EGL.getProcAddress("glGetPerfCounterInfoINTEL");
}
}
is somehow better?

>i was j-just pretending t-to be retarded

Refrain from posting.

I thought it was unsound because of seq, not inconsistent per se.

Then how do you explain that it only happens in procedural languages? It proves quite clearly that the language is at fault. If you don't understand simple stuff like that, no wonder you can't understand C++.

>she still doesn't get the joke
>she thinks the joke was the original statement
This is just embarrassing.

No, I don't. Why would you think I would? But I know what an isomorphism is. And it doesn't mean "inconsistency." To the contrary it means that one thing has essentially the same structure of the other thing. Looking up a quick glance on wiki describing, CH, my best guess is that you're trying to say that Haskell's type system is "inconsistent" because you can use it to construct a type which is isomorphic to a proof of any arbitrary thing you wanted to prove, including something contradicting something else you constructed that way. But what you seem to fail to grasp is that these two proofs to not exist under the same mathematics, they both exist under subsets of Haskel's type system, and aren't proved w.r.t. the entire set.