What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
think I'll write datadog tracing bindings for Haskell
second for Java
gross
Fourth for Java. Teaching myself Spring so I can port a small webapp I wrote from Python.
I don't understand why people say that Lua does not have many features. It may not on the surface have a lot of features, you don't need any because each feature so powerful.
Tetris clone
Threadly reminder that Lua is super duper cute; and she's a blast to write in! Say something nice about her, /dpt/!
>finally finished university
now what?
give me ur uni projects to use as my own
>tfw you fell for the programming job meme
How do I read data from a file?
open file
copy and paste everthing in a string
>open a file
>begin copypasting it
>another process kicks in
>overwrites the file
>end up with a string full of shit
>tfw can't into awk
use the open, read,write system calls
i was memeing
never had a job senpai?
>tfw you fell for one of the best jobs in the world
>tfw all your friends from highschool already have a bouquet of work related health issues
>tfw you are handsome, fit, healthy, calm and intelligent
>use open() syscall
>use read() to read a piece of data, whether it's a byte or whatever else
>another process overwrites the next piece of data
>end up with garbage anyways
not one worth mentioning
also britbong
last stuff i worked on was a simple neural net in python, a 5 a side football sim in prolog, and some horrid little network enabled android app.
>one of the best jobs
lol
also
>college professor that high
is that true? I actually wanna be a professor
A formally proven implementation of FizzBuzz, r8: github.com
At the moment I've proven that for each non-zero positive n the function produces a strictly ordered sequence n..1, with each element having a string component according to the FizzBuzz rules, and I've kinda run out of properties to prove.
The most interesting thing is I don't have to write the values themselves, once I've proven the properties, Idris is able to deduce the actual value for me.
i am trying to do my homework, but can't muster the motivation to do so.
it is in java and the exercise says, that I need to read a textfile, read the numbers in the file and put them into an array.
but here I am yawning and feeling sleepy and not willing at all.....
that's fucking easy m8, if it takes you more than 10 minutes you're hopeless
>reading files in java
>buffer(print buffer(read buffer( teleports behind you buffer( factory buffer ( lets add something else here ( writer (buffer( ayylmao (the virtual machines bows to them ())))))
>that's fucking easy
Not him but I've posted a much simpler/more generic problem and nobody ITT answered it correctly yet (at least 2 anons tried).
TeleportToNullPointerException at thread main()
I am a fucking newbie to programming.
It is easy as fuck i bet.
But i just want to lay o my bed and sleep away my existence.
tanks i guess
I'll come back later on.
I need to pull myself to the neurologist for medication.
cya.
prove that fizzbuzz of a prime n where n > 5 is (show n)
Of course it's comfy, the hard part is to get a position in a good place. One of my pals spent a couple of years in one of the African countries, teaching negroes math or physics iirc. That was pretty horrible according to him, he still managed to get a couple of students to good eu unis after all and he is proud of it
Fuck Lua.
Had to write in Lua for child scripts in V-REP. Worst fucking language, ever.
Is that including or not including tenure?
Because Adjunct profs don't get anywhere near that stability or salary. also, most profs get between 40-60k, not 70k. the fuck is the data from?
It's actually not that hard. Once you have some good formalization of "is prime" property you can deduce Not (n % 3 = 0) and Not (n % 5 = 0) from it and then use the Nat case constructor directly.
>meme
teaching is the only job I can see myself doing for a longer period of time, but I fucked up by not getting into a good university
>r8
Cute / 10
>The most interesting thing is I don't have to write the values themselves, once I've proven the properties, Idris is able to deduce the actual value for me.
That's a property of any constructive system.
Lisp is best language. Working on a Common Lisp project that uses Node.js / web browsers as a compilation target, with Parenscript. Here's an example macro I wrote to chain ES6 Promises without resorting to .then() syntax:
(defmacro chain-promise (&rest lambdas)
(let ((form (car lambdas)))
(loop for lambda in (cdr lambdas) do
(setf form `((@ ,form then) ,lambda)))
form))
Webdevelopment in Idris
>web ''''development''''
USE ATS YOU FOOL
>Only works for natural numbers
Please generalise this to work on any Euclidean domain.
>Web""development""
Use
>Machine code for C library is linked into program code whereas the code for windows function if loaded outside of your program in DLLs.
Does this imply c library are bloated?
Something nice? github.com/luvit/luv such beauty. Got the async networked program I wanted working in NO TIME! Lua make me do what you want, I am your sex slave.
No the operating systems ABI model is bloated.
C does define how libraries/programs are packaged, loaded or executed.
Meant to say that C does NOT define
FizzBuzz itself is defined for N+ only tho. Besides, I rely on the length of the vector being Nat as well.
I don't see why I can't work on any ring with "division with remainder".
Well, for starters I need a strict ordering for sorting/uniqueness and a successor function for induction.
I heard System V is abi for linux
What is the abi spec for windows?Why didn't linux adapt it? Is it patented by MS?
Explain move semantics to me like I am a retard
>But... But it was developed by open sores community it is supposed to be efficient than windos.
>like
No need to lie, user.
>I heard System V is abi for linux
It's used by most 64-bit unixes, including the BSDs and macOS.
>What is the abi spec for windows?
They have multiple, for some stupid reason.
>Why didn't linux adapt it?
Why didn't Windows adapt the System V ABI? They're the odd ones out here.
The most surface level reason is sizeof(long). 8 bytes on System V, 4 bytes on le winmeme.
There is a lot of software that makes the assumption that a long is the size of a pointer. So they would probably subtly break a lot of software if they had it 8 bytes. I think micromeme chose 4 bytes because their shitty APIs made a lot of assumptions about long being 4 bytes specifically, but I'm not certain about that.
Windows has it's own spec, it's just "the Windows ABI". System V was a Unix OS, linux, being a unix-like, uses the Unix ABI. And Linux isn't just going to change the ABI, that's a net-zero effort, there is more than just the ABI keeping linux and Windows applications separate.
>meme
>you
>
What is the name of windows abi?
>le
Foo owns a heap pointer to a big array. It's expensive to copy this array.
struct Foo
{
size_t my_stuff_size;
char* my_stuff;
}
Under normal circumstances, if you want to create a copy of Foo, you also must make a deep copy of that array which the new Foo owns.
Foo(const Foo& otherFoo)
{
my_stuff_size = otherFoo.my_stuff_size;
my_stuff = new char[my_stuff_size];
memcpy(my_stuff, otherFoo.my_stuff, my_stuff_size);
}
If you know that the other Foo isn't going to be used, that means you're free to steal its resources using a move constructor.
Foo(Foo&& otherFoo)
{
my_stuff_size = otherFoo.my_stuff_size;
my_stuff = otherFoo.my_stuff;
otherFoo.my_stuff_size = 0;
otherFoo.my_stuff = nullptr;
}
The move ctor will be automatically be invoked on an unnamed temporary (rvalue) Foo, or you may explicitly write std::move as well.
Thanks for the information. I couldn't find this on google search.
You got me
Much appreciated faam
==19712== HEAP SUMMARY:
==19712== in use at exit: 804,918 bytes in 2,609 blocks
==19712== total heap usage: 61,560 allocs, 58,951 frees, 354,023,997 bytes allocated
==19712==
==19712== LEAK SUMMARY:
==19712== definitely lost: 88 bytes in 1 blocks
==19712== indirectly lost: 776 bytes in 1 blocks
==19712== possibly lost: 42,615 bytes in 1,283 blocks
==19712== still reachable: 761,439 bytes in 1,324 blocks
==19712== suppressed: 0 bytes in 0 blocks
==19712== Rerun with --leak-check=full to see details of leaked memory
Languages with GC are scrary.
what am I looking at here?
Valgrinds output on simple GUI program compiled with chapel, I might forgot to quit the sdl so that's why it leaked...
But here's one for hello world
==19971== HEAP SUMMARY:
==19971== in use at exit: 0 bytes in 0 blocks
==19971== total heap usage: 2,258 allocs, 2,258 frees, 765,278 bytes allocated
==19971==
==19971== All heap blocks were freed -- no leaks are possible
==19971==
==19971== For counts of detected and suppressed errors, rerun with: -v
==19971== Use --track-origins=yes to see where uninitialised values come from
==19971== ERROR SUMMARY: 21 errors from 21 contexts (suppressed: 0 from 0)
Still spooky.
compared to hello world in C.
==19994== HEAP SUMMARY:
==19994== in use at exit: 0 bytes in 0 blocks
==19994== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==19994==
==19994== All heap blocks were freed -- no leaks are possible
==19994==
==19994== For counts of detected and suppressed errors, rerun with: -v
==19994== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
So clean.
What did you use? OpenGL(glfw,glew or sdl) or some shitty opens sores library for gui?
it just started the window and closed it, didn't draw anything.
explain this expression by expression
books for beginner compsci math?
lisp is the least weird programming language
any arduino people in here? i'm doing the project where you make pressing the button turn a blinking red light or, while not having it depressed has the green light on. i changed it to be where you press it once to change the state, but it can't register button presses half the time when the red lights are blinking because of the delay function. how do i do this?
don't write a shitty delay function
i didn't write a delay function. i asked for arduino people..
I've read K&R and made some things with C what book should follow next to get even better in C?
The Practice of Programming by Brian Kernighan and Rob PIke. Even though it is a general programming book, it focuses on C a lot.
can I see the code? I don't know how to arduino but I did something similar last year in uni.
thanks !!
it's on my laptop but it's
state = 0; // 0 is green, 1 is flashing red
void loop(){
push = digitalRead(button);
if (push == HIGH){
state = !state;
}
if state {
digitalWrite(red, HIGH);
delay(250);
digitalWrite(red, Low);
delay(250);
}
else{
digitalWrite(green, HIGH);
delay(250); // to give you a chance to let go of the button before it reads again
}
lower the delaytime?
i was more wondering if they have threading
yeah I was actually thinking about too. I was just starting to write something similar but with threading. I'm pretty sure you don't need threads for this. we did something like this on a 8051 and instead of the delay function we just let it count from 255^2 to 0.
sounds like a pretty good idea actually, might try it out. only thing i don't like about it is that the duration of the blinks would be based on the processing speed of the hardware though
Can somebody tell me where this is going wrong?
#include
typedef long double num;
num snd (num x)
{
return exp(-0.5*x*x)/sqrt(2*M_PI);
}
Supposed to be a standard normal distribution calculator, should be trivial to make but it keeps throwing up wrong answers.
any android devs here? what is the difference between layout and activity?
>open file gets changed
now this is a meme
captcha: UMUM barcelona
exp might not be defined for long double. Have you tried regular doubles?
>tfw someone forks your project on github
Do you know this feel lads?
My guess would be M_PY, not only because τ is the way to go, but also because I can't confirm it's even in the C++ standard, so maybe your C++ implementation is fucking with you on that. Afaik exp and sqrt are overloaded for long double in C++.
yeah i think we used a timer later in the semester, but I forgot how long the delay had to be.
layout defines the UI elements, eg where buttons are, that doesn't contain any code. The activity can be seen as the entry point of the application code.
he probably missclicked
It is, and trying regular doubles would prove what exactly?
Nothing, i was too lazy to check if it was actually overloaded for long doubles.
Delet
>The 64 bit version of windows operating system supports up to 16 terabytes of random access memory whereas 32-bit versions can only support up to 4 gigabytes.
Does this mean we are about to see impossible things in coming decade?