« first day (3012 days earlier)      last day (1938 days later) » 

12:30 AM
Why does current Arduino IDE only support windows 8 and above?
Also trying to push people onto using their web IDE.
The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board.
Except forcing people into giving out personal info before allowing them to use the web IDE.
I need to find a way to install Arduino IDE onto my window 7 machine. Apparently I could still upgrade to windows 10 for free, but I love window 7. It's a much better and purer OS for dev IMO.
 
12:51 AM
I found a working version for window 7, being a 1337 gap implementer ...
Although ... it seems I have already had it installed months ago when I installed the driver for a drone :x
 
 
1 hour later…
2:06 AM
@BartekBanachewicz that retro/lofi synth intro though
I like the next track as well
Not fond of the synth/keyboard playing
Something tells me the vocalist might be playing that himself.
 
2:30 AM
Gosh. The synths are too corny. It got worse with "Going Going ..... Home" (what's up with those elaboripses anyways). Also, the Phil Collins school of drum computer use crops up some of the time
I like the genre of songwriting a lot though. He needs a better band
Then again, tastes.
 
Butttt the first 5 seconds are epic kick-bass. Such a liveness and depth. No comparison
Also, analog synth lead and actual bends
Bit intrusive behind the vocals though.
Ah, becomes proper corny only at the interlude
@Mikhail At least the more obnoxious synth motives are /on purpose/ and match the lyrics.
And inferior guitar use, just to preempt the Banawicz
 
Here is another good one, where he figurative dances on Freddie Mercury's grave
https://www.youtube.com/watch?v=hAUlYBzEGA4
 
I got that vibe from him quite a bit
@Mikhail lol those poodles
It approaches Borat levels in the end.
 
 
1 hour later…
3:56 AM
@ratchetfreak Do you know if I write some program to control the servos on a robot, how portable is it if I want to move the program on to a rPi or something with a faster CPU/processor?
 
4:43 AM
The language used to program the Arduino is C++
Except not 'usual' C++, more like a subset of C++ that mostly handles I/O.
 
5:35 AM
Need to go out and discuss the elimination of bugs in real life: there is an infestation of cockroaches at one of the places, possibly because the young couple living there always buy takeaways and leaving food scrubs all over the places. Need to have a look first ...
 
 
3 hours later…
8:23 AM
Sketch uses 2266 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 59 bytes (2%) of dynamic memory, leaving 1989 bytes for local variables. Maximum is 2048 bytes.
Needs to start learn to write tiny, yet convoluted programs ... maybe ...
 
8:50 AM
How to make Valgrind fast
 
@Morwenn That's like asking how to make water not wet.
 
I mean, if I understand correctly, at some point Valgrind somewhat decompiles your program, inserts instructions and compiles it back
Since I'm running the same program several times through valgrind with different command-line options, can it used cached information to avoid having to do that over and over again?
 
9:07 AM
@sehe yeah, that's all around this
for some reason that Mike&The Mechanics album reminds me of this
again, from the guitar standpoint of course
 
@Morwenn That step doesn't take a lot of time
 
Nick has this airy, light-touched tone here
 
Early models of ZipCD drives were relabeled Philips drives, which were also so unreliable that a class action lawsuit succeeded.[14]
 
it feels like he's barely playing at all, like there's no effort there
 
@Mikhail really? out of 500 runs wouldn't I still shave a few seconds off?
because with my current setup I'm pretty sure it is executed 500 times
 
9:10 AM
The easiest way is to run the job in parallel?
 
it's in a Travis VM, I can't have that many jobs in parallel
I try removing the -j4 from ctest and my Valgrind builds starting being slow again (except the Vlagrind g++ build because why not?), so running in parellel definitely helps
but even like this it still takes 20 to 45 minutes
 
Do you really have to run to completion?
 
@BartekBanachewicz (And you can really hear that in the first verse of Web Of Lies, starting at 0:52)
 
@Mikhail if I want to check that my whole test suite passes, yes x)
 
Not to be a bad person, but have you considered running your test suite without valgrind? I don't use it unless I have a problem to solve.
 
9:16 AM
it caught a few bugs here and there that even asan didn't catch and so I would have never found myself
 
