local

iphone local notification in simulator

帅比萌擦擦* 提交于 2019-11-27 18:08:17
I just downloaded xcode and trying to make local notification example. The question is if local notification works in simulator? thank you bojolais 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

Lambdas and capture by reference local variables : Accessing after the scope

纵饮孤独 提交于 2019-11-27 15:05:31
I am passing my local-variables by reference to two lambda. I call these lambdas outside of the function scope. Is this undefined ? std::pair<std::function<int()>, std::function<int()>> addSome() { int a = 0, b = 0; return std::make_pair([&a,&b] { ++a; ++b; return a+b; }, [&a, &b] { return a; }); } int main() { auto f = addSome(); std::cout << f.first() << " " << f.second(); return 0; } If it is not, however, changes in one lambda are not reflected in other lambda. Am i misunderstanding pass-by-reference in context of lambdas ? I am writing to the variables and it seems to be working fine with

Should I use “this” keyword when I want to refer to instance variables within a method?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 14:58:08
My teacher says that when I try to access an instance variable within a method I should always use the this keyword, otherwise I would perform a double search. A local scope search and then an instance scope search. Example: public class Test(){ int cont=0; public void Method(){ System.out.println(cont);//Should I use This.cont instead? } } I hope he is wrong, but I can't find any argument. No, only use this when you have a name conflict such as when a method parameter has the same name as an instance field that it is setting. It can be used at other times, but many of us feel that it simply

how to deploy shiny app that uses local data

感情迁移 提交于 2019-11-27 14:49:58
I'm deploying my shiny app and I don't know how to input my a local dataset. I keep getting Error: object "data" not found . Here is my path to shiny folder. library(shinyapps) shinyapps::deployApp('C:\\Users\\Jeremy\\Desktop\\jerm2') In this directory (jerm2), I have 3 things: ui.R , server.R , and my local dataset, a .csv called proj.csv . In the server.R file, I set data<-read.csv("proj.csv") I just don't know how to get Shiny to pick up my datasets. You may want to add a subdirectory in your shiny folder called "Data" and put proj.csv there. Then, in your server.r put: data<-read.csv(".

How do I install Perl modules on machines without an Internet connection?

旧城冷巷雨未停 提交于 2019-11-27 14:22:57
I need to install my Perl-based software on networked machines which aren't connected to the internet. Therefore, I would like to download specific versions and/or latest versions of the Perl modules and I would also like to know if there is an install procedure required for these modules. Background: The machines aren't connected to the internet for security reasons and its deemed unnecessary also. I would place the downloaded modules on a machine that I call the 'install server' and it contains my Perl based software and would also contain the local copies of the Perl modules. I call a

WAMP: Missing http://localhost/ in urls , wrong wamp projects links

夙愿已清 提交于 2019-11-27 13:18:53
I have a problem with Wamp which never happened to me before, cannot find what's wrong. I have a few projects located in my www folder ( running windows 7 ). My hostfile has the line 127.0.0.1 localhost uncommented When I go to http://localhost/ or http://127.0.0.1/ and click on a project name like "mysite" from the main Wamp panel page, the link just points to "mysite" and not "http://localhost/mysite" Therefore I can't see any sites, what should I do ? Adeniji Olasunkanmi After thorough research, I found out the solution which worked for me as well.. open wamp/www/index.php. Change this line

Does it help GC to null local variables in Java

戏子无情 提交于 2019-11-27 11:27:13
I was 'forced' to add myLocalVar = null; statement into finally clause just before leaving method. Reason is to help GC. I was told I will get SMS's during night when server crashes next time, so I better did it :-). I think this is pointless, as myLocalVar is scoped to method, and will be 'lost' as soon as method exits. Extra nulling just pollutes the code, but is harmless otherwise. My question is, where does this myth about helping GC come from? (I was referred to "Java memory books") Do you know any article from 'authorities' which explain it in more depth? Is there possibility this is not

Javascript: Download data to file from content within the page

余生颓废 提交于 2019-11-27 11:15:46
问题 setting is the following: I have a homepage where I display a diagram that has been constructed using comma seperated values from within the page. I'd like to give users the possibility to download the data as cvs-file without contacting the server again. (as the data is already there) Is this somehow possible? I'd prefer a pure JavaScript solution. So far I've discovered: http://pixelgraphics.us/downloadify/test.html but it involves flash which I'd like to avoid. I can't imagine this

Unable to start/launch local mongo db

与世无争的帅哥 提交于 2019-11-27 09:18:48
问题 I'm new to MongoDB. I currently have a dump of a mongo db (i.e. directory of .bson files) and am trying to import that into mongo. I installed mongo as per the instructions on http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/. I'm currently trying to test starting a local mongo instance by running mongod --dbpath /path/to/my/mongodata (which is an empty directory). I get the following in stdout: Thu Sep 20 09:46:01 [initandlisten] MongoDB starting : pid=1065 port=27017 dbpath=

jQuery code doesn't work if I'm using a local jquery.js file, why?

不问归期 提交于 2019-11-27 09:09:00
Let's say this my page for example .. <!doctype html> <html> <head> </head> <body> <script src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ }); </script> <div id="div1"></div> </body> </html> As you see I'm using a local jQuery file ( jquery.js ) so every time I write jQuery code it doesn't work knowing that both of my page and jquery.js in same level .. But when I'm using a jQuery file online, like this for example <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> everything works fine.. Also I tried to put <script><