[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: 327
Thread images: 26

File: cant_sleep.png (34KB, 740x244px) Image search: [Google]
cant_sleep.png
34KB, 740x244px
Integer overflow edition.

What are you working on, /g/?

Old thread: >>60771252
>>
nth for ~0 == 0
>>
File: 1453302491365.png (129KB, 314x278px) Image search: [Google]
1453302491365.png
129KB, 314x278px
>>60775927
Why did you create this new thread so soon after the old thread hit the bump limit?
It's still on page 1.
>>
>>60775927
Integration of memecoins with a backtesting library
>>
>>60775942
Because I don't want animeshit in the OP post.
>>
>>60775957

surely you jest mr feynman!!
>>
>>60775957
And posting reddit-tier XKDC shit is better?
>>
File: 1483550393416.jpg (78KB, 600x394px) Image search: [Google]
1483550393416.jpg
78KB, 600x394px
Trying to write a library for RedSeaFS then a HURD translator for RedSea.

Currently stuck at the .Z compression, because it uses x86_64 assembly.
>>
>>60775972
either way you autists will discuss about it.
>>
>>60775978
Post code, or I'm calling bullshit.
>>
https://youtu.be/RqFgtYrw4J8?t=11m39s
Daily reminder that Haskell is for little faggots and/or CIA niggers
>>
Going through rust tutorials. Any ideas for something I can build with it?
>>
>NO
>OLD
>THREAD
>LINK
shaking a bit
>>
>hasklet S T I L L doesnt have dependent types
Dont understand why people are still using it desu
>>
>>60776123

>OOP still buggy as hell
wew
>>
>>60776077
I wonder where Terry gets money to live
>>
>>60776151
>thinking haskell is trash means i like POO
wew lad
>>
>>60776114
C compiler
>>
RichTextBoxfag here again, still can't find the problem, just narrowed it down to "it stops at about 2000 lines".
0->n = stops at 2232 lines, 12280 chars.
1000->n = stops at 2047 lines, 12280 chars.
'w' n times (with new lines) = stops at 2047 lines, 6139 chars.
'w' n times (no new lines) = doesn't seem to stop, went 100k chars no problem.

Only thing I can think of is I'm reaching some limit I don't know about.
>>
>>60776156
He's retired
>>
>>60776118
It's right there, you dumbass.
>>
>>60776114
Some kind of interpreter should be pretty easy.
A simple vidya with gfx-rs or such.
A network server like IRC or DNS, but you really should learn futures/tokio first.
>>
>>60776168

what type of paradigm do you use then?
>>
>>60776223
a mixture of all i can with an emphasis on purity.
>>
>>60776216
Yea was thinking of a simple nethack inspired console vidya but I'll look into gfx-rs too, cheers
>>
>>60776123
You can fake dependent types in Haskell with DataKinds and a few other extensions.

But, are there any languages with proper dependent types that perform well?
>>
>>60776123
Actually: https://typesandkinds.wordpress.com/2016/07/24/dependent-types-in-haskell-progress-report/
> When can we expect dependent types in GHC?
> The short answer: GHC 8.4 (2018) at the very earliest. More likely 8.6 or 8.8 (2019-20).
>>
>>60776259
Coq,Agda, idris
>>
>>60776271
>Haskell getting DTs in 2020
gonna be a wild year desu
>>
File: im_with_her.png (44KB, 740x633px) Image search: [Google]
im_with_her.png
44KB, 740x633px
>>60775927
why do people like xkcd? his comedy is so low tier
>>
>>60775972
anything is better than anime
t. otherfag
>>
>>60776294
Hes the big bang theory for people who always whine about it.
>>
File: operating_systems.png (43KB, 740x189px) Image search: [Google]
operating_systems.png
43KB, 740x189px
>>60776294
Still the best tech-related comedy out there tho.
>>
>>60776328
don't you mean userfriendly
>>
File: new_car[1].png (27KB, 715x187px) Image search: [Google]
new_car[1].png
27KB, 715x187px
>>60776294
he's got some funnies.
>>
>>60776259
>implying Haskell performs well
topkok
>>
>>60776390
this jokes been done before thoguh, its a derivative of the nigerian prince scammer is legit joke
>>
>>60776294
>I disagree with him politcally, therefore everything he does is shit.
>>>/pol/
>>
>>60776433
I didn't, actually.
>>
>>60776441
Actually it's >>>/r/the_donald now.
>>
>>60775927
>A 16bit joke in year of our Lord 2017
I appreciated it
>>
File: drone_problems.png (47KB, 740x290px) Image search: [Google]
drone_problems.png
47KB, 740x290px
>>60776441
you think that comic even passes as a good thing? even if it was about trump i would have posted it.
>>
File: estimation[1].png (22KB, 297x335px) Image search: [Google]
estimation[1].png
22KB, 297x335px
>>60776438
on the internet there's no OC. even if there is, it isn't.
just one of those things. bawing about it is pointless.
>>
I just barely passed my java intro course. (9/18points)
How can I git gud faster?
What can I read?
What should I work on?
>>
File: pepe_meme'd.jpg (86KB, 803x688px) Image search: [Google]
pepe_meme'd.jpg
86KB, 803x688px
>>60776660
>>
>>60776713
>a 50% is passing
>>
>>60776713
holy shit how, i didnt even attend classes and got a HD. Java is easy as fuck. Perhaps study for one and practise the stuff you failed
>>
File: 1486418009835.jpg (454KB, 1980x1080px) Image search: [Google]
1486418009835.jpg
454KB, 1980x1080px
>>60776713
poo in it
>>
>>60776713

what are you struggling on anon?
>>
>>60776800
that tommorows date wont work 4% of the time
>>
Anyone here do much shit with .dll's?
Trying to figure out how a program does something and I'm at a loss
>.dll is part of a program, has an export function for some of the API that handles encoding/decoding of a file
>Found function name with Dependency Walker, tried to use rundll32 to run the function on a file to get the decoded output
>Yesterday it seemed to execute but wouldn't actually write any output
>Today all I get is the message "There was a problem starting .dll. The specified module could not be found" whenever I run the exact same command
>No idea what I'm doing
Anyone able/want to help?
>>
>>60776817
Is the .dll actually in the run directory of your program?
>>
>>60775927
Daily reminder that if your language does not exist in this list, your language does not matter
>C++
>Python
>C#
>Any form of Javascript

Thank you, and have a nice day.
>>
>>60776841
This nerd doesn't even use R
>>
File: 1496061516822.jpg (113KB, 573x892px) Image search: [Google]
1496061516822.jpg
113KB, 573x892px
>>60776841
Say hi to Lua-chan anon. She's totally beating the gay snek in embedding, and she's super duper cute!
>>
>>60776841
I don't care if my language is irrelevant. I use my languages because they are good at something, or I enjoy programming in them, mostly the latter.
>>
>>60776865
LUA is literally a slut language.
>>
Dividing by zero should be allowed.
The result should be zero.
>>
I have no idea what kind of program I could build in C that could be done in a year and be big enough to show my eventual interviewers that I at least know a thing or two about C. If anyone's got a suggestion I'm all ears.
>>
>>60776800
Hehehehehe heheheheehehehe JAVA IS FOR SHITS

c > python > garbage
>>
>>60776865
Yeah, a "girl" that looks more like a boy is way more hetero than a snake.
>>
>>60776883
literally just return 0
>>
>>60776895
Bytecode interpreters are always fun
Can even do an assembler to go with it
>>
>>60776883
a / b = c => c * b = a tho, by definition.
>>
>>60775983
>>60776302
>>60775957
>complaining about anime on anime website
maybe you should take you meme XDBS reddit memes and go back to where you came from
>>
>>60775927
>signed short in 2017
y u do this
>>
>>60776895
Write a program that obfuscates code
>>
>>60776883
broofs?
>>
>>60776928
a short in 2017*
>>
>>60776883
That's fucking stupid though. There is a reason it's undefined.
2/0 = 1/0 = 0 => 2 = 1 = 0
>>
What's the difference between the different vim plugins for visual studio? Do some run a real vim or is it all just keyboard shortcuts running in VS?
>>
>>60776865
Lua a cute!
>>
>>60776928
less space

>>60776930
not him but ill give it a go. It shouldnt be 0 but infinity, n/x where n is a positive real number as x tends to 0 the result tends to infinity
>>
>>60776883
EZ to do in python.
>>> def divide(a,b):
try:
return a/b
except ZeroDivisionError:
return 0


>>> divide(1,0)
0
>>
>>60776991
@(a,b)
a&b<<0
>>
>>60776800
>if(x > y) return true;
Gotta admit, I do that sometimes accidentally.
>>
>>60776990
>result tends to infinity
Only from the positive direction.
>>
>>60776883

how to lose millions of dollars 101
>>
>>60777017
There is literally nothing wrong with overloading operators though
>>
>>60776990
There's a numberphile video that explains why that's wrong
>>
>>60776837
I'm actually just trying to call the function through powershell, but yes I'm in the right directory for it
>>
>>60777024
it enables stupid people to write some really really bad code. which is why java doesn't allow it.
>>
>>60777030
x/y is an indeterminate form, it can be whatever the fuck you want it to be, which is why it depends on the application whether or not dividing by zero is meaningful.
>>
>>60777052
it also allows people to use linear algebra in C. Java is shit btw
>>
>>60777052
https://www.zerotier.com/blog/2017-05-05-theleak.shtml
>>
>>60777017
Can anybody explain what's wrong with it?
>>
>>60777081
surely you mean sepples because you can't operator overload in pure c
>>
>>60777081
java is not shit fuck you

A.times(x).minus(b);
>>
>>60777111
return x>y;
>>
operator overmemeing is an unnecessary syntactic nougat that nobody unironically uses except vector libraries
>>
>>60777152
Yeah, I know that return x>y is better/more elegant. I'd just wanna know what's actually wrong with the other way of writing that.
>>
>>60777167
It's just unnecessary.
>>
>ree languages arent allowed to have features my brainlet cant handle

Python peasants pls go and stay go
>>
>>60777141
t. pajeeta, prince of all streetshitters
>>
>>60777111
x > y is a bool in itself
return (x > y)
>>
>>60777192
But Python has operator overloading.
>>
Integer extend [
fizzbuzz [
| fb |
fb := '%<Fizz|>1%<Buzz|>2' % {
self \\ 3 == 0. self \\ 5 == 0 }.
^fb isEmpty ifTrue: [ self ] ifFalse: [ fb ]
]
]
1 to: 100 do: [ :i | i fizzbuzz displayNl ]


Smalltalk is cute!!
>>
>>60777111
its kludgey.

one can just as easily return x<y
>>
>>60777191
so its fine.
>>
>>60777204
Completely disgusting.
>>
>>60777208
Anything that runs correctly is technically fine. Although it may run a bit slower since there's that extra if statement.
>>
>>60777202
Not real OO though.
>>
>>60777232
What constitutes "real" OOP?
>>
>>60777204
verbose nonsense.
>>
>>60777167
theres nothing technically 'wrong' with doing it that way. it still compiles. it runs properly. you just look like an idiot tho using 10 lines of operations instead of just return x<y
>>
>>60777208
try submitting that to linus and see what happens
>>
>>60777241
Python's OO is limited to classes.
>>
>>60777241
>>60777204
>>
>>60777204
most efficient fizzbuzz solution:
Print("1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz")
>>
>>60777263
Smalltalk is garbage.
>>
>>60777255
what else is oo besides classes?
>>
>>60776865
>>60776900
My anaconda don't want none unless you've got buns hun?
>>
Where were you when rust shills said overflowing is safe, simply because it's defined to wrap around (as if C compilers detect overflow during run time and purposely mangle the result?)?
>>
>>60777294
Using my Lisp REPL.
>>
>>60776929
That sounds really interesting
>>
>>60776929
obfuscates source or compiled code?
>>
>>60777294
So, how big does a number have to get until an int or a long in C overflows? What happens if I send the source code to a friend on a different computer? Can I easily write tests for overflow in debug mode, without explicitly adding them to the source?
>>
>>60777349
#include <stdint.h>
>>
>>60777294
Not using memelang.
I knew Rust was fucked from the start, then it was confirmed when i read they call themselves "rustaceans".
>>
>>60777349
#include <limit.h>
#include <stdint.h>


It's not fucking rocket science.
>>
>he needs an import to protect against overflow

I dont get why people still use a garbage language like C.
>>
>>60776438
but that comic was made 8 years ago
>>
>>60777402
>he thinks includes are imports
Go back to writing web apps, grownups are talking
>>
>>60777294
>got BTFO'd in the previous thread
>let's spread revisionism in the new one
MIPS CPUs has hardware traps on signed integer overflow, so C compiler can generate code that will produce a signal on overflow without violating the standard.
>>
>>60777349
>how big does a number have to get until an int or a long in C overflows?
google 32 or 64 bit signed and unsigned integers
>>
>>60777413
>needing to import headers isnt importing because we call it including
wew lad
>>
>>60777343
Why would anyone want to obfuscate compiled code?
>>
>>60777434
>including a bunch of typedefs and #defines is the same as importing dynamic and lazily bound symbols
KYS
>>
>>60777378
What, do you expect people to read the docs or something?
>>
>>60777366
>rustaceans
I don't even like Rust but that's a pretty gud name
>>
>>60777434
It's not the same at all. Including is literally cat
>>
>>60777420
holy shit, there are hardware traps now? traps are gay

also every x86_46 CPU have that ability. bits 0 and 11 in the EFLAGS register tell you if there was signed or unsigned int overflow.

also, the compiler will only catch an overflow during compilation not runtime.
>>
>>60777420
I actually just went to bed, and woke up to people implying the issue of overflows revolves around if it's defined or not. Rust simply defined it how current CPUs already do it. It doesn't make it safer.
>>
What's /dpt/ working on today? Anything fun?
>>
File: shift.mp4.webm (974KB, 1920x1080px) Image search: [Google]
shift.mp4.webm
974KB, 1920x1080px
So here is my problem guys:

I have a raspberry pi displaying a countdown on a 7-segment-display, which can be easily made with C or python.
But now I want to control that countdown aka set, reset and watch the current time through a web interface. The key here would be the last one. It should either be """live""" through websockets or ajax on that website, because the person holding that smartphone needs to have that time on there.
How do I transfer the current time between webinterface and C programm? Do I just make a post request every second to update the time?

old webm kinda related
>>
Why do so many crapware websites use googleapi?

Fuck, I don't want Google to know that I went on pornhub.com. Whatever happened to discrepancy?
>>
Will include "Artisanal Rustacean" in my Tinder profile
>>
>>60777449
>transfer (data) into a file or document.
>including/importing allows you to use previously unavailable data

Same thing, different methods. My point still stands that C doesnt have something as basic as primitive type properties.
>>
>>60777457
How about just calling yourself a "programmer"?
Instead of "LOOK AT ME IM HIP PROGRAMMING LANGUAGE GUY".
>>
>>60777482
>Do I just make a post request every second to update the time?
sounds autistic.

use javascript to display the countdown timer and have it continually display updates to the user.

either have a listening socket that your timer streams to or have the server perform a single query to the timer every time a user accesses it and just script the countdown happening rather than streaming it. the user wont know the difference
>>
>>60777413

>defending C's lack of imports
>>
>>60777484
Adbux,thats literally it
>>
>>60777504
It's kinda gay, but it's no more gay than any other community nickname. Gentooman or Rustacean or Pythonista
People like making cute names for their group, it's not worth getting upset about
>>
>>60777480
Nope. Just another boring day.
>>
>>60777517
Thanks. That sounds like a pretty good approach. Don't even know why I didn't came up with such a simple way to do it kek.
>>
I can't believe we're still discussing fucking overflows several hours later. Rust shills truly are the worst.
>>
Why would Java just skip a line?
I have a problem with a method.
Everything is sound, but it skips the line where I assign a string by entering it.
>>
>>60777528
>Gentooman
thats always been an ironic shitpost though.
No one seriously calls themselves that except maybe try-hards on reddit
>>
File: MyPis-small.jpg (667KB, 4008x2254px) Image search: [Google]
MyPis-small.jpg
667KB, 4008x2254px
>>60777542
I got a bunch of pi's at home as well acting as various forms of servers
>>
>>60777478
> It doesn't make it safer.
No per se, not. But 1) overflow check in the debug builds 2) optional overflow checks in the release builds 3) checked_add, saturated_add, wrapping_add, overflowing_add in the standard library 4) signed overflow being well-defined, all these make integer overflow slightly less of a problem than in C.
>>
>>60777522
>arguing a straman
>>
>>60777544
You're gonna have to post some code before anyone's gonna help you