Interesting, what kind of bugs were they?
 
out-of-bounds memory accesses
I re-enabled my std::deque tests, and now I've got random failures x)
 
That's kinda fucked up on many levels, but one of the levels is that you're using ponters :-)
 
it's mostly in sorting algorithms I've stolen, which makes errors difficult to understand
also it's when I'm using iterators, not pointers directly
 
s/stolen/shared/
shared without permission :x
 
9:20 AM
I prefere stolen
 
Well, for MSVC iterators are checked in debug builds so I've had little motivation for using valgrind. Many years ago, when I had to optimize code, I used KCachegrind.
 
I tried to enable the libstdc++ debug mode, but got an ICE x)
and my library doesn't compile with MSVC
 
@Morwenn score!
 
The ICE is just an out of access error at compile time :-)
 
so far I managed to get ICEs with both GCC, Clang and MSVC while toying with cpp-sort
and also ICEs due to not enough memory in the Travis VM
 
9:25 AM
@TelKitty servo's tend to use the analogue out (really a pwm signal) and arduino tends to use the busy loop instead of waiting.
I've also had trouble finding anything on the C api of the rPi over the python api
 
Yeah, the only exposure I had on rPi controlling servo was using python.
Weird choice.
C/C++ would be more intuitive.
 
I think it's because you don't need to compile it and it's fast enough
 
Depends on what you do with it.
 
9:56 AM
@ratchetfreak Also I can't connect 4 servos from robot to one uno directly right? I need a breadboard of some kind?
 
You need a pwm pin per servo
and most likely an external power supply
 
I have got a external power supply (power bank), and 2 PCA9685 servo driver.
 
@TelKitty a breadboard is literally a cable
 
a bundle of cables in a rigid package
 
@TelKitty do you have that driver as a bare chip or as a module
this thing apparently runs on I2C, so you'd need just power and two pins
 
10:10 AM
Ok, I am new to this, so I have setup such as:
  servo1.attach(11);
  servo2.attach(10);
  servo3.attach(9);
  servo4.attach(6);
 
that tells me literally nothing
 
Those are uno pins?
 
IIRC not all of those pins are PWM
yeah, 7 and 8 aren't
 
@BartekBanachewicz corrected
Nvm, I need to read on this a bit more.
 
@TelKitty I made that mistake recently as well, annoying stuff
@TelKitty I'd really recommend going the premade module route. You'll typically end up with a redesign of such a PCB that's basically worse
unless you have really specific needs which you can identify and back up, especially for prototypes it can save lots of time
caveat: I've never dealt with servos myself, just engines.
 
10:14 AM
According to a fellow member, engines are just like bigger servos. :x
 
erm no not really
 
Well, signal control is a bit different
Thanks for the help.
 
@TelKitty well, to the point of requiring totally different control hardware and design considerations
 
with motors you are typically controlling the coils directly
 
10:36 AM
at least it inspired me to buy a magnetometer and a gyro
I kept forgetting to do that
I wonder how precise that'll be in practice without a GPS
especially on a motorbike, which are known to fuck up all magnet-related measurements
 
user3956566
11:09 AM
@TelKitty I've posted a bunch of pics in the Litter box
 
that's a horse
 
user3956566
11:26 AM
lol yep. She's not even 7 months
 
user7015372
12:07 PM
Seeing as the question "How is this a problem if you implement range checks?" is subjective and apparently open to discussion on the stack overflow website (No kidding, that is what the website told me), i would like to hear from you guys,
Visual C++ includes a nasty bug/feature that apparently blocks you from trying to do "variable length arrays". Yet, its still supported in the latest versions of GCC. Compiles without any problems and runs without any problems. So, what the hell Microsoft? Is this perfectly legal as people do know that "out_of_range" is a thing. And they can just use that
 
@BartekBanachewicz Yvette has 6 pet horses.
@YvetteColomb Don't put your pet horses in the litter box!! :p
Are you still in Sydney or in Smith's Lake?
 
user7015372
(If that question was aimed at me, none of them.)
 
user3956566
@TelKitty up north. But I will be back :)
 
user3956566
the horses would stomp on a litterbox no worries
 
