FooBar i klawiatura multimedialna pod Windows

Od samego początku moja ulubiona klawiatura multimedialna Microsoftu miała problem by obsługiwać cokolwiek innego niż Windows Media Player. Kiedyś udało mi się doprowadzić do tego by działa ok z Winampem, ale ten stał się bloatware i zamiast grać muzykę, zaczął tańczyć śpiewać i gotować, przyszedł czas na ascetyczny, minimalistyczny i …

Cleanest, fastest way to filter one element from the python list

Use generator comprehensions. If you want to find one and just one element or None use default argument in call for next, it won’t raise StopIteration if the item was not found in the list: first_or_default = next((x for x in lst if …), None)

Removing Models from Google App Engine at minimum cost

There come times when data schema changes so you’ll have to remove some models by the bunch. AFAIK there is no currently a „TRUNCATE TABLE MyKind” or „DROP TABLE MyKind” equivalent in Google App Engine data store, so you’ll have to write an ordinary request handler to do the bidding or use MapReduce. …

Get beginning of the day datetime -aka today’s midnight – in T-SQL

By default I avoid putting any business logic into SQL. IMO it’s a good rule-of-thumb, but people often argue about it. I forget why it’s good rule, because I use it, but then every once for a while I need to put some little logic into SQL because it’s convenient, …

Group policy „Only allow local user profiles” – does not apply

My test environment has multiple virtual machines. Some of those machines are in a test sub-domain – it’s convenient to use my normal domain credentials to authenticate in test environment. I am also using roaming profile, and it’s inconvenient to have it all over test environment. There is nice GPO: …

JSON serialization of Google App Engine models

For some AJAX requests you’ll need an rpc urls returning a serialized objects. In principle its simple just use JSON serialization build in in Django or simplejson module itself. Here are sample view methods: def entity_list(request, entity_key=None): user = users.get_current_user().email().lower(); col = models.Entity.gql(’WHERE user=:1′,user).fetch(300, 0) json = serializers.serialize(„json”, col) return …

Back to Top