[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Home]
Board
Settings Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: 1551829831252.jpg (166 KB, 1280x720)
166 KB
166 KB JPG
What are you working on, /g/?

Last thread: >>70156305
>>
File: 1470844793325.jpg (54 KB, 500x375)
54 KB
54 KB JPG
First for C
>>
Second for C++
>>
File: risitas.png (71 KB, 272x204)
71 KB
71 KB PNG
>>70165274
>2019
>still advocating C
>>
File: 1518717011958.jpg (1.17 MB, 3500x1970)
1.17 MB
1.17 MB JPG
Fourth for Forth
>>
programming socks!
>>
>Global variables are bad!

Why were my CS course so obsessed with this one? Wow, I sure love 10 long parameter lists
>>
>>70165441
Use goto also. You will totally piss them off
>>
File: go to auschwitz.jpg (28 KB, 480x476)
28 KB
28 KB JPG
>>70165424
>>
>>70165441
refactor you nigger
use structures
>>
>>70165452
So keep passing a reference to a highly specialized struct like some std, in the wild case I'll have to remodulise my function in a completely different program where it wouldn't even make sense?
>>
>>70165441
>Why were my CS course so obsessed with this one?
Because your function might return nonsense, if it reads that variable, but it is changed somewhere else, and it might be difficult to determine when or why this change happens during execution. It's best to use only constants as globals.
>>
>>70165441
because no one wants to read your spaghetti code.
>>
>>70165441
it makes your code hard to read because the behaviour of the methods that use those variables becomes unpredictable

pure functions with immutable arguments is the way to go, as long you call them with a certain input, they will always return the same output, their behaviour won't be affected by external state and they won't affect any external state, this has the added benefit of being able to parallelise the code, since there will be no shared variables you don't have to worry about race conditions
>>
>>70165441
Because programming newbies often abuse them, same with goto. They have their uses when you know what you're doing, but until then they'll do more harm than good.
>>
Why is writing C++ classes so obnoxious? It takes so much effort to add a method or change its signature because you have to keep track of it in two separate files on two separate places that I often don't even want to bother. Languages like Java or C# are so much more comfortable to program in for this reason alone. Hell, I'd rather use C where I can just keep most of the functions to myself in the source file and only export those that I want to expose in the header file.
>>
>>70165574
IDEs take care of that
>>
>>70165447
My first CS professor had an unbelievable hatred for goto. His policy was he mark any assignment turned a 0 if it had any goto on it which was amusing because it was the first cs class most of us had taken so none of us had any fucking idea what goto was.
>>
File: hitler.jpg (541 KB, 1646x908)
541 KB
541 KB JPG
am I good enough to be hired as a junior dev if I'm able to make non-trivial contributions to open source????????????
>>
>>70165799
I would say so, sure.
>>
am I good enough to kill myself if I have no friends nor any decent skill at writing software at 24????????
>>
>>70165825

most definitely
>>
>>70165441
learn to use context structs (even though in practice they're just shitty versions of closures)
>>
>>70165574
Meh, fucking multiple translationunits.
If your projects are on the order of 1k - tens of K lines of code just use a unity build, but all code in the header file (i.e inline class methods), and include them all in single .cpp files that gets compiled.
>>
>>70165574
Modules will fix this.
>>
Why does bitwise operation and flagging of enums in C# have to be so... half assed by the .net team
>>
>>70165982
>she still think she is getting decent modules
>>
Hi, I'm a huge brainlet beginner in programming
Using CGI, I want to make a website where there is just a textbox where I can enter some input and depending on that input print some ouptut
To be more specific, I'm trying to make a dialogue program where my algorithm responds depending on the given answer
I already wrote the code in python, I just need to implement it on a website but I don't know how
>>
I just found a company with its entire backend in haskell, and it has nothing to do with the blockchain!!!
>>
>>70166189
banking?
>>
File: file.png (31 KB, 1553x912)
31 KB
31 KB PNG
I was whining here about opengl yesterday and I finally managed to get it to werk
>>70159057

actually it were 2 really small mistakes that fucked everything up as >>70159131 said

I set the w value of the position vec4 in the vertex shader to 0 instead of 1.
and in

glBufferData(GL_ARRAY_BUFFER, SIZE, GL_STATIC_DRAW);


I used sizeof on a pointer array to get the SIZE of the array and didnt realise how dumb that was. in every tutorial everyone just uses arrays on the stack and thus this works obviously.

well now it works as it should.
>>
>>70166144
Why CGI? Just wrap your Python script in Flask.
>>
I’m stressed out and want to refresh my interest in programming with a very new thing. Should I try to learn something like Lisp or Haskell? Forth? What’s something very new and interesting? I want to look at programming from a new perspective and learn new things
>>
I'm working on a scraping application to do searches on sites like boorus, pull down all the relevant images, get the tags, translate the tags through a user-provided dictionary if needed, then store and tag the images with tmsu.

Currently the only scraping adapter I've got working is gelbooru but it's pretty comfy. Tmsu is comfy.
>>
>>70166234

haskell is boring as shit
>>
>>70166208
It's actually a school project and I MIST use CGI
>>
>>70166234
Haskell
>>
>>70166205
not gonna tell you, it's my little faerie.
>>
>>70166234
>Lisp or Haskell? Forth?
>What’s something very new
>>
>>70166361
New as in new knowledge to me. I don’t care how recently they were created.
>>
>>70166361
new to him
>>
>The most basic advice is to keep a function of a size so that you can look at it in total on a
screen. Bugs tend to creep in when we can view only part of an algorithm at a time. For many programmers that puts a limit of about 40 lines on a function. My ideal is a much smaller size still,
maybe an average of 7 lines.

Do you agree?
>>
>>70166504
sure but making your functions small won't automatically make them good, but easy to read functions are usually small
>>
>>70166206
welcome to opengl development
trying to figure out where you've fucked up is really irritating
vulkan's a lot better, there's all sorts of debugging utilities
>>
>>70166504
I generally disagree with using functions unless you actually need to reuse or encapsulate the code. Unnecessary functions themselves make the code hard to follow.
>>
>>70166697
Functions are great. They delimit blocks of code with semantic information.
>>
>>70166716
So do comments. Unless you actually have to reuse the block of code or encapsulate it e.g. for a callback, then moving a block of code out into a function just means I have to jump around the file to understand the code and adds unnecessary execution overhead however small that might be. It's an antipattern imo
>>
>>70166716
well put
>>
I was thinking of trying to rewrite a program written in C++ in C# just because I feel like it, with the justification being that it would be more "portable". But if I want it to be more "portable", then surely Java would be the better option? It might also be nice to learn Java anyway, so that I have the option of becoming a Java codemonkey if I really need it. I've heard that Java is absolute dogshit compared to C# though, so how fucked would I be?
>>
>>70166741
>So do comments.
Functions are better at it due to explicit parameters.
>moving a block of code out into a function just means I have to jump around the file
Nested functions exist.
> adds unnecessary execution overhead however small that might be.
Private and nested functions are trivial to inline.
>>
for (uint32_t b = 0; b < 1; ++b) { }

Uhm?
>>
>>70166799
Nested functions don't solve either of those problems though. Mitigate, maybe. But you're still complicating things for little to no benefit.
>>
Working on changing my Authentication with Google OAuth and learning there is no way to ask the user to verify their account. Going to have to impliment some sort of login code system now...
>>
>>70166819
what about it?
>>
>>70166841
Doesn't this only execute once? I'm confused about why this exists
>>
>>70166826
But... they do. Nested functions are by definition defined in the scope of the outer function, which means they're close to the use site. And nested functions that do not escape the outer function are extremely easy to inline, which means there will be no function call overhead.
>>
>>70166795
C# using .NET Core
>>
>>70166863
yeah. I'm guessing someone changed the loop bound in a hurry or something and didn't notice
>>
>>70166795
What is the program? You can still use C# on windows, linux, mac and mobile. Also, Java is not entirely bad but the JCL and most libraries have shit design.
>>
>>70166897
Alright I wasn't sure whether I was just being dumb
>>
>>70166795
java has lots of jobs and it's not bad compared to c#

as a language c# is probably better but last time i did c# the ecosystem was way less mature than java's and writing something useful was very quick and easy
>>
Working on userspace TCP/IP support for my operating system.

Someone in the previous thread said it would be cool if I could get Lynx working, so I spent some time on that and got it working well enough to browse /g/ :)
>>
>>70166934
Any reason you skip argument names in the header for some arguments? Like in _receive and _send functions? Anyway, keep doing what you're doing, your work is impressive.
>>
>>70166934
have you thought about streaming your development on twitch or something
>>
>>70166987
It's a habit I picked up from WebKit:
>Leave meaningless variable names out of function declarations. A good rule of thumb is if the parameter type name contains the parameter name (without trailing numbers or pluralization), then the parameter name isn’t needed. Usually, there should be a parameter name for bools, strings, and numerical types.

