[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: 319
Thread images: 19

File: dilemma-hacker.jpg (63KB, 735x384px) Image search: [Google]
dilemma-hacker.jpg
63KB, 735x384px
What are you working on, /g/?

Old thread: >>58315601
>>
>>58320789
first for java
also, /fpt/ can suck my flaccid dick
>>
Himegoto is shit
Maki is slut
OP is retard
>>
>>58320789
Thank you for using an anime image.
>>
File: 11.png (5KB, 535x1395px) Image search: [Google]
11.png
5KB, 535x1395px
Tell me about the worst bug you had to solve
>>
>>58320789
Thank you for using a racially diverse image, dpt needs to be more tolerant of other races/nationalities/religions.
>>
>>58320913
Fizzbuzz didn't compile because i didn't have a semicolon
>>
>>58320913
cockroaches
>>
>>58320789
Is she texting in excel? Where is this from?
>>
>>58320942
>Is she texting in excel?
You don't?
>>
>>58320937

the term computer bug actually came to be from a moth, not cockroach
>>
>>58320913
I have shit memory so I only remember one of the most recent when writing my terminal emulator.

For some reason page up/down wasn't working when using `perf report`, but every other TUI had page up/down working, so I had to build perf with debug symbols and start debugging it to debug my own terminal.

I found out perf uses slang, which is really ugly, first suspicion was it was using hardcoded key codes from rxvt, since those were in the source code.

After a while of studying the slang source code I found the function that perf was using for key press handling, and instead of giving a page up/down key it was giving out C1/C2.

Turns out I had a capability in my terminfo for C1/C2 that was exactly the same as the page up/down, and slang was giving precedence to the meaningless C1/C2.

So the bug wasn't related to either my terminal emulator or perf or slang, it was the terminfo I wrote based on the ones from st/xterm/rxvt.

For the record, st still has this bug.
>>
>>58320954
I use word for that
Excel is for emails
>>
>>58321002
>Excel is for emails
Outlook is for emails
>>
>>58320789
Working on my Arduino project

How do I fetch the PC's date and time and store it in an Arduino sketch without using an RTC?
>>
>>58321030
Ur mom is 4 mah deek

ecksdee
>>
>>58321030
No, Outlook is for programming.
>>
>>58321071
damn! sick reply /b/ro
>>
>>58321095
>implying I don't send emails to a mailbox on our domain that gets parsed constantly for new emails, so that it can send the code to a compiler and subsequently be run on our server
>>
>>58320919
>racially diverse image
That is in itself a racist expression. I'll never understand how SJWs can say this without feeling the hypocrisy.

>>58320913
A segfault inside a function call from an open source C++ library itself compiled with the closed source version of a previously open source middleware. This is inside a business environment, so I have no hold on this licensing and dependency hell. Had to rely on the middleware editor support to solve the segfault without knowing what the hell was going on.
Fuck proprietary software and fuck software jew houses.

PS: "jew house" here has to be read as british company bought recently by taiwaneses. Thanks globalization.
>>
>>58320913
Here's one from recent memory: in my Cython code I had an expression of the form 1 << (some number less than 64) and assigning the output to a uint64_t. Turns out the 1 was treated as an int, so the expression would overflow. Took a while to track that down.
>>
Who ASMR here?
>>
>>58321753
What does that have to do with programming?
>>
Text editor poll continues
http://www.strawpoll.me/12023125
>>
>>58321846
>>58321837
>>
>>58320913
Numerous out-of-order initialization errors in C++ that didn't manifest during development but caused subtle memory corruption issues in release builds, ones that showed up in a completely different area.

Can't even remember how I solved it, it was ten years ago and I just remember the trauma.
>>
>>58321846
Vim isn't really a standalone text editor, in my opinion. It's a set of key bindings to efficiently navigate and manipulate plain text files. I use Emacs and VS Code more than vim, however when I'm using either of those I'm also using vim.
>>
>>58321879
add it to the list of reasons not to use C++
>>
>>58320789
why the fuck is she writing shit in excel
why is there excel on a nokia phone
who is she talking to?
is that a picture of a retarded person?
>>
>>58321846
Other.

I like the text editor that is included with Visual Studio.
>>
>>58321892

is vscode

ELITE?
L
I
T
E
?
>>
>>58321903
It's actually a mirror
>>
>>58321846
vim
emacs is acceptable too
nano is for cattlenigger
>>
>>58321846
>VSCode

why

why use web engine as text editor
why use web engine as anything except web browsing
>>
>>58321846
The United States prevents me from voting in this poll, but I vote for emacs.
>>
>>58321954
Because it doesn't look like it's outta 97
>>
>>58321919
Probably not, depends what the hell you mean by elite. It sure is comfy though.

>>58321954
>why use web engine as text editor
Why not?
>why use web engine as anything except web browsing
Cross platform compatibility.
>>
>>58321968
>The United States prevents me from voting in this poll
why
>>
>>58321846
Good to see vim and emacs getting a reasonable turn out here. It means there may be some technical skill between the lot of you.
>>
>>58321971
>>58321969
so what are you doing while it launches? do you launch it at evening and go to bed to start working in the morning?

also what do you do when u have file larger than 100kB?
>>
>>58321846
I used gedit because it was the default text editor in my Debian installation.
>>
>>58322001
Learn emacs or vim senpai, the keybindings are godtier
>>
>>58321971
>Cross platform compatibility.
wahahahaha

fucking js kiddies
>>
>>58321983
[[To any FBI/CIA/NSA members reading this post, please ask yourself whether defending the Constitution means spying on innocent citizens.]]

They've cut off my access to most popular sites to try to trick me into giving in to the machine.
>>
>>58322030
>FBI/CIA/NSA
>caring about the constitution
that's like saying GCHQ care about british people
>>
who notepad++ here? still comfy even after all these years
>>
>>58321997
I could see it being a problem for your 10 year old Indian PC. But in the civilized part of the world, if your computer can't even run VS code, then you have bigger issues.

>>58322019
?
>>
>>58321997
Believe me, I would use SciTe or gVim if they didn't look like shit, meanwhile I can spare some cycles and some ram to have a pleasantly looking coding experience.
>>
>>58322042
I do
>>
>>58322050
>what is sublime text
>>
>>58322048
do you even know what Cross platform compatibility. is?
>>
>>58321919
VS Code is admittedly pretty damn good.
>>
File: agenthitler.jpg (15KB, 552x386px) Image search: [Google]
agenthitler.jpg
15KB, 552x386px
>>58322030
>make this post as an rms joke
>get a call from Fort Wayne, IN moments later
>pick it up
>silence

>"Fort Wayne is a center for the defense industry."

Fuck, what the hell did I do? I know /g/ won't believe it but damn.
>>
>>58322075
Not open source.
>>
>>58321345
anyone who uses the buzzphrase SJW is, in fact, an SJW
>>
>>58322075
I would use it if I could pirate a version for linux
>>
>>58322101
so?
>>
>>58322086
>In computing, cross-platform software (multi-platform, or platform independent software) is computer software that is implemented on multiple computing platforms.[1] Cross-platform software may be divided into two types; one requires individual building or compilation for each platform that it supports, and the other one can be directly run on any platform without special preparation, e.g., software written in an interpreted language or pre-compiled portable bytecode for which the interpreters or run-time packages are common or standard components of all platforms.

>http://electron.atom.io/
>Build cross platform desktop apps
>>
>>58322075
VS Code is open source.

Sublime Text ain't.
>>
>>58321846
intellij
>>
>>58322107
>I would use it if I could pirate a version for linux
is this bait?

sublime text is available for all platforms
>>
File: opti.gif (2MB, 800x600px) Image search: [Google]
opti.gif
2MB, 800x600px
Finding optimal trajectories. Find the fastest way to move from an initial to a final position and velocity under constant acceleration.
>>
how do I attract girls?
>>
>>58322118
>VS Code is open source.
>Sublime Text ain't.

VS Code is still slower than sublime, even though is open sores

top kek
>>
>>58322001
>>58322017
2nd.png

If you learn vim then most of what you learn can be used on servers in the real world.
>>
>>58322099
I sure hope you're not paying for that long distance call
>>
>>58322137
self.money = True
self.attractive = True
self.tall= True
self.funny= True

[/core]
>>
>>58322159

[[To any FBI/CIA/NSA members reading this post, please ask yourself whether defending the Constitution means spying on innocent citizens.]]

IF FORT WAYNE WAS A SIGN PLEASE CALL ME BACK NOW

NO ONE WILL BELIEVE ME ANYWAY
>>
>>58322151
Just like Assembly is super fast and that's why literally everyone uses it for everything, yeah?
>>
>>58322164
>self.funny= True
Wanna know how I know you're a virgin? Go back to >>>/r/programmerhumor
>>
Why does JavaScript get a lot of hate?

1. It's cross-platform.
2. Easy to learn.
3. A lot of it's bugs have been ironed out in ES6.

I really don't understand.

If you wanted to code a simple graphics program why wouldn't you use the HTML5 Canvas and JavaScript to do it?
>>
>>58322184
Because he's writing in some dynamic garbage?
>>
>>58322107
trial version is free for all platforms, and only difference between trial and full is that somethimes (1:100 times?) on saving file it asks you t purchase
>>
File: Atractor_Poisson_Saturne.jpg (64KB, 640x480px) Image search: [Google]
Atractor_Poisson_Saturne.jpg
64KB, 640x480px
>>58322137
With an attractor.
>>
>>58322184
>Wanna know how I know you're a virgin?

please tell me. i am really curious what a NEET basement dueler knows about my life
>>
Post your githubs so I can laugh at how fat you guys are.
>>
>>58322204
https://github.com/CoralineAda

no bully pls
>>
>>58322197
WHY DO YOU GIVE A SHIT ABOUT WHAT I FUCKING USE???

How insecure do you have to be to have to justify your usage of fancy notepad.
>>
>>58322190
You must be new to /g/

>easy to learn
and
>easy to use

Are valid reasons to hate something here.
>>
>>58322199
Because you're too dumb to understand that I was obviously alluding to your awful sense of humor by telling you to go back to >>>/r/programmerhumor.
So if being funny is a requirement to get girls, you are shit out of luck.
>>
>>58322198
a big cock?
>>
>>58322214
Obvious bait
>>
>>58322190
>1. It's cross-platform.
The language itself has no platform specific bits, i.e. it's useless by itself.

>2. Easy to learn.
If all you do is write fizzbuz, sure.

>3. A lot of it's bugs have been ironed out in ES6.
Kek.
>>
>>58322204
r u callin me fat
>>
>>58322164

>tfw your life is stuck in a non chad infinite loop
>>
penis enlargement
>>
>>58322225
>>>>/r/programmerhumor.
back to rebbit faggot
>>
>>58322091
Le html text editor :^)
>>
>>58322265
If you're a cute girl (male) Im sure they'll start flocking to you.
>>
>>58322284
Ironic shitposting is still shitposting.
>>
imagine you had to do a project with a deadline in a few days, but you don't know what you're suppose to do
>>
I just bombed an interview with Nvidia AMA
>>
>>58322265
Don't worry it's finite. :^)
>>
>>58322245
I'm not even that guy but you are clueless.

