Wednesday, March 29, 2023

Toggle Visibility of a SelectBox with a CheckBox without JavaScript, only with CSS

<!DOCTYPE html>
<html>
<body>
<style>
  select {
    display: none;
  }
  .toggleselectbox:checked + .selectpivot {
    display: inline;
  }
</style>
<fieldset>
<legend>Display select box when the checkbox is checked:</legend>
<div class="custom-select" style="width:400px;">
<label for="toggleselectbox">Toggle pivot language</label>
<input type="checkbox" id="toggleselectbox" class="toggleselectbox" name="toggleselectbox" value="Toggle">
<select class="selectpivot" id="selectpivot">
    <option value="0" disabled>Select pivot language:</option>
    <option value="DE">DE</option>
    <option value="EN" selected>EN</option>
    <option value="RO">RO</option>
    <option value="IT">IT</option>
    <option value="SP">SP</option>
  </select>
</fieldset>
</div>
</body>
</html>
Display select box when the checkbox is checked:

Friday, March 17, 2023

Culori HTML

  1. Abanos - #000000
  2. Absint - #7fdd4c
  3. Acaju - #88421d
  4. Acaju închis - #2f1b0c
  5. Acvamarin - #79f8f8
  6. Alabastru - #fefefe
  7. Alb - #ffffff
  8. Alb de lapte - #fbfcfa
  9. Alb de Lună - #f4fefe
  10. Alb de Spania (pigment) - #fefdf0
  11. Alb de zinc (pigment) - #f6fefe
  12. Alb-roșcat - #e9c9b1
  13. Albastru canar - #048b9a
  14. Albastru celest - #26c4ec
  15. Albastru cobalt (pigment) - #22427c
  16. Albastru de chiciură - #80d0d0
  17. Albastru electric - #2c75ff
  18. Albastru foca - #03224c
  19. Albastru metalic - #3a8eba
  20. Albastru mineral - #24445c
  21. Albastru persan - #6600ff
  22. Albastru petrol - #1d4851
  23. Albastru primar - #0000ff
  24. Albastru regal - #318ce7
  25. Albastru safir - #0131b4
  26. Albastru turcoaz - #25fde9
  27. Albastrul cerului - #77b5fe
  28. Alună - #955628
  29. Ametist - #884da7
  30. Antracit - #303030
  31. Argilă - #efefef
  32. Argintiu - #cecece
  33. Arsenic - #fcd21c
  34. Arămiu - #ad4f09
  35. Asfințit - #ffcb60
  36. Auriu - #d2cb0f
  37. Avocado - #568203
  38. Azur (heraldic) - #1e7fcb
  39. Azur brumă - #f0ffff
  40. Azurin - #a9eafe
  41. Azuriu - #74d0f1
  42. Banană - #d1b606
  43. Bej - #c8ad7f
  44. Bitum - #4e3d28
  45. Blond (păr) - #e2bc74
  46. Blond flav (culoare) - #e6e697
  47. Blond venețian (păr) - #e7a854
  48. Bordo - #6d071a
  49. Bronz - #87591a
  50. Bronz - #614e1a
  51. Brun - #5b3c11
  52. Brun deschis - #cd853f
  53. Brun închis - #3f2204
  54. Brunet (ten, păr) - #2f1e0e
  55. Caca d'oie - #cdcd0d
  56. Cacao - #614b3a
  57. Cafea - #462e01
  58. Cafea cu lapte - #785e2f
  59. Cafeniu deschis (heraldic) - #a75502
  60. Caisă - #e67e30
  61. Capucin - #ff5e4d
  62. Caramel - #7e3300
  63. Carmin - #960018
  64. Castaniu - #8b6c42
  65. Castană - #806d5a
  66. Celadon - #83a697
  67. Cerulen - #357ab7
  68. Chamois - #d0c07a
  69. Chaudron - #85530f
  70. Chihlimbar galben - #f0c300
  71. Chihlimbar roșu - #ad390e
  72. Cinabre - #db1702
  73. Ciocolată - #5a3a22
  74. Cireașă - #bb0b0b
  75. Clarissimo (trabuc) - #b9b276
  76. Claro (trabuc) - #845a3b
  77. Claro claro (trabuc) - #ba9b61
  78. Coacăză neagră - #3a020d
  79. Coacăză roșie - #cf0a1d
  80. Coadă-de-vacă deschis - #c3b470
  81. Coadă-de-vacă închis - #a89874
  82. Coajă de ou - #fde9e0
  83. Coapsă de nimfă - #fee7f0
  84. Colombin (învechit) - #6a455d
  85. Colorado (trabuc) - #703516
  86. Colorado claro (trabuc) - #6a4b21
  87. Coral - #e73e01
  88. Cositor oxidat - #bababa
  89. Cositor pur - #ededed
  90. Crem - #fdf1b8
  91. Cupru - #b36700
  92. Căpșună - #bf3030
  93. Căpșună zdrobită - #a42424
  94. Cărbune - #000010
  95. Cărămiziu - #842e1b
  96. Denim - #1560bd
  97. Dovleac - #df6d14
  98. Drojdie de vin - #ac1e44
  99. Fier (heraldic) - #848484
  100. Fildeș - #ffffd4
  101. Fistic - #bef574
  102. Floare de sulf - #ffff6b
  103. Foc viu - #ff4901
  104. Foiță de ceapă (enologie) - #d58490
  105. Frunză moartă - #99512b
  106. Fucsia - #fd3f92
  107. Galben auriu - #efd242
  108. Galben canar - #e7f00d
  109. Galben de aur - #efd807
  110. Galben de crom (pigment) - #edff0c
  111. Galben de martie - #eed153
  112. Galben de Napoli (pigment) - #fff0bc
  113. Galben imperial - #ffe436
  114. Galben mimoză - #fef86c
  115. Galben muștar - #c7cf00
  116. Galben nanchin - #f7e269
  117. Galben nasture de aur - #f6dc12
  118. Galben pai - #fee347
  119. Galben porumb - #ffde75
  120. Galben puișor - #f7e35f
  121. Galben secundar - #ffff00
  122. Garoafă (heraldic) - #fec3ac
  123. Glycine - #c9a0dc
  124. Grej - #bbae98
  125. Grenadină - #e9383f
  126. Gri - #606060
  127. Gri afumat - #bbd2e1
  128. Gri bej (heraldic) - #f1e2be
  129. Gri cârtiță - #463f32
  130. Gri de in - #d2caec
  131. Gri de Payne - #677179
  132. Gri fier - #7f7f7f
  133. Gri gălbui (cabalin) - #c1bfb1
  134. Gri maur - #685e43
  135. Gri oțel - #afafaf
  136. Gri Pinchard (cabalin) - #cccccc
  137. Gri plumb - #798081
  138. Gri turturea - #bbacac
  139. Gri închis - #766f64
  140. Gri șoarece - #9e9e9e
  141. Grâu - #e8d630
  142. Havana - #947f60
  143. Heliotrop - #df73ff
  144. In - #faf0e6
  145. Indigo - #791cf8
  146. Indigo închis - #2e006c
  147. Jad - #87e990
  148. Kaki - #94812b
  149. Lapis-lazuli - #26619c
  150. Lavallière (copertă) - #8f5922
  151. Lavandă - #9683ec
  152. Liliac - #b666d2
  153. Lișiță - #008e8e
  154. Lămâie - #f7ff3c
  155. Mac - #c60800
  156. Maduro (trabuc) - #372f25
  157. Magenta fucsia (cerneală) - #db0073
  158. Magenta secundar - #ff00ff
  159. Magenta închis - #800080
  160. Malachită - #1fa055
  161. Mandarină - #fea347
  162. Maro - #582900
  163. Mastic - #b3b191
  164. Mentă - #16b84e
  165. Mentă de apă - #54f98d
  166. Miere - #dab30a
  167. Morcov - #f4661b
  168. Mov - #d473d4
  169. Nacarat - Roșu sidef - #fc5d5d
  170. Negru de anilină - #120d16
  171. Negru de carbon (pigment) - #130e0a
  172. Ocru - #fefee0
  173. Ocru galben - #dfaf2c
  174. Ocru roșu - #dd985c
  175. Oliv - #708d23
  176. Opalin - #f2ffff
  177. Orhidee - #da70d6
  178. Oscuro (trabuc) - #292107
  179. Papaia - #ffefd5
  180. Papier bulle - #edd38c
  181. Parma - #cfa0e9
  182. Passe-velours - #91283b
  183. Pastel - #56739a
  184. Pepene galben - #de9816
  185. Pervenche - #ccccff
  186. Piele de cămilă - #b67823
  187. Piersică - #fdbfb7
  188. Platină - #faf0c5
  189. Portocaliu - #ed7f10
  190. Portocaliu închis - #cc5500
  191. Prasin - #4ca66b
  192. Prună - #811453
  193. Purice - #4e1609
  194. Purpură - #9e0e40
  195. Purpură (heraldic) - #965578
  196. Pământ de Siena ars - #967c5c
  197. Rouge tomette - #ae4a34
  198. Roz - #fd6c9e
  199. Roz balais (minéraux) - #c4698f
  200. Roz bonbon - #f9429e
  201. Roz ceai - #ff866a
  202. Roz drajeu - #febfd2
  203. Roz Incarnadin - #fe96a0
  204. Roz Incarnat - #ff6f7d
  205. Roz Mountbatten - #997a8d
  206. Roșu - #ff0000
  207. Roșu Andrinopol - #a91101
  208. Roșu aprins - #ed0000
  209. Roșu Bismarck - #a5260a
  210. Roșu bourgogne - #6b0d0d
  211. Roșu cardinal - #b82010
  212. Roșu cărămiziu - #bc2001
  213. Roșu de alizarină (pigment) - #d90115
  214. Roșu de cuarț (heraldic) - #149414
  215. Roșu de roibă - #ee1010
  216. Roșu de sânge - #850606
  217. Roșu de tomată - #de2916
  218. Roșu englez - #f7230c
  219. Roșu Ferrari - #d32232
  220. Roșu Gueules (heraldic) - #e21313
  221. Roșu înfocat - #fe1b00
  222. Roșu-violet - #c71585
  223. Ruginiu - #985717
  224. Réglisse - #2d241e
  225. Sable - #e0cda9
  226. Scorțișoară - #7e5835
  227. Senois (heraldic) - #8d4024
  228. Sepia - #ae8964
  229. Smalt - #003399
  230. Smarald - #01d758
  231. Somon - #f88e55
  232. Stacojiu - #ff0921
  233. Sânge de vită - #730800
  234. Tabac - #9f551e
  235. Terre d'ombre - #926d27
  236. Terre de Sienne - #8e5434
  237. Topaz - #faea73
  238. Turcoaz - #2bfafa
  239. Turcoaz secundar - #00ffff
  240. Unt - #f0e36b
  241. Vanilie - #e1ce9a
  242. Verde amandă - #82c46c
  243. Verde anis - #9fe855
  244. Verde chartreuse - #c2f732
  245. Verde de apă - #b0f2b6
  246. Verde de Hooker - #1b4f08
  247. Verde de primăvară - #00fe7e
  248. Verde de sticlă - #096a09
  249. Verde de tei - #a5d152
  250. Verde de Verona (pigment) - #5a6521
  251. Verde de vezică - #22780f
  252. Verde englez - #18391e
  253. Verde gazon - #3a9d23
  254. Verde gri - #95a595
  255. Verde imperial - #00561b
  256. Verde kaki - #798933
  257. Verde lariță - #386f48
  258. Verde lichen - #85c17e
  259. Verde lime - #9efd38
  260. Verde marin - #649b88
  261. Verde militar - #596643
  262. Verde mușchi - #679f5a
  263. Verde măr - #34c924
  264. Verde opalin - #97dfc6
  265. Verde papagal - #3af24b
  266. Verde pin - #01796f
  267. Verde preri - #57d53b
  268. Verde primaire - #00ff00
  269. Verde salvie - #689d71
  270. Verde sapin - #095228
  271. Verde spanac - #175732
  272. Verde turcoaz - #1ffed8
  273. Violet - #8806ce
  274. Violet episcopal - #723e64
  275. Violine - #a10684
  276. Viride - #40826d
  277. Vișiniu - #6e0b14
  278. Zinzolin (fr) (Conabiu) - #6c0277
  279. Zmeură - #c72c48
  280. Șampanie - #fbf2b7
  281. șofran - #f3d617