I also do it for situations where it's clear from context what something is, e.g a buffer+size pair passed as (void*, size_t)

>>70167006
That might be fun. Unfortunately I have a sucky connection (I'm in a cottage with nothing but 3G)
>>
>>70166934
>>70167090
how come protocol_receive gets two buffers? also what's that int in protocol_send?
liking the NetworkOrdered<T> btw
>>
>>70167142
I guess that's a bit murky. One buffer is const (input), while the other is mutable (output). I strive to keep my programs const-correct in order to make little things like this nice and unambigious :)

The int in protocol_send is the buffer size for the const void*. I'm trying to convince myself to switch to using int instead of size_t for sizes everywhere in the kernel. The reasoning being that it would be easier to check for negative values on syscall entry than to check for unsigned overflow eeeeeverywhere. But some part of me is not convinced yet so I keep writing inconsistent code like this..

And yeah I made myself a NetworkOrdered<T> template after forgetting to call ntohs() for the nth time. Stupid network order.
>>
>>70167209
maybe I'm being stupid here, but why does receive need an input buffer?
>>
>>70167289
Nothing stupid about asking questions.

All the protocol_* virtual functions here are overrides from the IPv4Socket superclass. I try to do most of the work in there, and then delegate the protocol-specific bits to TCPSocket, UDPSocket or SomeOtherNotYetImplementedSocket.

All the buffering happens in IPv4Socket, so when you read from the socket, it take a received packet (a raw IPv4 datagram) from the receive queue and passes it verbatim to TCPSocket::protocol_receive(), which then extracts the TCP payload from the raw packet and copies the relevant bits into the user-provided buffer.)

I'm not sure this is a good design, it just sort of grew into this organically :)
>>
File: JVM Languages.png (3.62 MB, 768x4245)
3.62 MB
3.62 MB PNG
>>70166795
Depending on your use case, the JVM may offer a better language than Java. Pic related.
>>
File: 1550685744849.jpg (109 KB, 729x729)
109 KB
109 KB JPG
how do I bind multiple textures to sampler2D array in the fragment shader?

I read I should do it something like this:

render call:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex0);

glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, tex1);

glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, tex2);

etc.

const GLint samplers[n]{ 0, 1, 2, ... ,n };
glUniform1iv(samplerUniformLocation, 9, samplers);


and my uniform in the fragment shader:
uniform sampler2D tex[2];


but the glUniform1iv doesnt work and only 1 texture works.
>>
>>70167352
yeah that makes sense
>>
>>70165441
It's the same reason why English teachers say you shouldn't start a sentence with "because". Because newer programmers don't know when to declare global variables, they often end up declaring them unnecessarily.
>>
I need a basic Python GUI framework that I can use to shit out a couple quick tools in a day without having to spend days/weeks learning the framework itself. Any suggestions?
>>
When should I call myself Senior C++ dev?
>>
How would I make a game in haskell?
My game state would be a StateT?
>>
>>70167609
>how would i make a game
depends on the game
>>
Why won’t Java compile my script?
alert(“hello world!”)
>>
>>70167618
Let's take something simple such as tetris
>>
cout << '\a';
>>
>>70167668
here are some terminal examples
https://github.com/samtay/tetris
https://github.com/hauxir/haskell-tetris
>>
>>70167560
tomorrow
>>
I don't even like programming, I only pretend to on the internet to fight the patriarchy's misogynistic belief that girls don't like programming
>>
>>70167433
The way I did is I create multiple uniforms for the textures, like tex0, tex1, tex3 then I just use this in the shader:
uniform sampler2D u_Tex0;
uniform sampler2D u_Tex1;
uniform sampler2D u_Tex2;
>>
always be doing something new
>>
>>70165401
satania shit
now THIS is a based devil
>>
>>70165424
Hell Na fucking dick sucker
>>
File: 1520274351963.jpg (95 KB, 613x703)
95 KB
95 KB JPG
>>70167985
>>
>>70165481
>t. brainlet
>>
>>70167538
tkinter's pretty good
>>
File: 1521670223899.jpg (26 KB, 400x400)
26 KB
26 KB JPG
>>70167948
it actually works with
uniform sampler2D tex[9];