>i.e. it's useless by itself.
No. Is C# or Java useless because they require a VM?

>If all you do is write fizzbuz, sure.
Javascript is a very bloat-free (featureless, really) language. It's by far one of the easier ones to learn out of all the popular languages.
>>
>>58322301
You mean the project wasn't correctly scoped out with the client, or what?

That's easily remedied with a quick meeting.
>>
File: javascript.png (5KB, 270x175px) Image search: [Google]
javascript.png
5KB, 270x175px
>>58322308
mandatory pic rel
>>
>>58322302
what did they ask you?

provide details pls
>>
>>58322303
break;

>>58322302
Ask for stock options, they're going to the moon this year.
>>
>>58322190
Why does Haskell get a lot of hate?

1. It's cross-platform.
2. Easy to learn.
3. Type system eliminates a lot of bugs.

I really don't understand.

If you wanted to code a useless fizzbuzz program why wouldn't you use Haskell to do it?
>>
>>58322302
Pascal workstation cards when?
>>
>>58322323
no, i have a college project to do, but don't know exactly what i'm suppose to do, despiste the fact that the professor told me, but it was so confusing, i forgot

should i send an email to the professor, or will he laugh at my face?
>>
>>58322190
It's like Lua, but Lua is literally better in every single way.
>>
>>58322327
You would never end up accidentally doing any of these, except for maybe the sort one. This is like complaining about if (x = 5) in C-like languages. Just don't be a retard and it's not an issue.
>>
>>58322335
>1Gb/s
Wew, lad.
>>
>>58322329