HTML Colours - English

  1. aliceblue - #f0f8ff
  2. antiquewhite - #faebd7
  3. aqua / cyan - #00ffff
  4. aquamarine - #7fffd4
  5. azure - #f0ffff
  6. beige - #f5f5dc
  7. bisque - #ffe4c4
  8. black - #000000
  9. blanchedalmond - #ffebcd
  10. blue - #0000ff
  11. blueviolet - #8a2be2
  12. brown - #a52a2a
  13. burlywood - #deb887
  14. cadetblue - #5f9ea0
  15. chartreuse - #7fff00
  16. chocolate - #d2691e
  17. coral - #ff7f50
  18. cornflowerblue - #6495ed
  19. cornsilk - #fff8dc
  20. crimson - #dc143c
  21. darkblue - #00008b
  22. darkcyan - #008b8b
  23. darkgoldenrod - #b8860b
  24. darkgray - #a9a9a9
  25. darkgreen - #006400
  26. darkkhaki - #bdb76b
  27. darkmagenta - #8b008b
  28. darkolivegreen - #556b2f
  29. darkorange - #ff8c00
  30. darkorchid - #9932cc
  31. darkred - #8b0000
  32. darksalmon - #e9967a
  33. darkseagreen - #8fbc8f
  34. darkslateblue - #483d8b
  35. darkslategray - #2f4f4f
  36. darkturquoise - #00ced1
  37. darkviolet - #9400d3
  38. deeppink - #ff1493
  39. deepskyblue - #00bfff
  40. dimgray - #696969
  41. dodgerblue - #1e90ff
  42. firebrick (Fire Brick) - #b22222
  43. floralwhite - #fffaf0
  44. forestgreen - #228b22
  45. fuchsia / magenta - #ff00ff
  46. gainsboro - #dcdcdc
  47. ghostwhite - #f8f8ff
  48. gold - #ffd700
  49. goldenrod - #daa520
  50. gray - #808080
  51. green - #008000
  52. greenyellow - #adff2f
  53. honeydew - #f0fff0
  54. hotpink - #ff69b4
  55. indianred - #cd5c5c
  56. indigo - #4b0082
  57. ivory - #fffff0
  58. khaki - #f0e68c
  59. lavender - #e6e6fa
  60. lavenderblush - #fff0f5
  61. lawngreen - #7cfc00
  62. lemonchiffon - #fffacd
  63. lightblue - #add8e6
  64. lightcoral - #f08080
  65. lightcyan - #e0ffff
  66. lightgoldenrodyellow - #fafad2
  67. lightgray - #d3d3d3
  68. lightgreen - #90ee90
  69. lightpink - #ffb6c1
  70. lightsalmon - #ffa07a
  71. lightseagreen - #20b2aa
  72. lightskyblue - #87cefa
  73. lightslategray - #778899
  74. lightsteelblue - #b0c4de
  75. lightyellow - #ffffe0
  76. lime - #00ff00
  77. limegreen - #32cd32
  78. linen - #faf0e6
  79. maroon - #800000
  80. mediumaquamarine - #66cdaa
  81. mediumblue - #0000cd
  82. mediumorchid - #ba55d3
  83. mediumpurple - #9370db
  84. mediumseagreen - #3cb371
  85. mediumslateblue - #7b68ee
  86. mediumspringgreen - #00fa9a
  87. mediumturquoise - #48d1cc
  88. mediumvioletred - #c71585
  89. midnightblue - #191970
  90. mintcream - #f5fffa
  91. mistyrose - #ffe4e1
  92. moccasin - #ffe4b5
  93. navajowhite - #ffdead
  94. navy - #000080
  95. oldlace - #fdf5e6
  96. olive - #808000
  97. olivedrab - #6b8e23
  98. orange - #ffa500
  99. orangered - #ff4500
  100. orchid - #da70d6
  101. palegoldenrod - #eee8aa
  102. palegreen - #98fb98
  103. paleturquoise - #afeeee
  104. palevioletred - #db7093
  105. papayawhip - #ffefd5
  106. peachpuff - #ffdab9
  107. peru - #cd853f
  108. pink - #ffc0cb
  109. plum - #dda0dd
  110. powderblue - #b0e0e6
  111. purple - #800080
  112. red - #ff0000
  113. rosybrown - #bc8f8f
  114. royalblue - #4169e1
  115. saddlebrown - #8b4513
  116. salmon - #fa8072
  117. sandybrown - #f4a460
  118. seagreen - #2e8b57
  119. seashell - #fff5ee
  120. sienna - #a0522d
  121. silver - #c0c0c0
  122. skyblue - #87ceeb
  123. slateblue - #6a5acd
  124. slategray - #708090
  125. snow - #fffafa
  126. springgreen - #00ff7f
  127. steelblue - #4682b4
  128. tan - #d2b48c
  129. teal - #008080
  130. thistle - #d8bfd8
  131. tomato - #ff6347
  132. turquoise - #40e0d0
  133. violet - #ee82ee
  134. wheat - #f5deb3
  135. white - #ffffff
  136. whitesmoke - #f5f5f5
  137. yellow - #ffff00
  138. yellowgreen - #9acd32

