Dima
std::string is retarded
Dima
my implementation is much more faster lol
Marián
my implementation is much more faster lol
well how do u implement string in general?
Dima
I told you before
божн бляьь відкрий нахуй двері я галсту забув
There's boost::container::small_vector where you can predefine elements count that will be stored on stack, but there's not any small_string
actually, you could get the same with std::array, but you loose special functionality of strings, it'll be just array of chars
Anonymous
so it's like dynamically allocated thing but on stack?
Initially you give stack capacity (should be known at compile time) and when it runs away of stack memory it appends to heap
божн бляьь відкрий нахуй двері я галсту забув
https://en.cppreference.com/w/cpp/container/array
божн бляьь відкрий нахуй двері я галсту забув
the same
Anonymous
Lol
Anonymous
It is not
божн бляьь відкрий нахуй двері я галсту забув
not actually the same
Anonymous
Google what small_vector is
Marián
I told you before
hah i see sorry
божн бляьь відкрий нахуй двері я галсту забув
Anonymous
my implementation is much more faster lol
Bet your benchmarks are shit
Marián
k, next thing, c++ file streams or fread and fopen?
Dima
imo
божн бляьь відкрий нахуй двері я галсту забув
Dima
no
Anonymous
no
Слился
Dima
I don’t care
Dima
use whatever you want
Anonymous
Слился
Idk how it will be in English
Anonymous
noob
You too
Dima
:)
Marián
lol
божн бляьь відкрий нахуй двері я галсту забув
no
i'm actually interested
Dima
there’s no link, that was my exploration lol
Marián
how are c++ file streams over fopen?
Marián
performance-wise
Dima
it’s good
Dima
not sure about performance, never wondered about this one
Marián
hmm okay
manas
Quick question: Would you recommend Vim in 2020?
Yes. You can also use Vim extensions for your IDE and use both Vim and an IDE
Nils
Is every kernel written in C?
klimi
No
Nils
In which language are windows and mac written?
klimi
Windows AFAIK c++ Mac.... No idea...
klimi
Check wiki
Marián
In which language are windows and mac written?
u may be interested in reactos btw
Nils
I am aware of it 😉
Dima
Windows AFAIK c++ Mac.... No idea...
Mac is written in C (BSD/Darwin) + Objective C for UI/higher level stuff
Nils
PMs random people for help
Dilara
Hey how can i solve plus minus game?
Dilara
I mean what is algorithm for this game?
Сарвар
create a new stack. the sequence of elements in which the reverse is relative to the first stack. please, help
I_Interface
/warn @TheFrenchCarrier PMing without asking a permission.
Bunyamin
Helpp
Dima
Helpp
use std::cin instead of getline
Dima
and read the rules, post a screenshot, not a photo of screen
Mateo
In fact, I'm not quite sure if the compiler thinks about cache at all. That's some optimizations that maybe the compiler can't help
About this, I just improved another 20% over this little snippet, and it didn't have anything to do with cache 😎
Mateo
Mateo
Im surprised -O3 didn't catch that, knowing that div is slower than mul
Francisco
What language are you using?
Mateo
it is just pseudocode, but the idea was the same for c
Mateo
it was a three level deep for loop, with an assignation with a division
Mateo
and I changed it to a multiplication, and voila, 20%
Francisco
Keep in mind that the compiler is also quite conservative in some optimizations, as it cannot asume certain things about the code
Francisco
For example, that snippet may work for you, but for other projects it could mean rounding errors that mess up everything
Mateo
Oh you are right
Mateo
I don't know how division works internally, but wouldn't it have the same precision as a multiplication?
Francisco
One of the biggest issues in floating-point arithmetic is that it's not commutative (that means a * b =/= b * a), and it's something that you have to get your mind around it
Mateo
I thing it makes sense, probably doing a/3 is more precise than a * (1 / 3) = a * 0.333334
Francisco
Also, your code wouldn't work at all with integers
Mateo
However in this context it makes sense for me, I will look up for some flags for these things
Mateo
One of the biggest issues in floating-point arithmetic is that it's not commutative (that means a * b =/= b * a), and it's something that you have to get your mind around it
I just tried with -Ofast which includes -ffast-math and it did the same optimization 😩 I was happy I was beating the compiler
Anonymous
Best software....for 'C'
Artöm
Software to do what?
Anonymous
import 'package:flutter/material.dart'; import 'package:flights_app/flight_model.dart'; import 'package:flights_app/flights_details_screen.dart'; class FlightCard extends StatelessWidget{ final Flight flight; final String fullName; final bool isClickable; FlightCard({this.flight, this.fullName, @required this.isClickable}); _cityStyle(code, cityName, time){ return Expanded( child: Column( children: <Widget>[ Text(code, style: TextStyle( color: Colors.black, fontSize: 40.0, fontWeight: FontWeight.bold ),), Text(cityName, style: TextStyle(fontSize: 18.0),), SizedBox(height: 10.0,), Text(time, style: TextStyle(color: Colors.grey, fontSize: 14.0),) ], ), ); } @override Widget build(BuildContext context) { return GestureDetector( onTap: (){ isClickable? Navigator.of(context).push( MaterialPageRoute( builder: (context) => FlightDetailScreen( passengerName: fullName, flight: flight, ) ) ):; }, child: Card( elevation: 5.0, margin: EdgeInsets.all(0.0), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)), child: Container( child: Padding( padding: const EdgeInsets.symmetric( vertical:20.0), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ _cityStyle(flight.from, flight.fromCity, flight.departTime), Icon(Icons.airplanemode_active), _cityStyle(flight.to, flight.toCity, flight.arriveTime), ], ), ), ), ), ); } }
Anonymous
Hi. Can someone guide me with calling a function from the memory? For example, if a function is located at 0x1088a6290, how can I call it?
Artöm
And do you know the type of this function? Amount and types of arguments?
Anonymous
Da fuq
Pls speak in English