You can't break out of a non CHAD for loop, anon. There might be a way to dump all your allocated memories of failed getQtGf() functions , though.
>>
>>58322308
>No. Is C# or Java useless because they require a VM?
It's not about the VM, it's about not having anything defined in the standard to deal with anything platform related, i.e. files, sockets, threads, whatever else.

I'm pretty sure the C# standard has a set of System stuff defined.

>Javascript is a very bloat-free (featureless, really) language. It's by far one of the easier ones to learn out of all the popular languages.
Yes, it's a feat of engineering how many retarded edge cases, exceptions and got-chas they managed to put in such a small language.
>>
>>58322367
This, just like how C++ always allocates 12MB at the start of program execution
>>
>>58322347
>should i send an email to the professor
Yes, or consult your classmates.

>or will he laugh at my face?
I don't see why this is relevant, as long as you get the needed information to perform the tasks required for a passing grade.

Take it from someone who's got a degree in that field: find a few people in each class to work on homework with. Literally just walk up to someone(male) and ask if they would like to meet up and work on the project together. Repeat regardless of positive response from first victim.

Use your classmates and your professor as resources to attain your goal, which is a good grade.
>>
Reading "assembly language step by step from Jeff Duntermann" seems like a good one, at chapter 2 alien bases atm.
>>
>>58322328
Some simple stuff, summation in linear algebra, write a Fibonacci program, a hardware bounded sort, and then debug a WebGL app for image database. the last one fucked me and I never finished it
>>
>>58322404
>(male)
close but not accurate. Lots of people in college haven't grown up yet. Ideally you should find someone white and/or noticeably older than everyone else. Chances are they have their shit together. Personal experience. Always worked for me.
>>
>>58322374
return 1;
>>
>>58322453
>early termination of program
what a pussy
>>
>>58322445
>Ideally you should find someone white and/or noticeably older than everyone else.
I always loved it when there was like a 35-year-old dude going back for a degree in my class.

Without fail, they were by far the best person to meet up and work with.
>>
Where did this 1 gigabyte meme even come from
>>
>>58322344
Thats what the Titan XP is for
>>
>>58322445
>tfw I was the older senpai
I miss college.
>>
>>58322475
A misleading misunderstanding of a sentence from a haskell wiki article. Now there's literally one guy forcing the meme.
>>
>>58322377
The C# standard doesn't have anything about file IO, the .NET standard does. In much the same way that javascript doesn't have anything about file IO, but node.js does.
>>
>>58322504
C# and .NET are not analogous to JS and Node.JS.
>>
>>58321995
Vim is great because of the keybinds, right? Anything else?
>>
>>58322527
>C# and .NET are not analogous to JS and Node.JS.
Literally why not?
>>
>>58322504
Yeah, and JavaScript has no standard for that, nice going.

C and C++ do.
>>
>>58322530

Pas de bloat
>>
Can you guys recommend me a comfortable programming language to pick up and explain why one would like the provided picks. I hear a lot about Rust and Go so I'm wondering what that's all about. I'm also wondering why a lot of programmers seem to advocate for open source software and promote Linux so often on here. How does a person that roots for open source and is a champion of free software do when applying to positions such as Google which I hear is one of the most lucrative positions for a software developer.

Thanks for the replies if any.
>>
>>58322615
>I hear a lot about Rust and Go
Go is the very definition of comfortable. Rust is probably the opposite. There are difficult concepts you need to know to accomplish the most basic tasks. Learning them involves a lot of trial and error, followed by time spent internalizing them. Avoid Rust and tell people you know to do the same.
>>
>>58322650
System programming shouldn't be comfortable. You should always be on your toes and thinking about what you are doing.
>>
>>58322650
I hear Python is pretty comfortable to use. How does Go compare to Python?

Also if you don't mind, what are the selling points for Go?
>>
>>58322530
It's not really about the key bindings, it's about the way it works, it's modal with a language to work with text.
>>
>>58322615
>>58322650
Get started with Go right now
https://tour.golang.org/
>>
>>58322374

void function becomeChad(bool manlet, float height, char faceGrade, bool funny, int money){
if (manlet){
height = 6.2;
manlet = false;
}
if (faceGrade == 'F'){
cout << "consider plastic surgery" << endl;
}
else{
faceGrade = 'A';
}
funny = true;
money *= 100000000;
}
>>
>>58322615
Go and Rust do not even live in the same niche, Rust is a systems language, Go is a meme "web scale" language.
>>
>>58322685
lmao
>>
File: fuckingcat.jpg (60KB, 565x600px) Image search: [Google]
fuckingcat.jpg
60KB, 565x600px
>>58322685
>
void function