user7015372
12:23 PM
(I may as well post the follow up to my question while i am at it.)
Email from Billy at Microsoft when i left feedback about this problem.
-----------------------------------------------
Thank you for your feedback! The code example in that blog post relies on an extension, namely, C99 variable length arrays, which are not part of any version of C++. The expression:

int arr[n];

is ill formed in this context because n is not a compile time constant. Visual C++ has declined to implement this extension over concerns of the security and reliability problems it raises; on the security front be
 
@HSF3232 it seems they do not find the optimization potential of alloca to be worth it to embed the more safe variant into the language
 
user7015372
alloca?
 
it's the older method to dynamically allocate memory from the stack
frees the allocation on return of the calling function
 
user7015372
So i guess that is a almost low level function that is part of the library? Or is that a normal function that people can use?
 
it has to be a compiler intrinsic
 
user7015372
12:32 PM
So low level. Okay then. Also, is it just me, or does "stack buffer overrun" just sound like an excuse to me? Its variable length arrays for crying out loud. Which means that if you get your program right, you can fit pretty much "any" length of data into a buffer and still be fine.
 
it is one of the older security bugs in existance
 
@HSF3232 it's just you, the linux kernel removed all VLAs becuse they were causing security vulns
 
also they could avoid overrunning the stack by using their _malloca
 
user7015372
... techiedelight.com/convert-vector-to-array-cpp <--- How does this work then?
 
user7015372
Running on the latest gcc works as well.
 
12:34 PM
@HSF3232 which compiler args? if you disable extensions and compile as C++ it should not work
 
@HSF3232 little thing called compiler extensions, that's not portable or standard C++
 
user7015372
It does not disable extensions by default, i think.
 
user7015372
Running g++ on the code on its own without any other args works perfectly on the latest version of linux.
 
@HSF3232 default mode in g++ right now IIRC is g++14
always pass a standards mode
 
user7015372
Huh. What is the latest version?
 
12:39 PM
and preferably -Werror -Wall -Pedantic
-std=c++17
 
user7015372
No capital "p" xD
g++ Test.cpp -Werror -Wall -pedantic
 
user7015372
That's not the error, woops.
 
shrug
 
user7015372
I was meant to send the error saying "Did you mean '-pedantic'?"
 
user7015372
error: ISO C++ forbids variable length array ‘arr’ [-Werror=vla] <-- Is this error you were talking about?
 
12:41 PM
@HSF3232 yes that's what you should have gotten
For what it's worth more security focused OS distros ban VLAs outright
 
user7015372
I still don't believe how this turns into a "stack buffer overrun" exploit. Example of this?
 
to be fair some of them ban storing any arrays on the stack
@HSF3232 it's literally a classic stack smashing exploit, you arrange for n to be something massive then arrange for the data to be an address you control. When the method goes to jump to the return address the application is hijacked
 
user7015372
Uh... What about if you have a range check first? Like every smart person should have in programs.
 
user7015372
IMO, i believe static arrays ARE most of the reason why: A. some third party crypto library solutions don't work correctly, and B. why there is so many freaking buffer overflow exploits in programs.
 
@HSF3232 you can't always? If you could have a range check you would have used a fixed length array
I don't have to explain it to you... I'll let the linux folk which recently completed a full purge of them do it.
 
user7015372
12:50 PM
Okay, so the Linux guys are the reason why crypto programs in Linux don't work correctly. How are you supposed to adjust the buffer for ciphertext encoding? You literally cant if you don't know how big the ciphertext is going to be! How are you supposed to know that!? Adding a 0 to the last position might do something if you used fixed buffers, except oh wait! 2 problems here:
1. Fixed buffers = Buffer overflow exploits.
2. You now suddenly have garbled data in your padded ciphertext. Leading to crashes.
 
@HSF3232 use malloc or std::vector like any sane program
there are a LOT of security benefits to moving data to the heap
 
user7015372
 
user7015372
Yeah, i would. IF I CAN!
 
also what do you mean by "crypto programs"
 
user7015372
Just answered your question.
 
12:53 PM
@HSF3232 you can, that method doesn't differentiate or know where the buffer is
it just shows a bad example
 
user7015372
Excuse me, these guys maintain a crypto library. "Bad example"? How it is bad if its based off the code itself which may only support byte arrays?
 