the name of the uniform at index i is "tex[i]"

but as always my problem is something completely different
>>
if __name__ ==  '__main__':


Somebody actually sat down to design a language and thought to themselves, yeah, this is an elegant way to specify the entry point into a script.
>>
Is the 'n' in "fn" the first or second 'n' in the word "function"
>>
>>70168168
Neither, it's short for "fuck n*ggers". White privilege strikes again.
>>
>>70168153
linear types could have prevented this
>>70168168
the first, e.g. fun
>>
>>70168153
It's not the entry point. The entry point is the first line. In fact, you will never truly need that construct. It is useful, when you have multiple files with "main"-functions, and you want to execute that function only if you run specifically that file. If you only have one main function in your files, that construct is pretty much completely irrelevant.
>>
>>70168153
>>70168213
This. All that conditional does is allow you to change what code executed if your script is being executed as a module vs being executed on it's own. In either cause it's never the entry point.
>>
>>70167560
When you're the guy everyone goes to for answers.
>>
>>70168243
what if I'm self employed?
>>
>>70168213
The script is immediately executed top to bottom, yes, but it's the entry point because no non-trivial script is just going to throw everything in top level like that, especially if you might ever consider importing said script in another script in the future and you don't want the entire thing to immediately execute.
>>
>>70168272
>execute

You're not allowed to use that word anymore, it's a fascist dog whistle
>>
>>70168272
You're retarded, we get it, but it's not an argument against Python. If you want only one main function across your files, add "main()" to the end of that file.
>>
which one is going to be called? why doesn't it throw an error?
def foo(a,b): return a+b
def foo(a,b): return a+b+b+b
def foo(a,b): return a+b+a+a
def foo(a,b): return a+b+a+b

if __name__ == '__main__':
print (foo(8,8))
>>
>>70168386
The last one, because it overwrites the previous ones.
>>
>>70168404
Why doesn't this code throw an error?
the functions have the same signature
>>
>>70168424
x = a
x = b
"why doesn't this throw an error"
>>
>>70168424
Because python decided that masking previous functions is how the language should work? Fuck do you mean "why"
>>
>>70168424
should
a = 1
a = 2

throw an error?
what about
foo = lambda a,b: a+a
foo = lambda a,b: a+b

>>
>>70168433
>>70168440
>>70168444
int foo(int a) {return 2*a;}
int foo(int a) {return a;}
int main() {
return 0;
}

a.c:2:5: error: redefinition of 'foo'
int foo(int a) {return a;}
^
a.c:1:5: note: previous definition of 'foo' was here
int foo(int a) {return 2*a;}


You can do this in Java btw
>>
>python
>>
>>70168460
This might be wild for you, but different languages are different.
>>
File: surprised_pika.png (339 KB, 960x830)
339 KB
339 KB PNG
>>70168483
>>
>>70168483
Unifying all languages into one when?
>>
A little toy language I wrote for a very niche application at my lab treats all variables as sets with single variables existing only as sets of size 1. All I do is shuffle sets around with single variables being a rare and exotic edge case.

Is there a name for this pattern? (other than "dumb")
>>
After using C++ for a long while and then switching to Java, it's so weird to get used to a garbage collector, it's sort of liberating

Every time I make put some "new" in a for loop I think to myself "That's right, clean it up wagie"
Am I autistic?
>>
>>70168786
Yes
>>
>>70168786
maybe but it's good to exercise your power
>>
File: register issue.png (40 KB, 800x744)
40 KB
40 KB PNG
hey, maybe this should be in the stupid questions thread, but are there any VHDL boys here that can help me solve a loop lock in my register design? I'm making a memory array in RTL logic, so I can't use behavioral assignments. I tried to have a MUX implement the Load Enable switch for the register, and wired in the previous output to the input to keep the same value as before. I'd imagine the loop is from the fact that it can't process the logic within one clock cycle, as it's technically recursively infinite. I'm too smoothbrained at the moment, does someone know how I can implement a load enable in another way?
>>
>>70168829
sorry, the only language people in these threads know is python
>>
>>70165424
nice belly, fatass
>>
>>70168838
ah, shit. Anyways I already changed my zero vector to a constant since there's no need for it to be a signal, and I'm going to see if placing the MUX block outside the entity in a top level file helps the Synthesis tool figure things out
>>
>>70168460
yeah Java is really amazing in that regard for example this is not allowed:
List<String> foo (List<String> b) { return null; }
List<Integer> foo (List<Integer> b) { return null; }
>>
>>70168900
method overloading is considered harmful
>>
>>70168913
everything removed when?
>>
>>70167512
>shouldn't start a sentence with "because".
>starts next sentence with "Because"
>>
>>70168856
yep, taking it out of the entity fixed it, I suspect the clock cycle process for individual blocks in ModelSim is a bit glitchy, I guess I'll just go with separate entities for now.
>>
What IDE do you recommend for programming in C?
>>
>>70168986
I just use vim/gcc
>>
>>70168986
Mousepad
>>
>>70168900
You also can't set default values for parameters

Enjoy writing 2^n different constructors or using Builder Method™ Coding Pattern©
>>
>>70168986
Codeblocks
>>
>>70168986
I use notepad
>>
>>70169011
abusing positional parameters like that is asking for trouble
what you really want are named parameters, or at least a struct with designated intializers
>>
I've literally never written a do while loop AMA
>>
File: loli shark.png (63 KB, 358x414)
63 KB
63 KB PNG
>>70165249

in software, (my question is more Go specific) it's common to have a global variable of type `log.Logger` and use its methods to log shit out, but you also have to protect it by using mutex. whereas from go docs, log package is thread-safe, why wouldn't I use just log.functions without the need to worry about mutexes instead? why do people tend to have an instance of the logger?
>>
>>70165424
Hey traps of /dpt/, how do I shave my asshole?
I am sick and tired of shit drying up on my butthair and not being able to get it off. Even worse when it makes my cheeks stick together, and rips open when I sit down to take a dump
Thanks
>>
>>70169108
How is being a Haskell dev?
>>
i have to use sqlite for my project.
i have millions of entries that specify ranges

that table looks like:
id     start_coordinate      end_coordinate