What did he mean by this?
>>
>>58322726
Compiler optimization.
>>
>>58322583
No. File IO is OS dependent. It can't be a language feature unless it's a language written specifically for only one OS. File IO can by definition not be platform independent. The C compilers are just nice enough to translate fopen() to something that works on different OSes. It's the same thing the JS VMs or .NET VMs do.
>>
>>58322615
Open a random number generator to decide
Ada
C
C++
Go
Java
>>
>>58322701
I guess I have to figure out what kind of programs I'd like to build first. What type of language do I need to build simple desktop applications?
>>
>>58322750
~$ die 1 1 5
2

so C
>>
>>58322726
i love feliks
>>
>>58322685
>money *= 100000000;

>0
>-x
>>
>>58322671

Thinking is for fags.
>>
Trying to learn OpenGL... Is there a way I can use exact values when drawing a polygon and not fractions? As in "I want to draw a square 20x20 pixels without needing to know the size of the window"...
>>
>>58322803
and sharting is in the toilet
>>
>>58322673
Python was popular for a little while with webdev types who jumped ship from Ruby. However, it's just as slow as Ruby and has almost as many fundamental design flaws. Its users abandoned it as quickly as they picked it up. There is very little new code being written in Python today.

Go programs build quickly and run quickly thanks to the experienced language designers who previously worked on C. It was created at Google and is used internally there, with many millions of lines of code written in it. It's also used at a number of other companies, both large and small. Dropbox, for example.
>>
I don't know what to focus on programming. Systems vs Applications software? What type of programs? I only ever use the internet when using the computer so I don't know much about software.
>>
how do i limit scanf "%s" to n chars? :3
>>
>>58322815
Yes you can change the model_view to have something calibrated for your resolution.
>>
>>58322870
fgets()
>>
>>58322870
%12s
>>
>>58322765
With a GUI? Cross-platform or for a single platform?
>>
>>58322870
scanf("%3s", string);


ensures that scanf reads no more than 3 characters
>>
>>58322740
That's the point of a standard, to give a cross-platform standard library.

C does it, C++ does it, Java does it, JavaScript doesn't.
>>
>>58322818

Stop bullying C#!!!
>>
>>58322903
Well I was thinking about trying out Linux. Before all this I was kind of thinking about developing games since that's the only other thing I use computers for. I'm willing to try new things though.
>>
>>58322685

bool tfwNoGf(bool hasGf, bool qtAsian){
if (!hasGf){
cout << "tfw no gf" << endl;
return true;
}
else{
if (qtAsian){
getMarriedHaveKids();
return false;
}
else{
oneNightStand();
return true;
}
}
}
>>
>>58322927
So that you can say you have a "whatever" program or a "whatever" compiler. It will always work on any platform as long as the compiler and program are to the same standard.
>>
>>58322928
C# is not as good as it could be
>>
>>58322974
add yourMom
>>
Best Cpp book?
>>
>>58322989
its already better than C++ and java, and its going cross platform

what else would you like it to be?
>>
>>58323011
Advanced C++ Metaprogramming (Davide Di Gennaro)
>>
>>58323011
The standard.
>>
Why there's no separate board for programming as in other imageboards?
>>
>>58323011

C primer

trust me, learn C first. Then get c++ primer
>>
>>58323055
Haskell
>>
What's best C book?
>>
>>58322974

this function gets called by my brain every morning
>>
>>58322974

i heard that if you compile this on gentoo a qt asian AI runs on your desktop and provides you unlimited anime pr0n
>>
>>58323154
that's stupid
>>
>>58323154
you thought that reply was funny before hitting Post?
>>
File: 1479883677181.jpg (143KB, 833x696px) Image search: [Google]
1479883677181.jpg
143KB, 833x696px
>>58323179
>>
>>58323179