Tuesday, March 14, 2023

Python - Get All Variables in a Module

Searching for: python get all variables in module

There are different ways to get all the variables in a Python module. One way is to use the dir() function, which returns a list of names of all the functions and variables present in a module1Another way is to use the inspect library, which has a getmembers() function that gets all the members, such as methods, variables, classes, etc., present inside a class or a module21.

1. tutorialspoint.com2. delftstack.com3. stackoverflow.com4. stackoverflow.com5. w3schools.com

Searching for: python get variables of a module

To get the variables of a module, you can use the getattr() function, which takes a module object and a variable name as arguments and returns the value of that variable1Another way is to use the vars() function, which returns a dictionary of all the attributes and values of a module object2.

1. stackoverflow.com2. stackoverflow.com3. w3schools.com

Here are some examples of how to use the getattr() and vars() functions to get the variables of a module.

Let’s say you have a module called mymodule.py that contains the following code:

# mymodule.py

x = 10

y = 20

z = 30

def add(a, b):

    return a + b

To get the value of the variable x from this module, you can use the getattr() function like this:

# another file that imports mymodule

import mymodule

x_value = getattr(mymodule, "x")

print(x_value) # prints 10


 

To get a dictionary of all the attributes and values of this module, you can use the vars() function like this:

# another file that imports mymodule

