Zobrazit příspěvky

Tato sekce Vám umožňuje zobrazit všechny příspěvky tohoto uživatele. Prosím uvědomte si, že můžete vidět příspěvky pouze z oblastí Vám přístupných.


Příspěvky - Cyklopruh

Stran: [1]
1
Software / Re:Soustava lineárních rovnic
« kdy: 13. 06. 2021, 21:24:37 »
Třeba v Pythonu takovéhle věci zvládne solve_poly_system z knihovny sympy
https://docs.sympy.org/latest/modules/polys/basics.html#solving-equations

2
Hardware / Re:Bluetooth sluchatka se neumí znovu připojit
« kdy: 24. 03. 2021, 17:26:47 »
Ok... Ještě se dá získat log bluetoothd (aspoň teda na Ubuntu: zastavit systemctl stop bluetooth.service, spustit bluetoothd -d. Pak loguje do /var/log/syslog). Třeba tam něco bude, víc k tomu asi neřeknu.

3
Hardware / Re:Bluetooth sluchatka se neumí znovu připojit
« kdy: 23. 03. 2021, 12:29:14 »
Je zařízení nastavené jako trusted?

Kód: [Vybrat]
bluetoothctl info

4
Vývoj / Re:C++ downcast this v předkovi na potomka
« kdy: 14. 02. 2021, 20:01:43 »
V konstruktoru předka nelze objekt "downcastnout" na potomka, objekt se chová jako instance předka.

Z working draft (N4861, https://timsong-cpp.github.io/cppwp/n4861/class.cdtor):
Citace
The typeid operator ([expr.typeid]) can be used during construction or destruction ([class.base.init]).
When typeid is used in a constructor (including the mem-initializer or default member initializer ([class.mem]) for a non-static data member) or in a destructor, or used in a function called (directly or indirectly) from a constructor or destructor, if the operand of typeid refers to the object under construction or destruction, typeid yields the std​::​type_­info object representing the constructor or destructor's class.
If the operand of typeid refers to the object under construction or destruction and the static type of the operand is neither the constructor or destructor's class nor one of its bases, the behavior is undefined.

Ze stejného důvodu v té druhé ukázce ten dynamic_cast "selže" a hodnota proměnné derived je nullptr.

Co třeba pro vytváření objektu místo přímo make_shared použít nějakou vlastní podobnou funkci, která nejdříve objekt vytvoří, a pak buď přímo provede ten výpis nebo teda zavolá tu virtuální metodu na tom hotovém objektu.

5
Software / Re:Zvýraznění určité části výstupu grepu
« kdy: 17. 09. 2020, 15:07:52 »
Pozici začátku matche, tj. odkud se zvýrazňuje, lze nastavit příkazem \K.
Kód: [Vybrat]
grep -Pi '01\]: [^ ]+ \K([^ ]+)'

Stran: [1]