i have thousands of ranges
start - end
that i want to find the next fitting rage, where start_coordinate is the next smallest number to the start in my query and end_cordinate is the next biggest number to the end of my query. none of my ranges in my DB are overlapping, so i can query the following:

SELECT start_coordinate, end_coordinate FROM my_table where start >= start_coordinate and end <= end_coordinate


now this is really slow and i dont know why.
i did the following index:
CREATE index idx_mytable on maytable(id, start_coordinate,end_coordinate) 


but this seems to be not efficient.

QUESTION:
how to create an efficient index?
CREATE index idx_mytable on maytable(start_coordinate,end_coordinate) 
or

CREATE index idx_mytable on maytable(start_coordinate) 

and
CREATE index idx_mytable on maytable(end_coordinate) 


OR something else?
>>
>>70169116
fuck off weeb
>>
I'm pretty new to PLSQL. I've made an associative array of records, and I want to output each column of the record within the array at a specific index. I defined the record and array types like this:

TYPE r_dependencies IS RECORD(name user_dependencies.name%TYPE, type user_dependencies.type%TYPE, referenced_name user_dependencies.referenced_name%TYPE, referenced_type user_dependencies.referenced_name%TYPE);


TYPE a_dependencies IS TABLE OF r_dependencies INDEX BY PLS_INTEGER;


I defined variables dependencies_array and dependencies_record of type a_dependencies and r_dependencies.

I'm fetching from the user_dependencies table into dependencies_record and adding each record to dependencies_array using a loop. Now, I want to output each column individually at a specific index using something like DBMS_OUTPUT. How do I access them?

I'm not allowed to do this any other way, I specifically have to use an associative array of records.
>>
>>70168926
It's because I used "Because" properly. Same with global variables, you can declare as many as you want as long as it's appropriate for said program.
>>
File: 1549821784980.jpg (88 KB, 500x500)
88 KB
88 KB JPG
>>70169188
weeb thread on a weeb website, you get out.
>>
File: whiteboard.jpg (74 KB, 1200x900)
74 KB
74 KB JPG
>*blocks your path*
Your move anon?
>>
wtf, is Go a giant meme? Hwy the FUCK do people use it unsarcastically?
>>
>>70169271
How would a whiteboard on a wall block my path. Did it fall off?
>>
>>70169271
literally start shaking
>>
>>70169288
golang is trash desu
>>
>>70169131
get a cheap electric trimmer (not the same one you use for your head/face) and get the hair real short
that should help hygeine and shit without having to shave it bare

if you want to be truly hairless you can try to be very careful with a razor or just use a chemical hair remover in the area
>>
What does a descrete fourier transformation look like in python? Tried to get some shit to work for 2 days now, but all it does is start and never finish
>im trying to use it on a image
np.array([[ sum(
[ sum([ X[i,j]*np.exp(-1j*2*np.pi*(k_m*i/m + k_n*j/n))
for i in range(m) ])
for j in range(n) ])
for k_n in range(n) ]
for k_m in range(m) ])
>>
>>70165574
seriously what fucking retarded language decision made it so private member functions that will only ever be used in one file have to be exposed in the header
>>
>>70169379
are you sure it doesn't finish? have you it tried on something like a 5x5 image?
>>
>>70169108
98% of the time you only want to do PART of a loop before the first conditional check anyways
it's better to have a separate little block handling the first element and then a regular while loop
>>
>>70169379
doesn't numpy have its own fft functions?
>>
>>70165424
cute socks but i need to know
do you program in Rust or in Haskell?
>>
>>70169379
def dft(x):
t = []
N = len(x)
for k in range(N):
a = 0
for n in range(N):
a += x[n]*cmath.exp(-2j*cmath.pi*k*n*(1/N))
t.append(a)
return t
>>
>>70169454
kys
>>
>>70169454
Only in C++
>>
>just about to start coding
>Loadshedding hits
Fuck off
>>
>>70169149
anyone?
>>
>>70169421
yeah, something is wrong. it just never finishes
>>70169444
it does, but this is school stuff, so gotta make my own
teacher just suck at explaining stuff
>>70169486
thanks
>>
I don't understand why people say to program to interfaces and not concrete classes. Is it just because the interface is less likely to be changed? this is a stupid question but /sqt/ didn't respond
>>
>>70169715
I think because the interfaces are universal, and also signal how they should behave to the user
They can have wildly different implementations, more than classes usually permit
>>
>>70164766
Just don't emulate the shitty C++ extensions.

>>70163929
>>M4 44.6%

GOOD NIGHT SWEET PRINCE
>>
File: file.png (23 KB, 630x252)
23 KB
23 KB PNG
>>70169695
>it just never finishes
are you sure?
>>
>>70169715
If all the components in your application interact in generic and well-defined ways, then it becomes easy to refactor that code and swap components out. You can change anything so long as the interface remains the same. It's also hard to create bugs between components because you have a clearly defined way in which your components interact.
>>
>>70169715
Another reason is that you can use mocking.
>>
>>70165976
Retarded.
>>
>>70166934
Absolutely based
>>
File: 1548456684474.jpg (20 KB, 540x540)
20 KB
20 KB JPG
how the fuck can such a loop on a std::vector go over the bounds? that shouldnt be possible right?
for (auto it = foo.begin(); it != foo.end(); ++it)
>>
>>70169948
it's possible if you're doing something inside the loop that can invalidate the iterator such as calling push or insert
>>
File: 1530052987988.jpg (77 KB, 480x602)
77 KB
77 KB JPG
>>70169968
shit. forgot to break after erasing
>>
>>70169948
>>70169984
Avatarfagging is only allowed if you post underage anime girls
>>
File: 1550355963049.jpg (69 KB, 1051x669)
69 KB
69 KB JPG
>>70170037
as you wish
>>
Anyone having an issue with SDL2 registers duplicate keydown events when using multi-head setup under Linux?
It generates 2 same keydown events whenever I press down a key instead of 1. It behaves correctly only if using single monitor.
>>
Brainlet here, I have a to-do list I keep on my desk to keep me more organized, but I'm trying to write a program that is essentially a digital to-do list
Being a new programmer, what's the best way to store user data for use later? Any resources I can look into? I tried googling this but I don't really know how to word my question to get good results because I guess I'm not sure what I'm looking for. Hopefully someone here understands.
>>
>>70170102
You want to google either data serialization or database
>>
>>70169331
You're trash fucking fag nigger
>>
>>70170102
Depends on how complex the data is and how exactly you want to access it, text, Json, XML, or other structures text, or SQL SQLite, nosql databases for more complex and nonlinear data. Id say go with SQLite for a to-do list, or if it's very simple and not a lot, Json.
>>
>>70165274
based
>>
>>70170102
>what's the best way to store user data for use later?
serialize it to the hard disk
the easiest option (which will work just fine for a lightweight to-do list) is to just save your data as a text file
>>
>>70170147
Yeah, I was already thinking this might be the best option, but should I do anything to the data before storing it, or should I literally just store a hard copy of the to-do list, character-by-character?
>>
So I have the following directory structure in Python:
project/
main.py
project/
__init__.py
world.py
something.py
objects/
__init__.py
item.py