>>60777546
I didn't say it wasn't a tryhard thing, it's just something that shouldn't upset you anymore
>>
>>60777544

Show your fucking code
>>
>>60777546
I firmly push "code artisan" at work
people already started using it
>>
>>60777528
Exactly, only meme languages do this shit.
You don't see C programmers calling themselves Cee-Lions or whatever.
And if I didn't like arguing over pointless shit, I wouldn't be on /g/.
>>
>>60777544
>Java
Found you're problem m8
>>
>>60777553
>No per se
exactly, since c compilers offer all 1-4 for c as well.
>>
>>60777566
>You don't see C programmers calling themselves Cee-Lions or whatever.
No, we call ourselves hackers, as in using playful cleverness.
>>
static char[][] eingabe(char grid[][]){
System.out.println(" eingabe 1");
String p = In.readLine(); // Liest die Eingabe bsp : C5=8 This one is ignored
System.out.println(" Einagbe 2"); // wobei C die Zeile, 5 die Spalte, und 8 die Eingabe sein

//char zeile = p.charAt(0); //C soll zun int
//char spalte = p.charAt(1); //5 soll zu int
//char eingabe = p.charAt(3); // soll ein char bleiben

int a = 3; //(zeile-65); //unicode
int b = 3; //(spalte-49);

System.out.println(" test 3");

grid[a][b] = '3';
SudokuWindow.display(grid);
System.out.println("Eingabe 4");
return grid;
}
>>
>>60777544
It tries to avoid stinky code. Try writing better code
>>
>>60777566
>You don't see C programmers calling themselves Cee-Lions or whatever.
C programmers have their own group identity though. They don't take part in nicknamification, but C zealots can be pretty obnoxious
>And if I didn't like arguing over pointless shit, I wouldn't be on /g/.
Same my dude
>>
>>60777566
C-unts
>>
>>60777603
That nickname is only used by jealous non-C programmers.
>>
>>60777594
I'm assuming In is a scanner? Are you sure the scanner's reading anything at all? Did you set it up correctly?
>>
>>60777594
Kommentare immer in Englisch!
>>
>>60777603
>C-unts
>not C-men
>>
>>60777666
Fuck you, German Satan
>>
>>60777584
I don't get it, why do you post blatant lies? There are nothing analogous to 3) in the C standard library, and you can't get 4) because the C standard explicitly leaves signed overflow as undefined, and this means on some platforms like MIPS it may result in a signal, something Rust guarantees you won't get.
>>
>>60777676
>semen
Nice one.
>>
>>60777683
I said c compilers, which all offer functions checking for overflow. As for MIPS, it'll just use the unsigned version of the instruction, which is identical internally, but doesn't raise the interrupt.
>>
>>60777594
Wtf does it skip???
>>
Hey /dpt/ I'm trying to make my own doom engine for fun but I'm having trouble understanding binary space partioning. Would any of you mind explaning how it works?
>>
>>60777803
https://en.wikipedia.org/wiki/Binary_space_partitioning
>>
>>60777765
a line
>>
>>60777727
>I trust my compiler to produce the UB I actually need
Wait, so are semen actually use code with UB in production?
Also, are we comparing C language to Rust language or gcc to rustc? Because I'm pretty sure MSVC or ICC have a pretty different integer overflows stories.
>>
>>60777594
unicode != ASCII, du behinderter Hurensohn. Geh' dich erhängen, du widerliches Stück Scheiße.
>>
constexpr auto length = foo;
constexpr auto subLength = bar;