@HSF3232 using sizeof(some_array) is the epitome of bad examples IMO
even without using it to size a vla
as soon as the data isn't a compile time array sizeof won't work anymore
 
user7015372
Okay, so what is your suggestion then? datatype.size()? Sure, but only the vector supports it.
 
@HSF3232 you do realize that maintaining a crypto library doesn't mean they are god's gift to programming? Go read the libressl rant when they forked from OpenSSL on archive.org
they talked about literally flensing the library down to something sane and safe
@HSF3232 vector is probably the right tool
you will need to pre-size it through
 
user7015372
"std::vector is a sequence container that encapsulates dynamic size arrays."
 
user7015372
1:01 PM
Why would i need to pre-size something dynamic?
 
because Base64_Decode expects preallocated memory
it doesn't care where it came from
 
^
btw super security conscious applications would create separate heaps for security sensitive and non-sensitive data
to keep them separated and safer
 
@ratchetfreak yeah looks like it, I recall being both scared and amused reading it
scared because of what they were finding (insane bugs) and amused by how they were discussing them
 
user7015372
Okay, so how do i that? Because if you say "Do it with memory allocation", Forget it. I DON'T TRUST IT. I only trust the compiler to do it for me. So tell me then, what is the most safest way of allocating memory, without finding that i fucked myself over because i left a highly sensitive piece of information in a very visible spot?
 
1:07 PM
@HSF3232 just use std::vector? Unless you're doing raw protocol parsing you don't need to do anything special usually
 
don't assume the stack isn't a very visible spot
 
it is however a very security sensitive spot
to the point that a lot of secure coding rules ban any sort of stack buffer at all, fixed size or not
 
as in the source of a lot of security bugs
 
user7015372
-_- Do i have to remind you that Spectre and Meltdown are still very big threats AND people are morons who do not update their software. "don't assume the stack isn't a very visible spot", In fact, i am assuming it is, because you can leak memory.
 
user7015372
This is the level of paranoia i am working at.
 
1:09 PM
if you have sane code you won't leak memory
if you are worried about data in deallocated code write a allocator that will allocate from pinned pages (won't get paged out to disk) and scribble over any freed memory
 
@HSF3232 I'd rather leak memory than leak information, but if you use RAII you won't leak.
or at least shouldn't
 
user7015372
Ugh... Fine. But you are going to have to find me a different crypto library to use. Because i clearly can't use "wolfssl" anymore. Also, did i or did i not mention that i don't trust memory allocation functions?
 
then write your own
 
or use a validated library like cryptopp.com
or just use a system library
 
user7015372
Are you insane!? Write my own!? What, you think that i can magically code crypto stuff out of thin air!? (I thought you already knew that i was starting to program in C++, coming from python.) Let me spell this out again! I don't trust memory allocation functions. Writing my own crypto means i have to use memory allocation functions to try and mess around with bytes. Also, I am not using Crypto++. Not with the junk attached to it. And system library's KILL cross-platform code.
 
1:18 PM
what exactly don't you trust about them?
 
actually I think you are. You can't write any sort of secure program in a modern world without using some sort of dynamic memory. You can limit that effect by following idiom that means you don't have to personally manage the memory.

Honestly you probably should have just stuck with python unless you really really needed to use C++.
 
user7015372
It allows you to mess around with memory. You can assign stuff anywhere in memory. And seeing that Linux messes with how memory is laid out, you can say goodbye to system stability.
Also, I NEED to use C++ because who uses python for major programs? And besides, my college requires me to use C++ if i ever want to pass my course.
 
user7015372
That is why i don't trust it! And before you say "Memcpy and its _s varaint are memory allocation functions", No they are not. They just simply move data around. What kind of pointer assignment do they do?
 
a) I think you misunderstand how virtual memory works. You can't just put anything you want anywhere there are a lot of reasons for this. Most notably because you're in userspace and your memory doesn't actually correspond to logical memory.

b) Lots of applications are written in python... major web applications running in a lot of enterprises. Go search for a talk about migrating python versions at facebook.
@HSF3232 I think you're trying to mix c++ and C
if I declare a vector thus: std::vector<int> foo; I know for a fact that any memory held by that vector will be released when it goes out of scope
now if I do something dumb like std::vector<int>*foo = new std::vector<int>(); yes... I'm on the hook to manage that memory. That's not safe code.
 