In world.py I can do something like:
from project.something import Something


But I cannot do:
from project.objects import Item


What gives?
>>
>>70170329
from objects import item
>>
>>70170384
That just says the objects module doesn't exist, I'm pretty sure it has to be project.objects because I remember seeing it somewhere, it's to do with general structure but I'm not sure what's up.
>>
>>70170329
idk but in the first import statement you're importing something from inside the file, in the second you're trying to import the file

that wouldn't work unless you put something special in the __init__ right?
>>
Why do you format strings get pushed onto the stack and not a pointer to a format string? Trying to work out how the format string vulnerability works but don't understand how you can access elements of the string from the stack.
>>
>>70165274
She's exactly the type I'd expect to use C
>>
r8 my fizzbuzz
#include "stdio.h"

int main()
{
unsigned long bits = 0xC2182480;
unsigned char current;
int i = 0;
start:
switch(i){
case 101: goto end;
default:
current = bits >> 30;
switch(current)
{
case 1: printf("Buzz"); break;
case 2: printf("Fizz"); break;
case 3: printf("Fizzbuzz"); break;
default: printf("%d",i);
}
printf("\n");
bits = (bits << 2) | (current << 2);
i++;
goto start;
}
end:


return 0;
}

>>
what's your opinion on telegram?
I don't know shit about shit but I know I would prefer not using discord
I don't know where else to ask, this general is smart and has a wide range of opinions though
>>
>>70170573
That is not programming related, dumbass.
>>
>>70170573
requires a phone number :\
that means you can't create anonymous accounts
>>
>>70170573
Telegram is better than 99% of messengers.
>>
File: 1512084905726.jpg (32 KB, 500x500)
32 KB
32 KB JPG
Should I write my notes app in Python or Java? It's a GUI so I'm not using sepples or cee.
>>
>>70170550
Absolutely horrendous. Ask yourself what the purpose of FizzBuzz even is. To quickly get a working solution up and running? Simplicity, readability and maintainability? To make the most efficient implementation right away? To make one that is easily extendable with more patterns?
I think your solution fails all of these cases.
>>
>>70170591
this is the part I don't like, mitigated by google voice but apparently still needs android/ios for making an account. a shame
>>
>>70168986
emacs
>>
>>70168986
cat commands
>>
I'm trying to imagine how many lines of C++ this code would take to implement

data BinaryTree a = Leaf
| Node (BinaryTree a) a (BinaryTree a)
deriving (Eq, Ord, Show)

unfold :: (a -> Maybe (a, b, a)) -> a -> BinaryTree b
unfold f x = case f x of
Nothing -> Leaf
Just (a, b, c) -> Node (unfold f a) b (unfold f c)

treeBuild :: Integer -> BinaryTree Integer
treeBuild n = unfold (\m -> if m < n then Just (m + 1, m, m + 1) else Nothing) 0
>>
Behold
#include<stdio.h>
#define f(a,b)for(i=0;i<a;i+=b)
int main() {
int i;
char*l[15];
f(15,1)l[i]="%d\n";
f(15,3)l[i]="fizz\n";
f(15,5)l[i]="buzz\n";
l[0]="fizzbuzz\n";
f(101,1)i?printf(l[i%15],i):0;
return 0;
}
>>
rate my fizzbuzz

%default total

data Outcome : (t : ty) -> (a : Type) -> Type where
Tag : {t : ty} -> a -> Outcome t a

Semigroup a => Semigroup (Outcome t a) where
(Tag x) <+> (Tag y) = Tag (x <+> y)

Monoid a => Monoid (Outcome t a) where
neutral = Tag neutral

Functor (Outcome t) where
map func (Tag x) = Tag (func x)

data MultipleOf : (n : Nat) -> (d : Nat) -> Type where
ModIsZero : modNatNZ n d _ = 0 -> n `MultipleOf` d

multipleOf : (n : Nat) -> (d : Nat) -> Maybe (n `MultipleOf` d)
multipleOf n Z = Nothing
multipleOf n (S k) = case decEq (modNatNZ n (S k) absurd) 0 of
Yes prf => Just (ModIsZero prf)
No _ => Nothing

Test : Type -> Type
Test a = (d : Nat ** {n : Nat} -> n `MultipleOf` d -> Outcome n a)

test : (d : Nat) -> a -> Test a
test d a = (d ** \_ => Tag a)

performTest : (n : Nat) -> Test a -> Outcome n (List a)
performTest n (d ** f) = case n `multipleOf` d of
Just m => map (:: Nil) (f m)
Nothing => Tag []

data Result : Type where
Successes : (msgs : List String) -> {auto ok : NonEmpty msgs} -> Result
AllFailed : Nat -> Result

Show Result where
show (Successes msgs) = concat msgs
show (AllFailed n) = show n

result : {n : Nat} -> Outcome n (List String) -> Result
result {n} (Tag []) = AllFailed n
result (Tag (msg :: msgs)) = Successes (msg :: msgs)

fizz : Test String
fizz = test 3 "Fizz"

buzz : Test String
buzz = test 5 "Buzz"

fizzbuzz : (m : Nat) -> Result
fizzbuzz m = result $ concatMap (performTest m) [fizz, buzz]

main : IO ()
main = for_ [1..100] (putStrLn . show . fizzbuzz)