static_assert(subLength < length, "");


is it a bad practice to use an empty string in this case, even though the reasoning behind the assertion is obvious? i guess in this case you can explain why subLength == length isn't allowed, but yeah?
>>
>>60777886
The definition of overflow is not the issue and never was, is the point. The rust compiler will simply be forced to use unsigned instructions on every implementation it's on. There is no difference here.
>>
>>60777930
Isn't the string optional.
>>
>>60777951
>warning: static_assert with no message is a C++1z extension [-Wc++1z-extensions]
i'm using C++11, is it included in C++14 or C++17?
>>
>>60777970
C++17

http://en.cppreference.com/w/cpp/language/static_assert
>>
File: bjarne2.jpg (25KB, 293x324px) Image search: [Google]
bjarne2.jpg
25KB, 293x324px
>>60777970
>>60777982
>C++
>>
>>60778001
This smug face screams "I did it for you all"
>>
>>60778001
Thank you OLAS based Bjarne
>>
>>60778001
Why doesn't he pull a Musk and get his hair back? Surely he gets enough money to fund the surgery or whatever's required.
>>
>>60778051
he's on the HNL, he doesn't need to worry about his appearance
>>
>>60778051
Balding is a sign of masculinity.
>>
File: Capture.png (51KB, 915x365px) Image search: [Google]
Capture.png
51KB, 915x365px
C++ is the language of the future
>>
File: simply-ebin.MOV.webm (609KB, 1280x720px) Image search: [Google]
simply-ebin.MOV.webm
609KB, 1280x720px
WOW AMAZING