user7015372
Tell me then! How is it SUPPOSED to work? And how on gods earth does exploits like spectre get around this?
Oh, you think i want to work for moron company's like Facebook? No! That's is not what i want to do. I want to atchally do some proper work out in the field. Not like the other people in my class who just play games all day. Not kidding! This is literally a thing, and its driving me insane.
Mixing c++ and C? Are you to say that C and C++ are two entirely different languages?
 
1:31 PM
@HSF3232 c and c++ are completely different languages with complete different idioms. C++ uses Stack based resource management also known as Resource acquisition is initialization (RAII). Whereas C does not.
 
user7015372
So why are they named C and C++? I don't get that bit!
 
user7015372
Surely they could have named it something else.
 
@HSF3232 history, Bjarne started with "C with classes" and then worked from there. But the feature-set of C++ was literally to solve pain points in C
look at the example of how vector is used here en.cppreference.com/w/cpp/container/vector
that memory is dynamically allocated, but it's automatically freed when the scope is left
 
spectre gets around bounds checks by exploiting out of order execution in the cpu and reading the state that doesn't get rolled back
 
user7015372
Yes, i know that bit. But how does it know WHERE to look? Because if its stuck with its virtual memory, then it CAN'T locate the data. And therefor, does not know where to look. Therefore, it must be messing around with memory addresses. Which then means the memory allocation features themselves can not be trusted.
 
1:36 PM
@HSF3232 you should never need to go randomly looking through memory? it manages its own allocations so you don't need to know nor care.
 
user7015372
@Mgetz, that was in response to rachet's question.
 
@HSF3232 respond to people using the small arrow on the right, it helps provide context as to WHAT you're responding to
 
half of it is knowing the program and the platform it runs on the other half is that spectre exploits cannot crash the running program
so you can probe as you please using it
 
honestly I wouldn't worry about guarding against SPECTERE and MELTDOWN in your code. if you need those protections turn on the compiler flags to insert those projections.
 
user7015372
Okay, sure. WHAT flags though?
 
user7015372
1:40 PM
:45060364
 
12
Q: How to mitigate spectre with GCC and Clang (or LLVM in general)

FSMaxBMicrosoft added a convenient /Qspectre to their MSVC compiler (although that seems to only be (trying to) mitigate Spectre v1 at the moment) that they will be updating over time. This is quite nice from a users perspective, just enable that flag and you get the latest and greatest mitigation they...

 
user7015372
Okay, why is this not a common thing?
 
because it affects performance
and if your application is already inside a walled garden (which most are TBH) you don't want that
 
@HSF3232 because most processes aren't that sensitive, most don't need to prevent this sort of thing, and it has a 25-40% perf hit in some cases
 
user7015372
@ratchetfreak Walled garden?
 
user7015372
1:44 PM
What is that meant to refer to?
 
it means that the application is protected from untrusted input
 
@HSF3232 sandboxed, prevented from calling privileged APIs or accessing security sensitive data. Usually receives sanitized inputs to some extent
 
user7015372
Ah, okay.
 
where you really need that sort of mitigation is in things like webservers or browsers
where you're handling things like private SSL keys but potentially running things that could come from client side. Browsers in particular are sensitive here because of javascript.
Webservers if they are configured correctly shouldn't be really
 
user7015372
Oh lovely, now "-I" in the g++ tool is refusing to listen to what i tell it.
 
user7015372
1:57 PM
-----
Test.cpp:8:2: error: ‘vector’ was not declared in this scope
vector<byte> Testing = {44,36,22,11,0};
^~~~~~
Test.cpp:8:2: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
from Test.cpp:3:
/usr/include/c++/7/bits/stl_vector.h:216:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^~~~~~
Test.cpp:8:13: error: expected primary-expression before ‘>’ token
vector<byte> Testing = {44,36,22,11,0};
^
Test.cpp:8:15: error: ‘Testing’ was not declared in this scope
 
@HSF3232 you don't need to pass the vector header to -I
it's automatically available if you're using g++
 