this guy is super fun at parties
>>
>>58323231
i dont go to parties, though :|
>>
File: shin_and_noi_cute.jpg (132KB, 900x442px) Image search: [Google]
shin_and_noi_cute.jpg
132KB, 900x442px
I'm working implementing comparisons for my VM. Is there any reason to do it like CPUs and do a subtraction operation and set the zero flag accordingly? I figured I could just compare the two values with '==' and set an 'equal' flag instead
>>
>>58323274
`je' ?
>>
>>58323274
why not make it interesting?
have a flag that checks if the first two registers are equal

if you want to check for zero, put zero in one of those registers
>>
>>58323078
Nigga, C# has discriminated unions and monads.

What more do you want?
>>
>>58323327
unads
>>
>>58323327
>higher kinded types
>higher rank types
>>
>>58323321
I could, but I'd like to avoid clobbering register data as much as possible

I think I'm going to see if I can just work with 'lt', 'gt' and 'eq' flags anyway, those should be enough
>>
>>58323327
>C# has discriminated unions
Citation needed.

>and monads
Any language with generics can implement monads. It's whether you can abstract over them that is interesting, and C# can't do that.
>>
>>58321846
geany
>>
How retarded it would be to webscrape ~1800 html pages of one site, every ~5min? I guess i would get banned after 1 day max
>>
post githubs
>>
>>58323534
proxy list
>>
>>58323534
>real time
>batch processing

choose one
>>
>>58323626
>he doesn't real process in batch time
>>
>>58323662
dont make me bust out the smug anime girl pictures anon
>>
>>58323378
First, what are your requirements for a discriminated union?
>>
File: 1465745250049.png (1MB, 1363x585px) Image search: [Google]
1465745250049.png
1MB, 1363x585px
>>58323701
>>
File: cute anime pic 0072.jpg (36KB, 390x390px) Image search: [Google]
cute anime pic 0072.jpg
36KB, 390x390px
>>58323701
Was that a challenge?
>>
>>58323709
what are your requirements for a discriminated union? You're the one who claimed they existed in C#. So what were you referring to? I hope to god you weren't talking about enums..
>>
>>58323712
>>58323717
my smug anime girls folder is empty
i surrender
>>
>>58323731
I'm trying to get what your understanding of a discriminated union is, before you come back with "Well, it's not *technically* a discriminated union because you can't also apply it to [insert other functional thing]."

In any case, you can simply do the following:
install-package OneOf

and then you have discriminated unions. Or you can implement them yourself, if you desire.

   OneOf<Rectangle, Circle, Prism> shape = …;
shape.Match(
rect => gfx.DrawRect(rect.X, rect.Y, rect.Width, rec.Height),
circle => gfx.DrawCircle(circle.X, circle.Y, circle.Radius),
prism => …
);
>>
File: 148347438691.png (1MB, 1920x1080px) Image search: [Google]
148347438691.png
1MB, 1920x1080px
>>58323766
>>
>>58323787
inb4 b-but that's a library
>>
>>58323787
That's not a langugae feature though. You might as well say assembly has discriminated unions with retard logic like that.
>>
File: vulkan api.png (127KB, 921x1546px) Image search: [Google]
vulkan api.png
127KB, 921x1546px
Trying to learn Vulkan. Incredibly verbose, but kinda fun.
>>
>>58322882
>model_view
So from what I've seen, it looks like model_view is a matrix... I'm kind of unsure how to manipulate the "view".
>>
Curious, how old are you guys?
>>
>>58323871
25
>>
>>58323871
30
>>
Is there a strictly 2D version of OpenGL I can use for graphics? Manipulating the view and camera seems kind of tedious for making a simple 2D app
>>
>>58323871
22, been in these threads since I was 17.
>>
>>58323871
22
>>
>>58323856
It's a matrix, yes. If you load identity, -1..1 will represent all your screen. So you have to set a coefficient of 1/w for the width and 1/h for the height in the transformation matrix to have a 1 to represent a pixel.
>>
>>58323871
23
>>
>>58323896
You can just use some 2d graphics library that uses OpenGL for rendering.
>>
>>58323871
>18
>Kind of have no idea how to make graphics programs without wanting to kill myself
>Oh well.jpg
>>
What's the best scripting language?
>>
>>58323992
F#
>>
>>58323871
18
>>
>>58323896
But what if you want to pan the camera around? OpenGL does that for free for you.

>>58323992
Lisp
>>
>>58323896
SDL?
>>
File: baka_big.png (2MB, 2000x2000px) Image search: [Google]
baka_big.png
2MB, 2000x2000px
>>58323835
>b-but that's a library

Not a very good argument, considering C#'s inextricability to .NET.

Many things in a language like C# are not technically "language features", and yet they are widely-used integral parts of the language.

Separating a language from easily-accessible libraries is asinine.

When you say "C# has LINQ" or "C# can interact with a database", obviously these statements are meant in such a way that the normal usage scenario of C# supports these concepts.

But here, so you can feel superior:
Technically, C# as a language in and of itself - when taken in a vacuum with no frameworks and without access to the internet - does not have discriminated unions, nor can it read a text file or print the time of day in a console.
>>
>>58323896
Take a look at SFML if OGL is too hard for you.
>>
>>58323871
24. It's interesting going back to undergrad classes even though it's just night classes.
>>
>>58324048
Well it's pretty fucking silly to have such a vague definition of "discriminated unions" that even assembly apparently supports them on a langugae level according to you.

I'd also rather kill myself than use a shittly library like that that forces offensively verbose code. If you want unions, just use F#.
>>
>>58320913
>at work, compiling some program that uses the mysql client library
>for some reason it crashed when doing database stuff
>it used to work
>compile libmysqlclient with debugging symbols and start debugging
>it crashes when locking some mutex
>mutex seems uninitialized
>it used to work so it must be initialized
>maybe it gets corrupted during execution
>test with valgrind, gdb watches, everything
>nothing overwrites it
>let's check initializations
>start looking for that mutex through the 10 layers of initialization functions that libmysqlclient has
>take them one by one, stepping through them with gdb
>come across a function named my_init from the mysql library
>step in it
>it jumps to a my_init implemented in the binary, not in the mysql library
>what the fuck is happening
>inspecting further, it calls some init function from libusb and it's getting called by __libc_csu_init
>nothing exported this function, it was created by gcc and it overwritten libmysqlclient's my_init at link time
>rename the function to my_initSomeShit in libmysqlclient, recompile, everything works

Fucking gcc, I spent 2 days pulling my hair on this bullshit. A warning or link error would've helped.
And libmysqlclient looks like it was written by retards, who the fuck names an internal function my_init then exports it when all the library's public functions start with mysql_
>>
File: 1483562994122.png (324KB, 2000x2000px) Image search: [Google]
1483562994122.png
324KB, 2000x2000px
>>58324048
your png is now optimized
>>
>>58324107
thanks : 3
>>
>>58324107
I pay for the right to use unoptimized pngs, but thank you anon.
>>
Anyone has suggestions on how to optimize this?
Especially the positive negative check.
int division(int a, int b){
int abs_a = a, abs_b = b;
bool negative = false;
if(a < 0){
abs_a = -a;
negative = !negative;
}
if(b < 0){
abs_b = -b;
negative = !negative;
}
int result = 0;
int tmp = abs_a;
int shifted_b = abs_b;
for(int i = 31; i >= 0; --i){
shifted_b = abs_b << i;
if(tmp > shifted_b && shifted_b > 0){
tmp -= shifted_b;
result += 1 << i;
}
}
return (negative ? -result : result);
}
>>
>>58324107
can you optimise my life pls
>>
>>58324133
how do you make that "4chan pass user" icon show up?
>>
>>58324135
int division(int a, int b){
return a / b;
}
>>
>>58324148
you have to have 4chan pass, new friend
>>
>>58324173
I do, and I'm logged in.
>>
>>58324148
Have you tried being a 4chan pass user.
>>
>>58322042
Ayy I'm fairly new to programming but we use it at school for Assembley class
>>
Ok so I've been programming for a while and did some projects but I want to try something harder. If I wanted to do something which you need a server hosted how would I make it and test it if I don't have access to a server? I don't know if you understand my question..
>>
File: 1482687438691.png (258KB, 692x648px) Image search: [Google]
1482687438691.png
258KB, 692x648px
>>58324166
>int division(int, int)
>>
>>58324166
obviously, but it was for a platform which does not have division
>>
>>58324100
I didn't say C# supports them as a language feature.

I simply said that it has them, and then clarified to what extent that C# "has" discriminated unions.

Regardless of the verbosity of the library, the library gives C# functionality that you would expect from discriminated unions.

Hell, I even told you that C# technically does NOT have them in a very specific context that you seem to want to see things through at the end of the post you're responding to!

>If you want unions, just use F#.
I agree with you on this, and I regularly use F# in supporting libraries for larger C#-based applications. This is ultimately irrelevant, though, as you wouldn't use F# instead of C#; the most effective use is to allow them both to play to their strengths and use them alongside each other.

Just like functional and OOP paradigms, they're at their best when they're working together!
>>
>>58324211
>I simply said that it has them
So you think assembly "has them" too?

>as you wouldn't use F# instead of C#
Why not? I certainly do.
>>
>>58321067
share tis with us when you've figured it out.

I have no clue what you just said and I'm intrigued by the prospect.
>>
>>58324202

Your compiler will emit instructions to execute division using other instructions, if an equivalent to DIV does not exist on your platform. Similar to how floating point is usable in C on platforms where no hardware floating point exists.
>>
>>58324295
>on /dpt/
>Doesn't know what I'm talking out
What part of it confused you? I thought /dpt/ was full on intellectuals
>>
Rushed my flash card game: http://pastebin.com/de16Awb4
>>
>>58324307
you are completely missing the point.
I am talking about how to improve the algorithm.
I think the negative check I perform is a bit clumsy, but I don't really know what to do to improve it.
>>
>>58324391
it is not clumsy :^)
>>
>>58321453
What else would the 1 be treated as in a shift like that?

I was going to compile that code but the js on the site won't let me copy paste properly so I'm done with that for now.
>>
File: 1422127648646.png (45KB, 383x385px) Image search: [Google]
1422127648646.png
45KB, 383x385px
>>58324386
>Rust
>>
>>58324391

What ISA is this for? If the compiler's native code generation is insufficient, it would be helpful to have an instruction to instruction comparison.
>>
Discrimated unions are inferior to Scott encodings anyways.
>>
>>58324500
Thanks for the (You).
>>
God why does this always fucking happen, I set out to make a very simple UI lib for ma games and it's now at 500 lines and still doesn't do anything

Fuck my life
>>
>>58324600
UI is hard. Don't write your own UI lib, no matter how tempting. It will be way harder than you think. If you just want to make a game, and don't want to make a UI lib for the sake of it, just use something pre-existing.
>>
>>58324539
It is an FPGA, it was just faster to write the code in C as it easily translates and it is easier to test on my computer.
>>
>>58324386
Tip: On line 42, the
::<usize>
is unnecessary since the compiler should infer the type from the next line.
>>
>>58324545

>look up "scott encoding"
>wikipedia article is just a bunch of lambda calculus
>don't have time to decode this shit

Okay, what does it look like in memory? Can you provide an example C structs/unions/enums?
>>
>>58324620
Na dude, I think I have it finally figured out, might even finish some time soon.
>>
>>58324648
It's required:
error[E0282]: unable to infer enough type information about `_`
--> src/main.rs:61:23
|
61 | if let Ok(number) = input.parse() {
| ^^^^^^ cannot infer type for `_`
|
= note: type annotations or generic parameter binding required
>>
>>58324664
God speed bud
>>
>>58324680
Huh, I thought it should be able to.
>>
>>58324656
In memory, you'd implement it like a tagged union (or maybe with virtuals for whatever reason). In languages without built-in tagged unions or pattern matching, it's a way of getting a similar API. In languages with built-ins, it's a way of having more control over the representation.
>>
File: Thumbs up Queen.png (2MB, 982x1736px) Image search: [Google]
Thumbs up Queen.png
2MB, 982x1736px
>>58324043
>>58323944
Yeah I think I'm gonna go with SDL... Looks simple enough.

>>58324005
I'll look into it when I move into four-dimensional chess. (Thanks for the suggestion, I just think it's a bit overkill for what I'm going to do)
>>
>>58324680
Maybe replacing the 0 on line 43 with 0usize helps?
>>
>>58324706

So it's the same concept, just a different higher level abstraction?
>>
>>58320913

Compiler bug in .NET, optimizer erased a whole branch of a totally valid if/else statement.

Adding an `|| 1 == 1` to the conditional fixed it, but without that it would emit the wrong IR
>>
>>58324716
Nope, still the same error. Even if I remove the first test from the if statement.
This is the updated version btw: http://pastebin.com/bsGP4LD4
>>
>>58324756
Yeah, you're building the same high level abstraction out of lower level primitives instead of having it built-in and beyond your control.
>>
>>58324789
I just checked the docs (https://doc.rust-lang.org/std/primitive.str.html#method.parse), it seems due the parse method being too generic.
>>
>>58324656
>>58324756
It's like storing data structures as lambdas
>>
>>58324792
>>58324829

Sounds somewhat reasonable.
>>
i love you
>>
>>58324847
LEWD
>>
>>58324771
IR? you mean IL?
>>
>>58324829
In the sense of first class functions without dynamic dispatch, yeah. It's just instead of the environment data and one function pointer, you have multiple function pointers.
>>
>>58324868

IL (Intermediate Language) is technically a type of IR (Intermediate Representation). Java Bytecode and LLVM IR are also types of IR.
>>
>>58324868

Derp, yeah IL.

Sorry, it's been a while since my .NET days, I was thinking of LLVM IR.
>>
>>58324844
for instance:

type BoolCh = forall a. a -> a -> a
true, false :: BoolCh
true x _ = x
false _ y = y


you literally store bools as an if-then-else function
>>
>>58324911
That's Church encoding.
>>
>>58324923
isn't it the same for booleans?
>>
>>58324932
Yeah, I suppose they're the same for non-recursive types.
>>
Just finished adding comparison and jump instructions to my VM, dunno if I should keep the JZ and JNZ instructions though
https://github.com/baklava151/VirtMachine
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
anyone know off the top of your head if there is a .net way for my program to detect the open and close of another, independent process?

I know I can manually compare the current process list every once and a while but was curious if there was an event-based way of implementing the function.
>>
>unemployed since mid-august
>started to lose hope
>two weeks ago I had a second-round interview that went great
>told me they'd get back to me after the holidays ended
>recruiter told me later the same day they told him they wanted to hire me and already got approval from their bosses
>two weeks later
>no word from them
>recruiter scheduled a call with them
>they missed the appointment
>not even an apology

why does got like toying with me?
>>
>>58324991
D looks cool, might try it some day
>>
>>58322136
Is the word there optimal? I'm not challenging you, I'm genuinely wondering now...

Is it because, essentially, the "fastest" way to move across while keeping to the stipulations just so happens to mean ending at the same time as they? As if to employ yourself a chance in development.

How does the tendency to change more often play into this besides the sense that one of them is either always an order of magnitude ahead of the other by diverging from the normal or one of them is always "walking" on three dimensions, or into the distance, while the other is "walking" on 2 dimensions.

I'm still calc 1 so lmk if this is correct. I really like this stuff like ths.

The first one almost looks like the tensory point is being drawn from the straight line it is to the curved path he stretched about.


the second one there looks ike two hills. Blue on in the back, green one in the front. But it also looks like a "competition" between two people walking along similar path and are diverting at equal rates until the normal reached a close enough approximation to the gradient and both parties decided to mirror their trajectory inversely.

The third one there looks more like the view is plotted against the normal and the normal is then used to relate, more succinctly, one of the current reltionships between the observer and the person or thing walking along that blue line.
>>
>>58325199

That fourth one looks like it's doing the inverse thing but to again but this time it's more behavioral and the gradient and normal are symbollic. That is to say, they are only taken into consideration with regard to this blue because they can influence the value to "react" with a more symbollic gesture or "event" like the twisting of a rope or torsion as an inversion of the force or forces applied. Like in the first one, except that there are two variables. One for keeping the momentum and another for making direction. The thing about that is that since this is about influence, the influence there happens marginally. Like marginal interests.

Anyway, the first one reminds me of stroking it, or arousal, behavior to spurn a peak and how the height affects the acceleration which in turn shows the tension in the blue line because is either dissipates or has to accumulate enough momentum to properly make the trip back. The last one look like the side of a dick, head at the top and the relationship described kind of seems to be making a semblance of the stroke stroke release and relax of nutting.

The second one is people in avoidance?
The third a person in observation ( is observation gradiated or normal? )

I could do this all day. I'll stop.
>>
>>58325182
apparently, yes

https://stackoverflow.com/questions/17145469/hook-closing-applications
>>
>>58324895
You sure are...
>>
>>58324911
type lambda =
| Var of string
| Lambda of string * lambda
| Apply of lambda * lambda
;;
let rec print_lambda ppf = function
| Var v -> Format.fprintf ppf "%s" v
| Lambda (x, y) ->
Format.fprintf
ppf "@[<hv 2>(@,%s =>@ %a@;<0 -2>)@]"
x
print_lambda y
| Apply (f, x) ->
Format.fprintf
ppf "@[<hv 2>(@,%a@ %a@;<0 -2>)@]"
print_lambda f
print_lambda x
;;
let var s = Var s;;
let lambda xs y =
let rec loop y = function
| [] -> assert false
| [x] -> Lambda (x, y)
| x :: xs -> loop (Lambda (x, y)) xs in
loop y (List.rev xs)
;;
let apply f xs =
let rec loop f = function
| [] -> assert false
| [x] -> Apply (f, x)
| x :: xs -> loop (Apply (f, x)) xs in
loop f xs
;;
let bool = "bool";;
let case_left = "left";;
let case_right = "right";;
let x = "x";;
let y = "y";;
let mtrue = lambda [x; y] (var x);;
let mfalse = lambda [x; y] (var y);;
let mk_pair l r = lambda [bool] (apply (var bool) [l; r]);;
let fst pair = apply pair [mtrue];;
let snd pair = apply pair [mfalse];;
let mk_left_or l =
lambda [case_left; case_right] (apply (var case_left) [l])
;;
let mk_right_or r =
lambda [case_left; case_right] (apply (var case_right) [r])
;;
let unit = lambda [x] (var x);;
let empty_list = mk_left_or unit;;
let cons x l = mk_right_or (mk_pair x l);;
let zero = unit;;
let succ n = cons unit n;;
let one = succ zero;;
let two = succ one;;
let print ppf (name, exp) =
Format.fprintf ppf "@[<2>%s:@ %a@]@." name print_lambda exp
;;
let rec print_list ppf = function
| [] -> ()
| [x] -> print ppf x
| x :: xs -> Format.fprintf ppf "%a@ %a" print x print_list xs
;;
let () =
let exprs =
[
"true", mtrue;
"false", mfalse;
"zero", zero;
"one", one;
"two", two;
] in
Format.printf "@[%a@]@." print_list exprs
;;
>>
In Rust, when do I use 'mod' and when do I use 'use' when my intent is to include/import shit from a file inside the same crate?
>>
On the topic of Scott encodings, my language will support lambda syntax for >>58324872, similarly to Haskell's lambda case feature.

So if you have this type used for pattern matching a Scott encoded natural number:
record NatPatterns (X Env : Type) : Type {
zero : Env => X,
succ : Env => Nat => X
}

You'll be able to write something like this:
\{
zero -> a,
succ m -> f m
}

And have it check for that type with suitable instantiations of X and Env (where Env captures a and f if necessary).
>>
>>58325221
a hook would certainly be able to handle the exit, but not the opening of the process. It still seems like I would need to run a check on a timer with that method.

It's meant to be a background application so I don't really want it to be too heavy.
>>
>>58325256
mod is for declaring a module, either inline or in another file/directory. use is for importing from an existing module. You might need both.
>>
I want to implement my own Basic.
What features to add?
>>
>>58325350
Lambda Calculus
>>
>>58325298
anon don't do it
>>
>>58324911
>>> languages = ['java', 'c++', 'c#']
>>> import random
>>> x = random.choice(languages)
>>>


should i roll the dice on a new language? right now i know pythong and have made a few projects.
>>
>>58325435
languages = ['haskell']
>>
>>58325320
>You might need both.
yeah i figured that much. it's just confusing.

// src/mbr.rs
use util::*; // i can't "mod util" here

pub struct MBR {}
impl Default for MBR { /* ... */ }

// src/lib.rs
mod util; // if i remove this i can't "use util::*" in mbr.rs
mod mbr; // i can't "use mbr" here

fn main() {
let mbr : MBR::default(); // rustc can't find MBR in here
}
>>
>>58325461
i haven't rolled yet.

why should i add haskell to the list?
>>
>>58325435
next stop, C#
>>
would it be illegal to write a program that tries to login to a ssh server n amount of times with passwords from a password list file?

t. skidlord
>>
>>58325488
it's hands down better than all three of those languages
>>
>>58325488
You don't add, you redefine.
>>
>>58325405
What's wrong with it?
>>
>>58325515
Yes unless you got explicit permission to do that kind of thing for pentesting
>>
>>58325435
>>58322750
Add C# if you want
>>
>>58325320
>>58325466
Nevermind I figured it out. I didn't have a main() but a test module and I had to import mbr::MBR inside of it.
>>
>>58325542
what if i only do it on chink and indian IPs?
>>
>>58325537
use lambdas instead
a case expression then becomes a list of (constructor, lambda) pairs
the lambda has to have a type that accepts arguments from the constructor
>>
>>58325593
I want the cases to share an environment for efficient representation.
>>
>>58325537
>>58325593
and this way you could have stuff like

bimap f g = 
\case {
Left : f
Right : g
}


>>58325609
well allow people to use lambdas
>>
>>58321846
>people actually use atom


just fucking wow...
>>
>>58325217
so like they always share this relatioship where one of them is one degree higher than the other.

first one has x and x^2
the second has x^3 and a factor of a polynomial with degree x^2
The third one has and x^4 in the sense that there is a normal rate and then there's what appears to be an observed rate of change based in 2 dimensions but considering a polynomial with degree x^3
And the last one is an act upon remembering ( x^5 ) what it was that he was observing at that one point in time
and the fourth one the normal of the interaction as elevated ( escalated? )with only the effect of what would be a discrepancy if we didn't have the pre-cursors. The other person being the acting agent on the body or work that made considerations in the first place and presumably acted on them as shown by the inversion taking place from the point of stimuli to now observable stimulus.


I hope that made some sense. I thought it did.
>>
>>58325621
No built-in pattern matching.

>well allow people to use lambdas
There's normal lambdas as well, obviously.
>>
>>58325652

So if 4 is time, and time is change and change is observed.

Then maybe the act of observation requires 2 dimensions for qualifying any point relative to the metric of velocity over time and we are actually bound to the other "side", as in 2s complemets, of the 4th dimensional "barried", ergo in the 5th And from the fifth we consider the change to be meaningful or not. Worthy of being sought/observed ( as a point of importance, where the word means imperative ) or of being ignored/"repulsive".

The last pic then showing in hindsight a point of normalcy that was implied or conjectured without the need to debase the observed by adhering the quality of what's beyond our observable experience and ultimately keeping a gradient between the two as a shift over non-laterals or keeping the full set happenstances apart (He walked into her, or ran into her. He then happened to see her crossing the street. Neither of which are related beyond the measure that they both were there. He also happened to stroke himself before going out and then when he got back home, happened to finish fapping. ).

Does that even make sense? Also, is that rate between them a heart beat?
>>
>>58325461
>>58325509
>>58325524
>>58325546
import random
import time

languages = ['c#', 'c++', 'haskell', 'java']

countdown = 60 * 5

while countdown > 0:
print(countdown)
time.sleep(1)
countdown -= 1

print(random.choice(languages))


i'm going to run this code. i haven't felt this much suspension in awhile.
>>
>>58325679
Good luck anon-sama
>>
New thread:

>>58325678
>>58325678
>>58325678
>>
>>58322685
but what if I am in debt? Then my debt is multiplied and I will never be able to have a long term relationship with a succubi.
>>
>>58325653
I meant rather than forcing people to extract in constructor patterns and then rebind in an expression, it might instead be nicer to have the option to use raw lambdas (or just regular function values)
>>
>>58325677
actually the observation will require 3 dimensions. The positing of the observatin will happen in 2 and regarded in 2s albeit it will happen over time hence.
>>
>>58325515
No. Only using it illegally would be illegal/
Thread posts: 319
Thread images: 19


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