t. ahmed
>>
File: boom.png (73KB, 915x365px) Image search: [Google]
boom.png
73KB, 915x365px
>>60778343
>>
>>60778343
what programming language would you use for cross platform (mobile included!) development?
>>
>>60778366
for some reason this made me hungry
thanks anon
>>
>>60778393
C++ with a minimal amount of java code for android and with minimal objective-C/-C++ (basically C/C++ with applel extensions) for iOS
>>
>>60778393
C is the only choice, though.
>>
>>60776304
No I wouldn't say so. BBT is straight up offensive to any form of intelligent person and especially autistic or people with social disorders. XKCD is 'nerd' references. It's what I expected BBT to be.

If you're a stupid nerd you could like XKCD.
>>
>>60778343
Why is C declining so much?
>>
>>60776883
>The result should be zero.
That's a strange way of saying infinity.

1/x -> inf as x -> 0
>>
>>60778473
+0*
>>
>>60776883
http://www.wolframalpha.com/input/?i=sin(x)%2Fx
>>
Why is PHP such a shitty language? I've asked multiple people if they could figure out what was worng.
>>
>>60778518
PHP was designed by a person who didn't understand how people could enjoy programming
>>
Why is Ruby such a based language? So fun and comfy to program in ^.^
>>
>>60778518
in_array is for array items not hashmap keys.
>>
>>60778569
because you are a girl
>>
>>60778393
C
>>
>>60778569
>>60778589
*girl (male)
>>
I don't fucking understand, what am I doing wrong?
>QBWRPT32.dll is copied into the project directory, as well as in project/bin/Debug/ and project/obj/Debug
>Target is x86 CPU because it's all 32-bit
>Same error every fucking time
>Google searching is just pages and pages of people not compiling properly for release
Send help
>>
>>60776991
(define div
(lambda (x y)
(if (= y 0) #f
(/ x y))))
>>
>>60778455
It's genuinely a measurement issue if you're aiming to measure use.
They're measuring mentions essentially.
On the employer front C is approximately the same.