$ idris FizzBuzz.idr -o fizzbuzz
$ ./fizzbuzz | head -n 30
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
>>
Seems like most people dont actually just go and learn ASM, but they learn a higher level programming language and gain understanding of ASM through that. A few programming languages that immediately come to mind are C and Java. Now, the reason I want to understand ASM better is so that I can build better hacks/cheats. So, which version of C should I start studying?
>>
>>70170902
https://en.wikipedia.org/wiki/C--
>>
>>70170612
imagine being too much of a brainlet to look for a decent gui library
>>
>>70170902
>most people dont actually just go and learn ASM
Dude, Assembly isn't hard to learn. What's holding you back?
>>
>>70170931
The C family sucks for guis regardless of libraries. Portability is significantly better in Java and Python.
>>
>>70170902
beginners.re
and
emacs.dev (kek)
>>
>>70170946
>muh portability
>>
>>70170902
What kind of hacks/cheats have you made so far? How did you make them without knowing some assembly?
>>
What GUI does work on all DEs? Is it GTK(+) or is it actually Qt? I want to make something that works everywhere.
>>
>>70171180
ncurses
>>
File: dijk.jpg (36 KB, 480x362)
36 KB
36 KB JPG
you guys got any dank computer science/software engineering/programming memes?
>>
File: file.png (35 KB, 2000x1412)
35 KB
35 KB PNG
>>70171230
>>
>>70170919
Interesting, I will look into C-- more, thank you.

>>70170939
It just seems needlessly complicated. The way binary is computed is retarded to me and hex works with addresses seems retarded as well. Everything is backwards and I dont know why. a real complicated part is trying to find out what does what exactly. Also, I think the stack is fucking stupid. I'm learning more and more every day, but its an uphill battle.

>>70170958
Thanks, downloaded that book. Not sure about Vim but Ive been using Notepad++ and I like it.