import mymodule

mymodule_dict = vars(mymodule)

print(mymodule_dict) # prints {'__name__': 'mymodule', '__doc__': None, '__package__': None, '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x000001E9B6F8A4C0>, '__spec__': None, '__file__': 'C:\\Users\\User\\Desktop\\mymodule.py', '__cached__': None, 'x': 10, 'y': 20, 'z': 30, 'add': <function add at 0x000001E9B6F8A940>}

I hope these examples help you understand how to get the variables of a module in Python.

How do I filter out only the variables and not the functions or other attributes?

Searching for: python filter variables from module dictionary

To filter out only the variables and not the functions or other attributes from a module dictionary, you can use a filtering function that checks the type of each value. For example, you can use the isinstance() function to check if a value is an instance of a certain class, such as intstrfloat, etc. You can also use the filter() function to apply the filtering function to each key-value pair in the dictionary and return an iterable of the filtered items1.

Here is an example of how to filter out only the variables from the module dictionary we got earlier:

# another file that imports mymodule

import mymodule

mymodule_dict = vars(mymodule)

# define a filtering function that returns True if the value is an instance of int, str or float

def is_variable(item):

    key, value = item # unpack each key-value pair into two variables

    return isinstance(value, (int, str, float)) # check if value is an instance of int, str or float

# use filter() to apply the filtering function to each item in mymodule_dict and get an iterable of filtered items

filtered_items = filter(is_variable, mymodule_dict.items())

# convert filtered_items into a dictionary using dict()

filtered_dict = dict(filtered_items)

print(filtered_dict) # prints {'x': 10, 'y': 20, 'z': 30}