I think it's that programmers have moved from just focusing on their professional language to having hobby languages. The growth of many minor languages seems indicative of this.
spectrum.ieee.org/computing/software/the-2016-top-programming-languages.html
The details of this is more important than the general picture.
>>
File: ruby-human.png (186KB, 362x560px) Image search: [Google]
ruby-human.png
186KB, 362x560px
>>60778569
Ruby is my waifu
>>
File: 1496765895748.jpg (48KB, 800x800px) Image search: [Google]
1496765895748.jpg
48KB, 800x800px
>>60778601
>>
>>60778393
C and some Java to make your NDK work on Android.
>>
>>60778632
there's a tripfag immitating your waifu
>>
>>60777052
>stupid ppl can kill with cars, so they shouldn't be allowed
>>
>>60778571
thank man, it should be array_key_exists. I guess a key/value pair is different than just a value.
>>
What the fuck is wrong with GDB? Who wrote this piece of shit? This has to be the worst interface I've used in my life. Splitting tiles with random fucking ascii characters? inability to do a vertical split? Windows writing into other Windows and fucking everything up? This isn't even acceptable because "it's old." This is bad for any time period.
>>
>>60778455
TIOBE has always had shitty rankings.
>>
File: dlls.png (36KB, 1180x493px) Image search: [Google]
dlls.png
36KB, 1180x493px
>>60778603
Realized I didn't upload the pic
>>
I'm about to take my C# / ADO final.