>>70170966
Stupid shit like a health and magic reader with bars in AHK and something to see the last 20 bullets used. The stats reader was my own idea but the bullet one was just built up from an already existing last 5 bullets script or whatever. I really am interested in finding the function that casts a spell, I think I will find it eventually because other people have, but no one wants to share.
>>
>>70171230
>twitter
>"dank memes"
are the high schools already on spring break? jesus
>>
>>70171339
It really seems that counterintuitive to you? I built a calculator before I started programming so everything about low level languages like Assembly just clicked. If it seems counterintuitive to you, you should probably research processors and see how their internals work. Assembly isn’t the way it is without good reason.
>>
>>70171375
I studied computers and networking in HS, but that was years ago now (class of '03). I never really got into the programming aspect at all until very recently. I probably should look at it and see why it is the way it is, it just seems really irritating to me. Imagine if you had to write every sentence left to right, but then when you read it, you read it right to left. Sounds stupid, yeah?
>>
>>70165249
I'm creating a FREE VPN service - WireGuard only - for the purpose of having fun on the internet. It's actually done and i'm using it right now : ).
>>
>>70165249
are C string functions compatible with 4 bytes unicode characters?
they were developed with ascii in mind, worry.png
>>
>>70165441

global variables aren't inherently bad but teachers try to teach "good habits" instead of delving into the complexity of software design. It's a shitty approach to teaching that doesn't do you any favors.

>>70165447

and same with goto - people quote dijkstra without realizing that in the instructured programs he criticizes GOTO can jump globally - more like setjump and longjump in C than the goto keyword - but spergs will cargo cult this taboo forever.
>>
>>70171581
strcmp will probably not have proper lexical ordering but it will still test for equality properly
i doubt uppercasing/lowercasing functions will behave perfectly, but then multi-language case handling is a clusterfuck no matter how you do it

strncpy and the like accept a number of bytes so you might cut off in the middle of a multi-byte codepoint
>>
>>70171592
goto is useful in a small number of situations but usually is obsoleted by more powerful language features, like multi-level breaks as opposed to goto outsideofloop
or destructors for automatic resource-cleanup in a function with multiple exit points, as opposed to goto returnblock or copy-paste
>>
>>70171648
>destructors for automatic resource-cleanup
forgot to mention go-style defer also works for this
what other languages do stuff like that?
>>
>>70165249
Where should I start when learning Python if the only language I know is VBA?
>>
>>70171816
start with Idris, then work your way down to Python
>>
File: yyk0052.jpg (52 KB, 417x600)
52 KB
52 KB JPG
>>70171846
Cool, I'll look into it. Thanks!
>>
>>70171816
start with Assembly, then work your way down to Idris
>>
Learn sloppy C and call it from a higher level language when you've profiled and benchmarked for bottlenecks
>>
>>70165424
imagine being a programmer
>>
Am I a cunt for not having Notepad++ installed on the work computer? There's this guy who, whenever he needs to show some file, opens them in Notepad because he doesn't know how to use Vim. On the other hand I find it kinda amusing that you can call yourself a programmer and not know it.
>>
>>70172103
>being a vimlet
>>
Anyone know Coq? If I have two hypotheses
H: A -> B
G: A

and I want to apply G to H to derive B. "apply G in H" responds "unable to apply lemma of type A on hypothesis of type A -> B"
>>
>>70172215
wtf nerd
>>
>>70172256
>she doesn't even theorem prove
wtf are you doing here, >>>/g/wdg might be more your speed
>>
New thread when??
>>
File: ree.jpg (127 KB, 726x720)
127 KB
127 KB JPG
>>70172256
normies get out
>>
>>70172291
um sweetie this is the programming thread, where people take programming languages, and do something productive with them, like usable programs, gtfo with that academic masturbation crap
>>
Bill Gates once said "If you think you're a really good programmer… read (Knuth's) Art of Computer Programming… You should definitely send me a résumé if you can read the whole thing."
How do I prove that, should I put completed exercises on github?
>>
How do I make use of libraries that arent in the C standard library. No bully please, I'm learning.
>>
So what are you guys working on anyway?
>>
File: 1536910787815-pol.jpg (81 KB, 1280x720)
81 KB
81 KB JPG
Building an API translation layer for our biggest client because they refuse to update to the latest version of our API
>>
>>70172334
programming is theorem proving. types are propositions and programs are proofs. read up on the curry-howard correspondence then apologize forthwith
>>
>>70169271
>pick up a marker
>examine it
>put it back
>look over my shoulder at the interviewer
>"pfft... nothing personnel... kid..."
>undo the 7 velcro straps on my tactical fannypack in a single flourish
>Pull out my custom calligraphic fountain dry-erase marker
>and a blindfold
>Place my thumb and forefinger in the chiseled corner of my second chin
>with the smallest grin, and without breaking my gaze from the whiteboard
>"So you want an algorithm, huh?"
>blindfold in one hand and my writing instrument in the other
>Write function to produce a tree of fizzes and buzzes for every integer in 7.6 seconds
>In 5.6 seconds, write a recursive function to solve it for primes and numbers ending in two consecutively increasing integers
>All perfectly indented, in a monospaced Spencerian script of my own design
>in LOLCODE
>place one foot behind the other, and military heel-turn to the interviewer.
>Slowly step forward
>In a flash, wrap the blindfold over the interviewer's eyes
>"Call me... when you think you're ready"
>Sit back down and finish my pad thai
>>
>>70172215
Well I didn't figure out how to do exactly that, but in my case since B was the goal it was sufficient to apply H (to the goal) which added the subgoal of A, which we can of course prove immediately.
>>
so I have a file that looks like this:
byaya 2
alfj 4
ewifjwe 6
afafaa 8
kjfakljfa 10

Now I am trying to set up a pipemill that adds up all numbers in second column in each line:
tee <$1 | sum=0 ; while read x i ; do sum=$(($sum+$i)) ; done ; echo $sum

But it gets stuck in loop. What do I do wrong? Please don't suggest awk or anything of this sort, this is just a test task to learn more about pipemills.
>>
>>70172613
and ofc by <$1 I mean <file
>>
>>70168678
Give us some example code in your oanguage and explain its semantics
>>
>>70172613
>while read x i ; do sum=$(($sum+$i)) ; done
read is blocking, you need to give this loop input.

cmd | while read x i; do ...; done
# or
while read x i; do ...; done < file


Also you might want to read the tee man page.
>>
>>70165424
I would pound your boipussy
>>
>>70169131
try toilet paper
>>
>>70168678
So this is the logical conclusion of Lua/JS objects.
>>
>>70169715
No, it's because then you can change the underlying type with impunity. By impunity I mean without breaking code that uses the interface. Always return interfaces. Always take interfaces as parameters. Have interfaces be as specific to your use case as possible. A simple example: if you want to store data, make an interface called Storage with one method called store(data) and now you can implement disk storage, network copying and testing mocks.
>>
>>70170051
never post here again
>>
>>70171351
>>twitter

wot
>>
https://pastebin.com/SF23Y9KG
>>
>>70171339
Write your own assembler

http://ahefner.livejournal.com/20528.html

Now stfu and learn before you say more stupid shit
>>
>>70172947
is powershell worth learning?
>>
>>70171339
Don't look into C--. It's literally only used as an intermediate representation in GHC. The two are next to inextricable.
>>
>>70170267
Json
>>
Beginner here.
What are some bad programming practices I should avoid?
>>
File: 1474189493149.gif (408 KB, 624x345)
408 KB
408 KB GIF
I'm having a problem with my exercise in C
https://pastebin.com/a4Vjr63h
The if loops are executing even if the conditions are not being met and I don't know what is provoking this
>>
File: 1542093376448.jpg (28 KB, 359x347)
28 KB
28 KB JPG
why is KVM's ioctl api documentation so bad? does anyone have a doxygen-like reference for all the commands you can send?

and no, i dont want to use libvirt like a fucking noob
>>
redpill me on golang.
>>
File: 1552578366298.jpg (160 KB, 1280x720)
160 KB
160 KB JPG
>>70173143
what the fuck did you do to akari
>>
>>70173146
*serves you a warm cup of energy drink*
mmhmmm?
>>
>>70173128
>bad practice
nonono, all practice is good. get as much practice as you can by solving problems and working on your own projects
>>
>>70173130
you are calling getchar twice per loop
>>
>>70173130
>Control > 97 || Control < 122
Hmmm
>>
>>70173130
Are you intentionally skipping every second character? Might want to change your loop to
while ((Control = getchar()) != EOF) {
...
}
>>
dear imgui’s coding style is a very interesting way of writing c++
rather appealing in a way, makes me wonder what c would be like if it had actually tried to address some of its practicality issues at some point

like for example if it had actual namespaces with things like using directives so library developers weren’t forced to prefix functions with libname_
>>
>>70173130
|| is the logical OR
&& is the logical AND
check your logic
>>
I have my first hackathon on saturday. I only know C and Java and have no group or project.

I'm crash learning Javascript just to have a chance at doing something, but I plan on finding a team on site

Any tips on things I should learn or ideas for an app are really appreciated
>>
>>70172369
Declare the functions you want to use. This will introduce unknown symbols to the compiler that your code will be able to use. Typically libraries provide headers with those declarations so you can just include them.

When you're compiling the program, link the library you're using. This will let your compiler associate those symbols with the code provided by the library.
>>
>>70173189
dont go to the hackathon and work on your own shit on your own time instead
>>
>>70173162
regurgitating algorithm implementations from textbooks/stackoverflow to prepare for whiteboard interviews is bad practice
teaches you nothing about the process of algorithmic design and causes burnout pretty easily
>>
>>70173143
Read libvirt source code retard
>>
File: 1408852517064.jpg (55 KB, 725x291)
55 KB
55 KB JPG
>>70173168
>>70173170
>>70173175
>>70173180
okay I polished the logic and the loop and now I'm getting the proper results
Thanks all.
>>
Why is swing so shit? I shouldn’t have to do absurd hacks to make small things function ideally but I can’t really leave swing because it has the most resources available.
>>
>>70173284
Java swing? What are you trying to do?
>>
>>70173333
I got it working. It’s not a problem anymore. The GUI is working great. I just need to start the other logic which is the easiest part.
>>
>>70172369
You first include the header (.h) file of the library into your source file (.c). Include basically dumps whatever is in the included file into your source file, this is also called a compilation unit.
There are then two steps to building, compilation and linking. Compilation is where the compiler turns your source code into assembly and outputs an object file (.o). Linking is where the linker links together all of your object files, and links them against each other and any other static or dynamic libraries you are using, this outputs the final binary file which you can run.
>>
File: broken sql.png (5 KB, 372x128)
5 KB
5 KB PNG
Postgresql. Function is queried without error, but I have zero idea how to actually use it. This is not correct and I have no idea what a correct usage looks like because the documentation uses tons of things I'm not aware of yet but my instructor insists this is basic stored functions, the next step from select functions with conditions.
>>
I wish I could write C with a functional syntax. It would be nice to have composition and let/where bindings like in Haskell. I feel those could probably be implemented with macros, has anyone tried it?
>>
>>70173550
If you're unhappy with C and don't like the alternatives pick up the Dragon Book and make your own low level language.
f d s~?:==%[t]i d0_sl@m[1s0]
main=i1t0:??[i101]f15"fizzbuzz"f3"fizz"f5"buzz"_il i0
>>
File: 863.jpg (36 KB, 630x420)
36 KB
36 KB JPG
>>70173587
What the fuck is this fucking scripture where every character is contextually dependent on the last

Is this regex?

What justifiable reason can you confabulate for actually using this besides "I'm proud of myself for being able to understand it"
>>
File: 1551648744007.png (479 KB, 556x620)
479 KB
479 KB PNG
>>70173667
>every character is contextually dependent on the last
>Is this regex?
>>
>>70165274
U
>>
>>70173667
Some people like concise languages like J, APL, FALSE, and Jazzy because it means you can type up a complex program very quickly and fit it nicely in a small space.
      ∇LIFE[]∇
[0] NGLIFE CG;W
[1] WCG+(¯1⊖CG)+(1⊖CG)+(¯1CG)+(1CG)
[2] WW+(1⊖1CG)+(¯1⊖1CG)+(1⊖¯1CG)+(¯1⊖¯1CG)
[3] NG(3=W)+(CG∧4=W)

RP5 50 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 0 0
>>
>>70173737
you can do that in many languages by just using single letters for identifiers
>>
>>70173687
Who this slut
>>
>>70173775
It’s still no contest.
[$1=~[$1-f;!*]?]f:
>>
>>70173687
That's precisely what a regular language is. Every single state is always indeed dependent on the preceeding state. Just imagine how a regular expression works. You feed the characters you read into the automaton, and eventually it either reaches an end-state or breaks, because it doesn't recognize the input.
>>
>>70173737
>it means you can type up a complex program very quickly
It doesn't mean that at all. 90 % of the time spent on programming is spent on thinking of the programming, not on actually typing the solution. Typing is incredibly fast in comparison, so it hardly matters whether your keywords are 3 letters or just 1 letter.
>>
>>70173935
Yeah, tell me that after doing extensive coding in Java.
>>
>>70173989
I have done lots of coding in Java.It's no more verbose than any statically typed language. And I'd certainly pick it over the unreadable nonsense posted above.
>>
>>70174001
>It's no more verbose than any statically typed language.
>>
File: freddie sicp.jpg (65 KB, 640x480)
65 KB
65 KB JPG
>>70173819
Your dad.
>>
>>70174021
That is indeed what I said. Very observant of you.
>>
>>70174001
nowadays it isn't. but when java was at its apex of popularity, there was a time when people were overengineering the everloving fuck out of the simplest programs.
nobody just constructed objects, there were factories for everything, factories for method parameters, it was insanity. apparently Spring was/is notorious for that, but fortunately I never had to spend much time with it.

here's a parody version of FizzBuzz written "enterprise style" in Java:

https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/tree/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage
>>
>>70166934
Fucking based anon
>>
>tool that is actually rather useful but made in google sheets
>attempting to free it from the botnet by rewriting it as a command line tool
>a critical floating point calculation is +0.004 off
in google sheets, 0.002 * 92^3 + 10 * 92 + 100 == 2577.376
but the output of 0.002 * pow(92.0, 3.0) + (10*92) + 100 == 2577.38

i don't even know where to begin solving this
>>
>>70174434
most likely, whatever you're using to print the result is rounding it for display. try to specify more decimal places (like %.03f with printf)
>>
>>70170573
>>>/sqt/
>>
File: output.png (499 B, 178x21)
499 B
499 B PNG
>>70174468
you were right
the possibility of that completely slipped my mind
i feel retarded

however this means that the bug causing my final output, which should be 7902, to be 7901, is somewhere else
fug
>>
File: shinigami.jpg (30 KB, 480x360)
30 KB
30 KB JPG
is there a death note anime edit with programming books?
>>
>>70174434
>>70174515

Do you even know floating point? I hope these calculations have nothing to do with money. You'd be better off counting cents as integers instead of floating point.
>>
File: 1524035216714.png (426 B, 169x18)
426 B
426 B PNG
>>70174527
i'm well aware of how floating point works under the hood and the issues with precision
>I hope these calculations have nothing to do with money
nope
it's rather specific and there's a lot of bouncing back and forth between integers and floating point
not my choice unfortunately

and i found the bug
ironically caused by the exact opposite thing
google sheets was hiding a decimal place and i'd made something an int when it should have been a double
>>
>>70172103
>judging people base on their tools not their work
Typical smartass.
>>
>>70174001
>It's no more verbose than any statically typed language
This is simply false. I like Java though.
>>
>>70173550
>>70173587
Aaa functional C *sips*

#define dstr(str) strcpy(calloc(sizeof(str), 1), str)

union gu {
int i;
char *s;
};

typedef union gu (*INTFP)(union gu);

union gu fpipe(union gu x, ...)
{
va_list args;
INTFP f;

va_start(args, x);
while ((f = va_arg(args, INTFP)))
x = (*f)(x);
va_end(args);

return x;
}

union gu addone(union gu a)
{
a.i += 1;

return a;
}

union gu saytwice(union gu a)
{
char *s = calloc(sizeof(a.s), 1);
sprintf(s, "%s%s", a.s, a.s);
free(a.s);
a.s = s;

return a;
}

int main(int argc, char **argv)
{
union gu x = {.i = 0};
int a = fpipe(x, addone, addone, addone, 0).i;
printf("%d\n", a);

union gu s = {.s=dstr("fun")};
char *b = fpipe(s, saytwice, saytwice, 0).s;
printf("%s\n", b);

return 0;
}
>>
>>70174760
>INTFP
INTJ btfo by INFP master race
>>
>>70173550
>implemented with macros
...
just use OCaml or Haskell FFI or something if you need bindings to C libraries. C macros are a terrible idea for anything but the toyest of toys. nigga WHY?
>>
>>70175043
what a dumb post
>>
>>70174121
Java is still being overengineered with functional crap that Java devs claimed was unreliable while ignoring the simple required stuff like coroutines, tuples and nice IO.
>>
>>70174760
no such thing as functional C only brainlets who cant figure out why it disfunctional
>>
new thread when? :3
>>
>>70175259
When you kill yourself, which will be soon seeing you're a tranny.
>>
new thread: >>70175272
>>
anyone know why this export is an error?
>>
>>70175647
Best guess is a missing semicolon before the statement on line 28.
>>
>>70168926
jesus
>>
DPT I'm considering taking a DBA job and rarely coding ever again. Is this definitely the right move or maybe not?
>>
>>70171648

True and good points.



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.