Tired of writing complex and lengthy filters just to prepare some data? Try out one of these for size. List comprehensions. They rule.
The Problem: SteamApi exists, but there is no api call that exposes the top games or provides the query set with any kind of sort– nor can we use an existing endpoint and just use some filter params. That’s okay, we didn’t need it anyways– w’re just gonna scrape it. The Plan: […]
The Problem: A Botnet is spamming your server. Spamfilter isn’t working. Time to get crafty. “ΑTTⲚ： This ⅽhɑnᥒеl һɑs moᴠеd to irc．frеeᥒоdᥱ.net #⁄jоiᥒ” “AΤΤⲚ: Thⅰѕ chɑnnel haѕ moᴠed tഠ irc.frᥱeᥒoⅾе.nᥱt #／јoіn” “ATTΝ፡ Тhiѕ cһaᥒnel һas mоᴠed tഠ irc.frееnode.net ﹟∕jⲟin” “AТΤN: Thiѕ chaᥒᥒel has mоveⅾ to іrс.frеenoⅾе.ᥒᥱt ＃/јoⅰᥒ” “AТTN﹕ Thiѕ cһannеl һaѕ mo⋁eԁ to irc․freenoⅾᥱ․nеt #/јoіn” “ΑΤTN︓ Tһis chɑnnᥱl hаѕ moved tο irc.freenode．ᥒet #/ϳoiᥒ” “ΑTТN: Ꭲhis ϲһɑnnel һaѕ moᴠed to ⅰrc．frеeᥒoԁе.ᥒet ＃⧸joіn” “ATTN: This ⅽһannel һas mοvеd to irc.frᥱеnοԁе.net #/join” Notice […]
We’ve all been there. You want more control over your audio devices and the signal stream, and all of the existing solutions are terrible things made by terrible people. Enough is too much. Its time to take matters into your own hands. You are going to write an audio device that does exactly what you […]
Managing multiple versions of Python is not an easy task and sometimes it even gets worse when you want to develop multiple projects with different Python versions. All of the pythons, and none of the bullshit. Let it be done.
lst = [‘a’, ‘ab’, ‘abc’, ‘bac’] res = [k for k in lst if ‘ab’ in k] res > [‘ab’, ‘abc’] Another way is to use the filter function: filter(lambda k: ‘ab’ in k, lst) > [‘ab’, ‘abc’] Given the list [‘a’,’ab’,’abc’,’bac’], I want to compute a list with strings that have ‘ab’ in them. […]