user7015372
Uhm, i was trying to pass the wolfssl directory to -I, not the vector header.
 
ah, you also need to do std::vector
 
it's std::vector. the std:: part is necessary
 
don't do a using namespace std; ever
 
user7015372
1:58 PM
Oh, woops. I see where i went wrong.
 
user7015372
Why not? Everyone else said to use "using namespace std;", even my teacher at college said to do that as well.
 
because it create name collisions
 
user7015372
This is what i was talking about you guys finding me a new crypto library (That ain't CryptoPP). You literally told me to just give it the vector as you called the example on the doc website, bad.
---
Test.cpp:11:64: error: cannot convert ‘std::vector<unsigned char>*’ to ‘const byte* {aka const unsigned char*}’ for argument ‘1’ to ‘int Base64_Encode(const byte*, word32, byte*, word32*)’
Base64_Encode(&Testing, Testing.size(), &Encoded, &EncodedSize)
---
 
Base64_Encode(Testing.data(), Testing.size(), Encoded.data(), &EncodedSize);
 
user7015372
I highly doubt that is going to work, but okay.
 
user7015372
2:03 PM
Nevermind, it does.
 
user7015372
Who do i shout at for that bad fucking example at the group who makes wolfssl?
 
@HSF3232 don't bother
 
user7015372
@Mgetz Why not? Its a bad example, and people who are just getting started with this won't know that the example is bad. Which leads to more rants.
 
@HSF3232 it's a C api and they probably don't care
you'd be surprised at how prevalent that attitude is in industry
 
docs and examples are nearly universally bad
 
user7015372
2:12 PM
@Mgetz sigh, I know. Have you ever seen Fallout 76? Or Elder Scrolls 6 for that matter? This is mainly the reason why i wanted to start going down this path for my career. People don't care anymore and i hate it. They even have that attitude in some security company's as well.
 
user7015372
@ratchetfreak Just C++ stuff or all of it?
 
they do care, it's just a balance between getting a product out and having it be perfect. If you let perfect be the enemy of good you'll never ship
part of the issue is that in FO76 they took a single player engine and tried to scaled it to an MMO
that usually doesn't work
 
user7015372
As demonstrated in the many video's that came after its release. That's another thing i hate. Why are people so impatient to get something out on the deadline? That usually ends up with tons of bugs and problems getting out into the wild.
 
user7015372
:45060696
 
@HSF3232 cost, every day you wait to ship is dollars not coming in
 
2:16 PM
ooooh C++17 has destructuring
 
@towc it does, and it is nice
it's already available in the majority of compilers too IIRC
at least the latest versions
 
yeah, I just used it kind of randomly expecting it not to work, with no additional flags on g++ 7.3
I had a warm fuzzy feeling inside
 
@towc yeah I did similar on VC++
it was nice to not use tuple
 
user7015372
Concerning the MinGW toolset, can you use a cross-built .la or .a file (That has been built on linux) on windows?
 
user7015372
As in, if i was to build a windows library using MinGW on my Linux build server, could i then use that library for development on Windows?
 
2:36 PM
@HSF3232 you need to cross compile to a DLL and a lib file
 
user7015372
@Mgetz I thought DLL and lib files were only for Visual Studio?
 
@HSF3232 no that's the format for windows
 
user7015372
Ugh, So Windows is that awkward that i have to use Visual Studio for every single piece of software i write on it?
 
@HSF3232 you don't?
it's a different OS, it has different conventions
 
user7015372
I'm using the MinGW toolset. By default, the software generates .a/.la files. Is there no suitable way to build DLL files using MinGW?
 
2:46 PM
@HSF3232 on linux or windows?
 
user7015372
Both.
 
that said I'm lazy and VS is stupid easy to use on windows
and free
 
user7015372
"Stupid easy", you can't say the same for me, unfortunately. Not worth the 20 or so GB that it is.
 
@HSF3232 don't install all of the toolsets?
 
user7015372
Still 20 GB or so.
 
user7015372
2:53 PM
You got the Windows SDK as well.
 
user7015372
(And yes, before you ask, i have a grudge against Microsoft. I have my reasons.)
 

« first day (3012 days earlier)      last day (1938 days later) »