How to determine at run-time if app is for development, app store or ad hoc distribution?

The easiest way to check is to look at embedded.mobileprovision ([[NSBundle mainBundle] pathForResource:@”embedded.mobileprovision” ofType:nil]): It’s a bit of a pain to parse since it’s a signed plist (PKCS#7 signed data, according to openssl asn1parse -inform der), but a bad hack is to just look for <plist and </plist>. Development contains UDIDs and <key>get-task-allow</key><true/> Ad Hoc … Read more

SignedXml.CheckSignature fails in .NET 4 but it works in .NET 3.5, 3 or 2

This is a known issue. The Canonicalization implementation between .NET 3.5 and .NET 4.0 has changed. I don’t know if this works on all XML signatures but the following works from the testing that I’ve done. Add the following C14N Transform class to your project: public class MyXmlDsigC14NTransform: XmlDsigC14NTransform { static XmlDocument _document; public static … Read more

Is List

This method signature is “useful”, in the sense that you can implement non-trivial, non-degenerate methods with it (that is, returning null and throwing errors are not your only options). As the following example shows, such a method can be useful for implementing some algebraic structures like e.g. monoids. First, observe that List<? extends T> is … Read more

Maven verify signatures of downloaded pom/jar files

Now, that people seem to realize this is a real security problem (as described in this blog-post (the blog seems down, here is an archived version of the blog)), there is a plugin for verifying PGP signatures. You can verify the signatures for all dependencies of your project with the following command: mvn org.simplify4u.plugins:pgpverify-maven-plugin:check Of … Read more

Python – Facebook API – Need a working example

The unofficial fork of the python sdk is still working fine for me. To retrieve your friends, generate an access token here: https://developers.facebook.com/tools/access_token/ Limitations: A user access token with user_friends permission is required to view the current person’s friends. This will only return any friends who have used (via Facebook Login) the app making the … Read more

C function with no parameters behavior

In C++, void no_args() declares a function that takes no parameters (and returns nothing). In C, void no_args() declares a function that takes an unspecified (but not variable) number of parameters (and returns nothing). So all your calls are valid (according to the prototype) in C. In C, use void no_args(void) to declare a function … Read more

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