Scared
>>
>>60777024
operator overloading doesn't belong in a high-level language, and is not strictly necessary in a low-level language.
>>
How can I directly append to a list using Control.Lens?

Lets say I have this code
data Game = Game {
_bets :: [Int]
}

makeLenses ''Game

someFunc game = game & bets .~ newBets
where newBets = game^.bets ++ [1]


What I want to do is just directly append 1 to bets. It seems like I could do this using snoc/ |> but I must be doing it wrong, this doesn't work:

someFunc game = game & bets |> 1
>>
File: valid haskell code.png (1KB, 304x25px) Image search: [Google]
valid haskell code.png
1KB, 304x25px
>this is valid haskell code
>>
every time I deal with imagemagick feels like it's the first time

>"BRAIN WILL YOU PLEASE REMEMBER BASIC SHIT"

causes literal pain in me ass
>>
>>60778757
I'd be okay with operator overloading if it was more explicit, so you'd always have to do something like:
import *, +, -, / from LIB // local to file/class/compile unit
>>
>>60778763
that is the worst syntax I have seen and I have seen some ATS code.
>>
>>60778785
>ImageMagick is a free and open-source
there's your problem
>>
>>60777052
stupid people can write really really bad code quite happily without operator overloading and most people who choose to be java programmers are stupid people
>>
>>60778763
>your language is so broken you have to use third-party library to access structure fields
This is just sad.
>>
>>60775927
If all the sheep were jumping back the fence the counter wouldn't have went from 32767 to -32768 it would have went 32767 to 32766, 32765 [..] -32768

the person counting (which is the cpu/alu) wouldnt notice it
so just remove the third panel and its kinda accurate, though unlike B^U it stops having a punch line
>>
>>60778763
what the fuck is this mess
>>
>>60778763
>doesn't work
Doesn't typecheck or doesn't yield the expected result? Imma help you. I'm versed in Lenses but it'd been a while and I don't have a haskell repl handy.
>>
>>60778763
that's legitimately disgusting. i'm not even memeing
>>
>>60779069
And if you were memeing what would you post?
>>
>>60779029
Honestly go for
game & bets %~ (\ something something snoc)
otherwise you're repeating yourself way more than necessary.
>>
>>60779106
someFunc game = game & bets %~ (++[1])

Done ftfy (presumably)

