iphone local notification in simulator

Yes, local notifications work with the simulator. However, make sure you are implementing application:didreceiveLocalNotification in your app delegate if you want to see the notification while your app is in the foreground: – (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@”MyAlertView” message:notification.alertBody delegate:self cancelButtonTitle:@”OK” otherButtonTitles:nil]; [alertView show]; if (alertView) { [alertView release]; … Read more

Defining Setter/Getter for an unparented local variable: impossible?

This is currently possible in environments with Proxies. That would be node > 0.6 run as node –harmony_proxies or >0.7 with node –harmony. Chromium Canary (not sure if it’s out of that yet) in about:flags at the bottom, experimental javascript. Firefox has had it for a while with no flags. So this probably won’t work … Read more

How to make a local variable (inside a function) global [duplicate]

Here are two methods to achieve the same thing: Using parameters and return (recommended) def other_function(parameter): return parameter + 5 def main_function(): x = 10 print(x) x = other_function(x) print(x) When you run main_function, you’ll get the following output >>> 10 >>> 15 Using globals (never do this) x = 0 # The initial value … Read more

Error message when starting vim: “Failed to set locale category LC_NUMERIC to en_CH” (or en_BR, en_RU & LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES)

First, access your .bash_profile file by typing the following (using vim as text editor): vim ~/.bash_profile Inside the file .bash_profile, insert the following line: export LC_ALL=en_US.UTF-8 Note, however, that newer versions of macOS ship with zsh instead of bash as the default shell. If this is the case with your Mac, you will have to … Read more

Use multiple local strategies in PassportJS

You can name your local strategies to separate them. // use two LocalStrategies, registered under user and sponsor names // add other strategies for more authentication flexibility passport.use(‘user-local’, new LocalStrategy({ usernameField: ’email’, passwordField: ‘password’ // this is the virtual field on the model }, function(email, password, done) { User.findOne({ email: email }, function(err, user) { … Read more