local

Eclipse's local history…where are files saved?

混江龙づ霸主 提交于 2019-12-03 18:00:18
问题 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? 回答1: 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

Is it possible to create function-local closures pre-C++11?

烈酒焚心 提交于 2019-12-03 16:46:59
With C++11, we get lambdas, and the possibility to create functions/functors/closures on-the-fly where we actually need them, not somewhere where they don't really belong. In C++98/03, a nice way to make function-local functors/closures would've been the following: struct{ void operator()(int& item){ ++item; } }foo_functor; some_templated_func(some_args, foo_functor); Sadly, you can't use local types for templates (Visual Studio allows this with language extensions enabled). My train of though then went the following way: struct X{ static void functor(int& item){ ++item; } }; some_templated

Loading fixed-width, space delimited .txt file into mySQL

自作多情 提交于 2019-12-03 15:32:28
I have a .txt file that has a bunch of formatted data in it that looks like the following: ... 1 75175.18 95128.46 1 790890.89 795829.16 1 875975.98 880914.25 8 2137704.37 2162195.53 8 2167267.27 2375275.28 10 2375408.74 2763997.33 14 2764264.26 2804437.77 15 2804504.50 2881981.98 16 2882048.72 2887921.25 16 2993093.09 2998031.36 19 3004104.10 3008041.37 ... I am trying to load each row as an entry into a table in my database, where each column is a different field. I am having trouble getting mySQL to separate all of the data properly. I think the issue is coming from the fact that not all of

Load local html file in webview android

a 夏天 提交于 2019-12-03 14:47:18
I am trying to load the contents of a html file in a webview in android. However, it gives me the "Webpage not available error". If I try websites such as google or yahoo, they work. The html file are under src > main > assests > index.html Can someone help me with this issue. Thank You. Following is my code : setContentView(R.layout.activity_main); WebView mWebView; mWebView = (WebView) findViewById(R.id.activity_main_webview); WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mWebView.loadUrl("file:///android_asset/index.html"); XML File : <WebView

Amazon SimpleDB for development environment / local installation

半城伤御伤魂 提交于 2019-12-03 12:15:24
Is there a way / tool to simulate Amazon's SimpleDB for the purpose of development? In my quest for above, I found this tool but this is for the Mac OS. Anything that can be installed on Win XP? Needless to say, all SimpleDB APIs need to be supported. Just in case it matters, mine is a .Net based web application. SimpleDB/dev runs on Windows, Linux and Mac. The Wareseeker.com page that you found has copied the information across incorrectly. The Google Code project page for the tool is here http://code.google.com/p/simpledb-dev/ The C# library ( http://developer.amazonwebservices.com/connect

Why does pip fail when installing local egg repository?

被刻印的时光 ゝ 提交于 2019-12-03 10:24:00
I am working on Windows 7.I have created a python egg using distutils. Now I try to install this egg in a virtual environment using pip 1.0.2 using the following command: Then I create a virtual environment myVirtualEnv I activate it using activate.bat then execute the following command: pip install path_to_my_local_folder#eggName This creates a copy of my egg in my myVirtualEnv\build directory but I have the following error: IOError: [Errno 2] No such file or directory: path_of_my_virtualEnv\build\PyEqdR\setup.py Do you know why pip is looking for the setup.py file. Should I include it in the

Is it possible to embed a local web server into phonegap project?

纵饮孤独 提交于 2019-12-03 10:03:40
问题 I need to build an offline Phonegap app. However, all of my js functions need a web server to run well. Is it possible to embed a local web server into phpnegap project? 回答1: Yes, it's possible using a Cordova HTTPD plugin: https://github.com/floatinghotpot/cordova-httpd I haven't used it yet, but I may need to with my current project. One drawback is that if the IP address is known, others will be able to browse the hosted files. Before I deploy, I'll be changing that behavior. 回答2: Now it

Joda Time: Convert UTC to local

﹥>﹥吖頭↗ 提交于 2019-12-03 07:37:09
I want to convert a Joda Time UTC DateTime object to local time. Here's a laborious way to do it which seems to work. But there must be a better way. Here's the code (in Scala) without surrounding declarations: val dtUTC = new DateTime("2010-10-28T04:00") println("dtUTC = " + dtUTC) val dtLocal = timestampLocal(dtUTC) println("local = " + dtLocal) def timestampLocal(dtUTC: DateTime): String = { // This is a laborious way to convert from UTC to local. There must be a better way. val instantUTC = dtUTC.getMillis val localDateTimeZone = DateTimeZone.getDefault val instantLocal = localDateTimeZone

Installing packages in a local directory

半世苍凉 提交于 2019-12-03 07:22:26
问题 What is the best practice to install packages (those with go get... ) in a local directory? Example: I'd like to try out the Revel web framework, but I don't want to clutter my go installation at /usr/local/go . Normally I'd say sudo go get github.com/robfig/revel as written on the home page, but that would install it beneath /usr/local/go/src/pkg/... . Is there an easy way to say (for example) go get --local ... and have the package in the current (sub) directory? 回答1: You can export the env

Syncing remote database to local?

隐身守侯 提交于 2019-12-03 06:19:21
问题 I'm hoping I can use a shell script that will pull a sql dump down from my production site and into my local database. Ideally, I'd like to be able to run something like this: sync_site example_com example_local Where the first argument is the production database and the second is the local database. The remote database is always on the same server, behind SSH, with known MySQL credentials. 回答1: Figured it out: ssh me@myserver.com mysqldump -u user -ppass remote_db | mysql -u user -ppass