local

spark1.4 Windows local调试环境搭建总结

笑着哭i 提交于 2019-11-29 06:21:17
spark1.4 Windows local调试环境搭建总结 1.scala版本 scala-2.10.4 官方推荐 scala-2.11.7【不推荐,非sbt项目、需要后加载】 2.spark版本 spark-1.4.0-bin-hadoop2.6.tgz 3.hadoop 3.1版本 hadoop-2.6.0.tar.gz 3.2环境变量 HADOOP_HOME=E:/ysg.tools/spark/hadoop-2.6.0 或 System.setProperty("hadoop.home.dir", "E:\ysg.tools\spark\hadoop-2.6.0"); 3.3winutils.exe winutils.exe拷贝至spark/hadoop-2.6.0/bin 文件下载地址 http://files.cnblogs.com/files/yjmyzz/hadoop2.6%28x64%29V0.2.zip 4.idea 新建 NO-SBT项目 libraties 增加 scala sdk spark-1.4.0-bin-hadoop2.6\lib\spark-assembly-1.4.0-hadoop2.6.0.jar spark.test.iml 先加载 spark-assembly-1.4.0-hadoop2.6.0 再加载 scala-sdk-2.11.7

PHP $this variable

对着背影说爱祢 提交于 2019-11-29 06:13:53
问题 I am reading some PHP code that I could not understand: class foo { function select($p1, $dbh=null) { if ( is_null($dbh) ) $dbh = $this->dbh ; return; } function get() { return $this->dbh; } } I can't find $this->dbh ($dbh) declaration from the class. My questions are: What is the value of $this->dbh ? Is it a local variable for function select() ? Does $this belong class foo 's data member? Why is there no declaration for $dbh in this class? 回答1: PHP is not strict about requiring class

Display local image in iPhone HTML mail

自闭症网瘾萝莉.ら 提交于 2019-11-29 05:12:33
In my app, I am composing an HMTL email message with the 3.0+ MFMailComposeViewController . To do this, I created an HTML file, with some placeholders. In my code, I read the HTML file, and with replaceOccurrencesOfString , I replace the placeholders with data from the app. In that way, I compose the body of the email I want to send out. This is all working very nicely, except for the fact, that in my HTML file, I have an <img src='imageplaceholderpath' /> tag. Somehow, I cannot figure out, with what I should replace this imageplaceholderpath , in order to refer to an image that resides in my

Java: “Local variable may not have been initialized” not intelligent enough?

故事扮演 提交于 2019-11-29 04:44:54
Consider the following method: void a () { int x; boolean b = false; if (Math.random() < 0.5) { x = 0; b = true; } if (b) x++; } On x++ I get the "Local variable may not have been initialized" error. Clearly x will never be used uninitialized. Is there any way to suppress the warning except by initializing x? Thanks. No, there is no way Java can examine all possible code paths for a program to determine if a variable has been initialized or not, so it takes the safe route and warns you. So no, you will have to initialize your variable to get rid of this. Denys Séguret There is one : void a ()

SVN: How do I maintain my local config.blah file?

雨燕双飞 提交于 2019-11-29 03:07:37
问题 On the SVN server, there is a file called config.conf . I have a local version called the same thing (in the same place). How can I make sure that my local config does not get overwritten, nor checked in? While I'm here, is the answer different for a directory? I'm using Tortoise SVN, but command line answers are cool. Thanks! [Sorry if this basic question has been asked before... I looked but didn't find it.] 回答1: SVN will always think that that file is part of the repository if you name it

Eclipse's local history…where are files saved?

白昼怎懂夜的黑 提交于 2019-11-29 02:53:45
Can someone explain how Eclipse's local history works? I accidentally overwrote a file in a project but need to revert to an earlier version. Is there a chance that Eclipse has the older file cached somewhere? To complete CurtainDog's answer: from eclipse FAQ Every time you modify a file in Eclipse, a copy of the old contents is kept in the local history. At any time, you can compare or replace a file with any older version from the history. Although this is no replacement for a real code repository, it can help you out when you change or delete a file by accident. Local history also has an

iPhone: How to set repeat daily/hourly local notification?

亡梦爱人 提交于 2019-11-29 02:44:20
I want to test add local notification. I want it repeat daily/hourly. How can I do that? NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar]; // Get the current date NSDate *now = [NSDate date]; // Break the date up into components NSDateComponents *dateComponents = [calendar components:( NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit ) fromDate:now]; NSDateComponents *timeComponents = [calendar components:( NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate:now]; // Set up the fire time NSDateComponents *dateComps = [[NSDateComponents alloc]

setting seed locally (not globally) in R

笑着哭i 提交于 2019-11-29 02:24:30
问题 I'd like to set seeds in R only locally (inside functions), but it seems that R sets seeds not only locally, but also globally. Here's a simple example of what I'm trying (not) to do. myfunction <- function () { set.seed(2) } # now, whenever I run the two commands below I'll get the same answer myfunction() runif(1) So, my questions are: why does R set the seed globally and not only inside my function? And how I can make R to set the seed only inside my function? 回答1: Something like this does

Loading local html file in webView android

寵の児 提交于 2019-11-29 00:20:39
问题 I have to load an existing html file into a WebView that is located at this path in the file system: /data/data/com.example.example/files/file.html But, when the WebView loads it, I don't see anything. Who can help me? WebView code (assuming path is the path I've written above): WebView webView = (WebView)findViewById(R.id.webView1); File htmlFile = new File(path); if(htmlFile.exists()) { webView.loadUrl(htmlFile.getAbsolutePath()); } 回答1: Try this, adding in a file:/// and doing it a little

Is it possible to run .php files on my local computer? [duplicate]

微笑、不失礼 提交于 2019-11-28 23:18:19
Possible Duplicate: PHP server on local machine? Is it possible to run .php files on my local computer? I know if i open up a web browser and enter the file location into the URL for HTML files, the html file will run and display. Is there a way to do the same with .php files? AlienWebguy Sure you just need to setup a local web server. Check out XAMPP: http://www.apachefriends.org/en/xampp.html That will get you up and running in about 10 minutes. There is now a way to run php locally without installing a server: https://stackoverflow.com/a/21872484/672229 Yes but the files need to be