Hidden features of CSS [closed]
You can display the document’s title element: head, title { display: block; }
You can display the document’s title element: head, title { display: block; }
insert preceding line’s final parameter alt–. the most useful key combination ever, try it and see, for some reason no one knows about this one. press it again and again to select older last parameters. great when you want to do something else to something you used just a moment ago.
Since you put up a bounty, I’ll share my hard won secrets… In general, all the SQLs I tuned today required using sub-queries. Having come from Oracle database world, things I took for granted weren’t working the same with MySQL. And my reading on MySQL tuning makes me conclude that MySQL is behind Oracle in … Read more
If you like your code to look as good as it runs, you’ve undoubtedly used #pragma mark – and #pragma mark <name> to provide a nice visual grouping in the Xcode class dropdown list. Xcode 4 now combines these into a single #pragma mark – <name>. More on pragma mark.
Using a protocol-independent absolute path: <img src=”//domain.example/img/logo.png”/> If the browser is viewing an page in SSL through HTTPS, then it’ll request that asset with the HTTPS protocol, otherwise it’ll request it with HTTP. This prevents that awful “This Page Contains Both Secure and Non-Secure Items” error message in IE, keeping all your asset requests within … Read more
Most C++ programmers are familiar with the ternary operator: x = (y < 0) ? 10 : 20; However, they don’t realize that it can be used as an lvalue: (a == 0 ? a : b) = 1; which is shorthand for if (a == 0) a = 1; else b = 1; Use … Read more
Hopefully there aren’t too many hidden, hidden features – but here’s some of the less well known and non-intuitive features available for Android that will definitely make your life easier and your apps better. All the source code for the platform and all the non-Google native apps is available for you to browse, download, borrow, … Read more
The Exception When clause is largely unknown. Consider this: Public Sub Login(host as string, user as String, password as string, _ Optional bRetry as Boolean = False) Try ssh.Connect(host, user, password) Catch ex as TimeoutException When Not bRetry ”//Try again, but only once. Login(host, user, password, True) Catch ex as TimeoutException ”//Log exception End Try … Read more
Multibinding (combined with StringFormat): <TextBlock> <TextBlock.Text> <MultiBinding StringFormat=”{}{0}, {1}”> <Binding Path=”LastName” /> <Binding Path=”FirstName” /> </MultiBinding> </TextBlock.Text> </TextBlock>
More of a trick of the GCC compiler, but you can give branch indication hints to the compiler (common in the Linux kernel) #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) see: http://kerneltrap.org/node/4705 What I like about this is that it also adds some expressiveness to some functions. void foo(int arg) { if (unlikely(arg == 0)) { … Read more