Where can I find a good online OpenGL 3.0 tutorial that doesn’t use any deprecated functionality? [closed]

Stay away from NeHe, the tutorials are hopelessly outdated and contain a lot of “problematic” stuff, too. For starting with 3.x, try those, they’re both up-to-date: Aurian (Joe Groff) Arcsynthesis (Jason L. McKesson) Update: Re-reading my own post almost 2 years later, I guess that one might find that it sounds a bit harsh. This … Read more

Why Xcode does not show index options for CoreData entities and attributes?

As @tomharrington said, the solution is in the WWDC 2017 video: Indexing stuff begins at 10:32 and the demo at 16:40. It’s still possible to create and index via Xcode9: First, select your entity, long-click on the + (Add Entity), and select Add Fetch Index. Then, name your index appropriately, the select the property you … Read more

Alternative to contextlib.nested with variable number of context managers

The new Python 3 contextlib.ExitStack class was added as a replacement for contextlib.nested() (see issue 13585). It is coded in such a way you can use it in Python 2 directly: import sys from collections import deque class ExitStack(object): “””Context manager for dynamic management of a stack of exit callbacks For example: with ExitStack() as … Read more

Replacement for

text-align: center is what you should use. In fact, the ideal way is this: .center { text-align: center; } .center > div, .center > table /* insert any other block-level elements here */ { margin-left: auto; margin-right: auto; } Obviously, it’s not quite as simple as you might hope for. Personally, I just use: .center … Read more

Devise token_authenticatable deprecated, what is the alternative?

I wanted to keep backwards compatibility so I just moved everything into a concern to avoid the warning. Here’s my code and associated specs: /app/models/concerns/token_authenticatable.rb module TokenAuthenticatable extend ActiveSupport::Concern module ClassMethods def find_by_authentication_token(authentication_token = nil) if authentication_token where(authentication_token: authentication_token).first end end end def ensure_authentication_token if authentication_token.blank? self.authentication_token = generate_authentication_token end end def reset_authentication_token! self.authentication_token = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)