Also what's the new fuzz with Seq? Redpill me on that. I'm old-school, back in the day we just had the cons list....
>>
i'm trying to paste an image to be half opacity, this is the code snippet
box = (125, 92, 376, 277)
mask = np.repeat(255//2, (376-125) * (277-92) *3).reshape(376-125, 277-92,3)
img2 = img.copy().paste(reg, box, mask)


this is the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/PIL/Image.py", line 1351, in paste
if mask:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()


would appreciate any help, everything online is people using preexisting images as masks. i want to be able to create one in the program without having to create an external file
>>
>>60779029
>>60779106
>>60779145
Was just about to post the code, but this works, thanks!
>>
>>60779161
Sure mask should be a numpy array?
>>
Good algorithm to know if a string belongs to a set of strings, which are known at compile time?
>>
>>60778723
GDB is a sound debugger, with a terrible interface. I don't really use it, I just use Valgrind, but I hear cgdb is a good graphical front-end for it.
>>
>>60779189
std::find
>>
File: 1488471286436.jpg (17KB, 354x256px) Image search: [Google]
1488471286436.jpg
17KB, 354x256px
>>60775927

Regarding the comic in the OP, I could've sworn that integer wrapping is only defined behavior for *unsigned* integer types, not signed ones as in the cartoon
>>
>>60779189
More or less arbitrary-length? Should it be general? Is it expected that most strings match or that most don't match?

I'd go for a static NFA I think. should be O(n) in time where n is the length of the candidate strings, and O(k) in memory where k is the size of the regex. The time can surely be short-circuited most of the time though...
>>
File: NASM.png (15KB, 1385x232px) Image search: [Google]
NASM.png
15KB, 1385x232px
I'm trying to compile this assembly code on Windows, what would be the Windows equivalent for "int 80h" in this context?
>>
>>60779243
inb4 >anon wtf is an NFA?
redpil --> https://swtch.com/~rsc/regexp/regexp1.html
>>
>>60779250
Wow shit m8 you're asking for some hard time rn. What platform did it run on originally?
>>
>>60779161
got it, it's
zos = np.array(np.repeat(0, (h*w*3)).reshape(h,w,3), dtype = np.uint8)
mask = pil.fromarray(zos, 'RGB')


if anyone else is wondering
>>
>>60779220
Depends on the representation but pretty much everything uses two's complement.
>>
>>60779181
it's not "supposed" to be but that's how i want to do it. it's generally supposed to be the same image, which has an alpha layer, to paste only the opaque parts
>>
>>60779250
Windows syscalls are not documented and are subject to change in updates (even minor ones).
The functions in kernel32.dll and ntdll.dll are the lowest levels of official access.
So the equivalent for that whole code would be calling ReadFile with stdin which you can get a handle to with GetStdHandle(STD_INPUT_HANDLE)
>>
>>60779307
til ty
>>
>>60779243
Not him but what's a good way to implement a static DFA without a mess of IFs or wasting cycles?
>>
>>60779220
wrapping like that almost always happens in practice and in some languages like java it's the defined behavior
>>
>>60779324
reify it into an array of nodes no?
>>
>>60779243
Basically recognizing if a string is an identifier or a keyword.
>>
>>60779189
If all strings are known at compile time just forget the strings use some integer representation (i.e hash), if you can make it perfectly sequential from 0 to n then make an array of the strings and the index is the hash to lookup the string.
Use some code generation/script to generate all this if there's lots of strings, otherwise just do it manually.
>>
>>60779399
I was thinking about hash, but it a string collides it's useless.
>>
Function pointers are pretty cool. Even though it's really basic, I just wrote an error reporting function that takes a message from me about what I think the error is, as well as a function pointer that points to whatever library specific error reporting function is appropriate.
Nothing comfier than handling your errors in a nice, informative, and sleek way.
>>
>>60779431
There are pretty comfy amortized hash table lookup schemes tho, buckets are gay in 2017AD.
>>
>>60779345
How? Encode current input and node as some index and have the array value point at the next node?
>>
>>60779538
*next nodes, it's an NFA. Why not? If it's an array, we don't need low-level pointers tho, they can be 2 bytes array indices. Or maybe you can make some shit up with bitmasks idk.

Also is the alphabet 7-bit ASCII or the whole of Unicode?
>>
>>60779275
Linux (x86) , obviously

>>60779307

I'm compiling it on SASM, which has its own I/O library of commands, I may as well just figure out how to use them
>>
>>60779605
Unicode but I'd parse any character without special meaning as a "something else character" anyway.
>>
>>60779456
Wait until you discover FP.
>>
I want to contribute to (at least) PS3 emulation progress.
I know I can do bug reports and such, but what would be needed in regards to programming?
>>
>>60779966
This is a stupid question to ask here
>>
>>60779965
I should do that. I'd love to have a year long affair with Haskell, but there are so many other things that I want to focus on right now.
It must be common for programmers to get distracted by all the interesting things they can learn.
>>
File: image_480.png (23KB, 480x306px) Image search: [Google]
image_480.png
23KB, 480x306px
Quick application to calculate transformer vector groups
>>
>>60780306
>It must be common for programmers to get distracted by all the interesting things they can learn.
It's a serious problem
>>
>>60776862
R is comfiest tier, good choice anon
>>
>>60779456
if you think that's cool, wait until you discover the wonders of OOP
>>
>>60776865
That's a boy!
[spoiler]also cute
>>
>>60776259
>You can fake dependent types in Haskell with DataKinds and a few other extensions.
No you can't.

>But, are there any languages with proper dependent types that perform well?
ATS
F*
>>
>>60779324
Code generation.
>>
>>60778757
You'd better not ever use the same field/method name in different types then because it's the same thing.
>>
>>60779256
Nondeterministic finite automaton
>>
>>60780867
(You)
>>
>>60780892
Not an argument.
>>
>>60780904
/care
>>
>>60780910
t. datafag
>>
>>60778393
literally javascript
>>
I love C++!
>>
>>60775927
Re implemented my filter tree lib from the other day to use function composition to describe the tree.

I think I like the look of it better.
https://pastebin.com/rP7sydEe
>>
>>60778393
>All of these people saying C
How would you do even simple stuff, like creating a new folder?
>>
>>60781204
Trolling too hard anon.
>>
>>60781204
mkdir
>>
>>60781204
This is platform specific.
Use your platform's specific headers to interact with your filesystem.
>>
>>60781269
I no rite, but thass wierd:
>fopen, remove, opendir, scandir
Fine with C89
>mkdir
NO WAI
>>
>>60781305
those are all abstractions for your filesystem.
Your C program may be running under a system that doesn't even have a filesystem driver installed.
>>
>>60781330
Then none of the aforementionned should be operative, but that doesn't mean they shouldn't be in the standard should it? Why are there functions in the standard library to search and delete directories, but not to create them?
>>
>>60775927
Spent most of the day trying to understand an algorithm implementation.
>>
Is there no "remove at index" function for F# datatypes or am I retarded
>>
>>60781374
because Cfags never create anything useful
>>
>>60781383
>F#
Nah, that programming language sucks. you want to program with A-flat. its basically the same prog language.
>>
>>60781383
>>60781402
Congrats your both retardeds.
>>
>>60781223
Not platform independent in Windows

>>60781269
Look at the question. That's the point
>what programming language would you use for cross platform (mobile included!) development?
C is terrible for cross platform support
>>
>>60781451
>C is terrible for cross platform support
100% true.

>>60778414
>>60778448
>>60778591
C is a shit choice for this unless if you want to precompile dozens of slightly different programs for use on various OS's and architectures.

A much better choice would be to use java (or possibly javascript if this is web based)
>>
>>60781451
>mobile included
Google did its best to prevent that. They coudl have used the standard API of the JVM but no they provide a custom and stupid API (it's made by google).
>>
>>60781451
>>60781485
>C is terrible for cross platform support
fucking faggots, android and iOS are linux/unix based, and you can compile for windows using linux/posix stuff too, javascript is fucking terrible, a web page packaged as an "app" barely even counts as a program and doesn't fit many use cases, kill yourselves and fuck off to >>>/g/wdg
>>
>>60781485
>C is a shit choice for this unless if you want to precompile dozens of slightly different programs for use on various OS's and architectures.
Share the source code.

>A much better choice would be to use java (or possibly javascript if this is web based)
The worst is that this is actually true. factoring out everything into an interpreter makes for very concise and portable programs. (Altho java a-shit)
>>
>>60781543
kill yourself
>>
My ideal programming language is a type theory that is a specification of an abstract machine.
>>
C# is the cross-platform language of the future.
>>
>can do whatever the fuck you want with types
>have to specifically convert types with str() cuz it's too fucking retarded to auto overload string concatenation

why the fuck is python so popular?
>>
>>60781566
t. delusional microshart
>>
There's a reason everything is written as a node.js app these days.
Just maintain 1 codebase, and you can make a desktop app, a webapp, and a phone app for every platform.
>>
>>60781578
t. assblasted freetard
>>
>>60781577
>>can do whatever the fuck you want with types
>>have to specifically convert types with str() cuz it's too fucking retarded to auto overload string concatenation
That's javascript you're describing retard
>>
>>60781580
define 'everything'
>>
>>60781580
weak bait
>>
>>60781585
in python print("banana" + 12) will not work. But it will in jewvascript
>>
>>60781542
>javascript is solely for /wdg/
WRONG
>>
>>60781591
define go fuck yourself dumb fucking shitstain wanking wankjet wanker cumsock
>>
>>60781542
ok n00b-kun, have fun compiling your sources for Android, linux, Windows, and Apple OS's and make sure for each OS you have a seperate binary for the architectures: amd64, armel, armhf, i386, ia64, kfreebsd-amd64, kfreebsd-i386, mips, mipsel, powerpc, s390, s390x, sparc, x86_64..

so what are you at now, 56 different compiled binaries for your 'cross-platform support'?

have fun with that, ill just use something like java if i want cross-platform support
>>
>>60781621
>you're not a literal cocksucking san francisco bay area faggot
WRONG
>>
>>60781566
HAH!
>>
>>60781632
>wtf are distros
>wtf is user freedom
>what do you mean by "fuck off with your proprietary malware" anon?
>why do you reject me? I'm your friend!
>t. google
>>
>>60781632
>he's not trolling
>he sincerely thinks he's describing a real issue
sure is summer in here
>>
>>60781632
Or you could distribute as source.
>>
>>60781662
yes, i cant argue this.

you can always just distribute source code if you want cross-platform support
>>
New thread: >>60781679
>>
>>60775978
Sadly, Terry could've become like Gates or Jobs if it wasn't for his condition
>>
>>60781703
Why would he want to be an MIT nigger?
>>
>>60781877
>nigger
>>>/voat/
>>
>>60781998
>implying terry davis is not /g/
>>
>>60775927
Was this comic ever funny? Seems all it ever does is rehash "jokes" from the authors of programming books and push left wing propaganda.
>>
File: primates-synopsis.jpg (150KB, 1200x766px) Image search: [Google]
primates-synopsis.jpg
150KB, 1200x766px
>>60775927
I'm applying for junior dev position, and I need to write a cover letter. I have no formal education in programming, and only couple of months of learning to program. How can I write a good cover letter?
Thread posts: 327
Thread images: 26


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