Very good explanation about GIL
Blog de Nabil BEN YOUSSEF
mardi 21 juin 2022
lundi 30 mai 2022
[Ubuntu] cannot click with the cursor
I can only write commands, make shortcuts and move the cursor(cannot click on anything).
killall -3 gnome-shell
mercredi 18 août 2021
Xbox Wireless Headset on Ubuntu
If the Xbox headset (bluetooth) constantly disconnects/reconnects.
Follow the steps described here : https://github.com/pipewire- debian/pipewire-debian/wiki to install PipeWire.
And configure the Sound settings as below.
When playing music (just headset output needed, good output quality), set :
- output
- device "Portable - Xbox Wireless Headset"
- configuration "High Fidelity Playback (A2DP Sink)"
- input
- device "Microphone - Built-in Audio"
When meeting (headset output and headset mic needed, but very bad output quality), set :
- output
- device "Portable - Xbox Wireless Headset"
- configuration "Headset Head Unit (HSP/HFP, codec mSBC)"
- input
- device "Portable - Xbox Wireless Headset"
- configuration "Headset Head Unit (HSP/HFP, codec mSBC)"
As we can see, we must switch manually, depending on if
- we want to enable the mic (with a bad output quality) for a meeting
- or if we want to mainly listen music (better output quality).
We cannot use A2DP (good output quality) with the mic enabled.
Why we cannot use A2DP when mic is enabled ?
The workaround is to create a script to switch easily between A2DP<->mSBC (music or meeting):
The script is here :
jeudi 20 juin 2019
[Python] Singleton
Multiple ways :
- Way 1
class MyClass:
def __init__(self):
pass
@classmethod
def get(cls):
try:
return cls.instance
except AttributeError:
cls.instance = MyClass()
return cls.instance
- Way 2
this = sys.modules[__name__]
class MyClass:
def __init__(self):
pass
def get_my_singleton():
try:
return this.my_singleton
except AttributeError:
this.my_singleton = MyClass()
return this.my_singleton
More details about this way: https://stackoverflow.com/a/35904211
try:
return this.my_singleton
except AttributeError:
this.my_singleton = MyClass()
return this.my_singleton
More details about this way: https://stackoverflow.com/a/35904211
lundi 10 juin 2019
[Python] Difference between package and module
A module is a file :-) Modules are used to keep logically related code functions/classes together.
A package is a folder containing a set of modules.
A package may contain sub-packages.
A package must have a __init__.py at the root of the directory. When a package is imported, this __init__.py file is implicitly executed. https://docs.python.org/3/reference/import.html#regular-packages
Packaging help you to keep logically related set of modules together just as modules are used to keep logically related code functions/classes together.
With Python 3.3 and later, a package is called a regular package, and a new type of package appears : namspace package. https://docs.python.org/3/reference/import.html#namespace-packages
A package is a folder containing a set of modules.
A package may contain sub-packages.
A package must have a __init__.py at the root of the directory. When a package is imported, this __init__.py file is implicitly executed. https://docs.python.org/3/reference/import.html#regular-packages
Packaging help you to keep logically related set of modules together just as modules are used to keep logically related code functions/classes together.
With Python 3.3 and later, a package is called a regular package, and a new type of package appears : namspace package. https://docs.python.org/3/reference/import.html#namespace-packages
vendredi 29 mars 2019
[Git] difference upstream / origin
upstream generally refers to the original repo that you have forked
origin is your fork: your own repo on GitHub, clone of the original repo of GitHub
origin is your fork: your own repo on GitHub, clone of the original repo of GitHub
git : reset your branch to the upstream branch
git checkout yourbranch
git remote add upstream https://.......
git fetch upstream
git reset --hard upstream/master
# take care, this will delete all your changes on your forked yourbranch
git push origin yourbranch --force
https://stackoverflow.com/a/42332860
git remote add upstream https://.......
git fetch upstream
git reset --hard upstream/master
# take care, this will delete all your changes on your forked yourbranch
git push origin yourbranch --force
git : how to do a local rebase
git clone <origin>
git checkout <featbranch>
git pull
git remote add upstream https://.....
git fetch upstream
git rebase upstream/development
git push
git checkout <featbranch>
git pull
git remote add upstream https://.....
git fetch upstream
git rebase upstream/development
git push
git : remove a submodule
git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
git rm -f a/submodule
Source : https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
rm -rf .git/modules/a/submodule
git rm -f a/submodule
Source : https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
Inscription à :
Articles (Atom)
Categories
- /etc/hosts (1)
- 443 (1)
- 80 (1)
- a2dp (1)
- addsubview (1)
- affix (1)
- amazon (1)
- android (6)
- angularjs (1)
- angularjs cross domain json post (1)
- angularjs ionic ng-click twice (1)
- animate (1)
- ansible (2)
- antlr (1)
- apache2 processes (1)
- app (1)
- app store (1)
- apple (1)
- appstore (1)
- avis (2)
- baignoire (1)
- basics (1)
- bitbucket (1)
- blackberry (1)
- bluetooth (1)
- booster (1)
- bootstrap (3)
- bottle (4)
- browsers (1)
- buffer (1)
- cherrypy (3)
- chromebook real life (1)
- coder (2)
- communicator (1)
- config.txt (1)
- creme chocolat (1)
- crepes bretonnes (1)
- crlf (1)
- css (2)
- cuisine (1)
- database (4)
- datatables (1)
- datetime (1)
- delete (1)
- disconnect (1)
- distributing (1)
- english (2)
- flask (1)
- fontawesome (1)
- francais (51)
- futuristic (1)
- game (1)
- gil (1)
- git (9)
- github (1)
- gratuit (2)
- hadopi (1)
- header (1)
- height zero (1)
- hibernate (1)
- hotel (2)
- http (1)
- https (2)
- ionic (2)
- ios (2)
- ios7 (1)
- iOS8 (1)
- iphone (1)
- jaune (1)
- java (7)
- javamelody (1)
- javascript (1)
- json (3)
- kindle (1)
- knockout (3)
- leaflet (1)
- legere (1)
- lf (1)
- life cycle (1)
- linkedin resume builder profile (1)
- linux (9)
- log (1)
- luxembourg (1)
- machine (1)
- maizena (1)
- minecraft (1)
- mobile (1)
- mongo (1)
- mongodb (3)
- mongodb mongo linux (1)
- multiple (1)
- myspace (1)
- mysql (1)
- netbeans cordova android cordova-plugin-file (1)
- nginx (2)
- nintendo (1)
- number (1)
- opensolaris (1)
- openstreetmap (1)
- oracle (15)
- order by (1)
- output (1)
- overclocking (1)
- packaging (1)
- parameters (1)
- personnaliser bootstrap (1)
- photos (1)
- pip (2)
- pipewire (1)
- prime (1)
- problem (2)
- project (1)
- publish (1)
- python (26)
- raspberry pi (2)
- raspi-config (1)
- recette (1)
- redirect (1)
- restful (2)
- schema (1)
- screen (1)
- screencast (1)
- script (1)
- scrollspy (1)
- serialization (1)
- sessions (2)
- shell (1)
- shutdown reboot linux reinstall apt-get (1)
- smartgwt (1)
- sncf (1)
- software (1)
- spring (1)
- sql (1)
- sticky footer (1)
- supervisor (1)
- systeme (1)
- tile (1)
- timestamp (1)
- title (1)
- tornado (3)
- turbo (1)
- ubuntu (2)
- uialertview (1)
- video capture (1)
- viewdidappear (1)
- viewdidload (1)
- viewwillappear (1)
- weasyprint (1)
- web (1)
- web2py (1)
- windows (5)
- worker (1)
- xbox wireless headset (1)
- xdk barcode scanner intel.xdk.device.barcode.scan (1)
- XDK rename project (1)
- xeno galaxies (1)