In Eclipse, is there a generic Provider for all kinds of content? - eclipse-juno

In Eclipse, I would like to enumerate all the content from every registered Provider. Is there such an interface?

At least in my installation that does not search files at all. That is instead the same old "Ctrl-3" quick access which allows you to access UI elements by typing their name. Try "pack" to see it listing the package explorer and similar things.
For quickly locating files you should use Ctrl-R (Open Resource) instead or use the normal File Search.

Related

How can I use multiple JetBrains IDEs on same project without annoying pop-ups when switching between them?

I have a project that uses both PHP and Python, and I would like to use JetBrains IDEs (in this case PhpStorm and PyCharm) to work with both languages.
However when I open the project using both IDEs concurrently I get a pop up whenever I switch from one to the other, as the newly focused IDE detects metadata that has been written to the project directory by the other IDE. I imagine this would be a problem between other combinations of JetBrains IDEs as well (hence the use of the generic jetbrains tag).
I have a work around (I will post in an answer for others to view), but it is somewhat awkward to set up, and I may well be working with other projects that use the same combination of languages.
Is there an easier solution?
My current workaround:
Create a new directory separate to the main project directory - using the language specific IDE for the second-most used language in the project, open the new directory as a project, and using the options in Settings > Project > Project Structure, add the main project directory as a separate content root.
Whenever needing to work on the parts of the project written in the secondary language, you can now open the new directory instead; this keeps metadata for both IDEs separate.
A workaround which allows for two IDE's to share the same directory without IDE settings conflicts.
JetBrains software allows you to store project settings as either a file based project (*.iml), or a directory based project (.idea).
To choose file or directory based projects, change the file storage type when opening a project.
Note: Directory based projects are preferred to file based projects, as they allow for versioning of shared settings. Support for file based projects is deprecated and may be removed.

Create folder and directory in actionscript

As a part of flash application, I'm trying to store recorded files automatically to a specific path on users computer hard disk without they be aware.
Is there a way to create directory in actionscript?
If you are using Flash in a web browser, for security reasons there is not. the only option to store something locally within a web browser is to use shared objects (kind of like cookies), but this is likely not what you want.
If you are not in a web browser you can use either AIR or a third party wrapper such as Multidmedia Zinc (for an additional cost).
File options for AIR can be found here:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html
File options for Zinc can be found here:
http://www.multidmedia.com/support/livedocs/zinc/4.0/
EDIT
Since in your comment it sounds like your running in a web browser, you should leave it at simply streaming it to your server. If they have no internet connection there is no other good option other than live streaming using URLRequest, that is, if you are within a web browser.
Here is some additional reading on this subject:
Can Flash action script read and write local file system?
There's a tutorial at http://hub.tutsplus.com/tutorials/create-a-useful-audio-recorder-app-in-actionscript-3--active-5836?request_uri=%2Ftutorials%2Factionscript%2Fcreate-a-useful-audio-recorder-app-in-actionscript-3 which does exactly what you want. Ignore the timeline-driven approach if you wish.
It uses the micrecorder library from https://code.google.com/p/micrecorder/ which records the audio and offers a file for the user to download at the end.

Creating standalone app with Microsoft Access

Once I saw a DB made in MS Access that worked as a normal program, i.e with an executable file that opened a beautiful UI and allowed access to the forms and reports. I've trying to do the same, I even googled but didn't find how do it. Anyone knows how to build such standalone App with Access?
You cant make an access database into an executable file. It just cant happen however you can fool people into thinking that they are not using access a number of ways, for example
Custom splash screen (just put a bmp
file in the folder and name it the
same as your database)
Hide the access window and toolbars
Change the access icon
For example take a look at this screen shot
There are lots of things going on here and it would be hard to tell that it is built using good old access 97 (Yes I know the standard toolbar kind of gives it away, it will be going at somepoint).
I believe the tool is called the Microsoft Access Runtime toolkit or something along those lines. The latest version is free, a departure from the previous versions which I believe you had to pay for. From the previous version I tinkered with, it comes with a tool to make a EXE file from the MDB or ACCB file, a handful of icons for the EXE to use if you are lacking one, and a program to help you generate Microsoft Help files for your application.
This is a link to the Developer Extensions - I believe the 2007 version of what I described above:
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=D96A8358-ECE4-4BEE-A844-F81856DCEB67&displaylang=en
Here is a link for the runtime, which doesn't convert your Access database into an executable file, but would allow it to run on computers without Access installed:
http://www.microsoft.com/downloads/en/details.aspx?familyid=D9AE78D9-9DC6-4B38-9FA6-2C745A175AED&displaylang=en
NOTE: Both of these are for Access 2007, the version I run. Your version might require something different - but should be easily located on Microsoft's website.
If you want to fool the user in thinking that they are not using access it will take some ingenuity. I have done this. You will need a way to make nice 2D images that you will import into access, and then set them up like buttons, and give them functionality. Make sure you over lay them on a splash screen of some kind. Not sure if you know VBA but it will be needed.
At the end make sure you go in to the setting, and turn off anything that might allow the user to alter the form in any way. And then rename the file's extension like this: fileName.accdr
This is as close to a normal program that you are going to get, and remember it will only look as good as the art you put into it.

Application configuration files for Glassfish/Java EE 5 web services

I am trying to write some simple Java web services so we can call Java code from .NET. So far, I got a proof-of-concept working under Glassfish. Pretty straightforward when the IDE does all the work.
Now I'm really bogging down on stuff in Java that should be really simple. For example, I want to externalize my configuration so I can change stuff like connection strings/usernames/application variables/etc without recompiling.
In .NET, you would just stick some strings in the web.config file in the root of the web site and use: ConfigurationManager.AppSettings["whateverIwant"];
I can get java.util.Properties to do what I want (from a standalone client), but I can't figure out where to put the .properties file and how to get the path to it from within the web service.
I need my approach to work within WebSphere Application Server as well. Thanks!
As others have mentioned, it greatly depends on the container, but almost always dynamic configurations are stored in a database instead of XML or .properties files.
As I see that this is just like a proof of concept, here's a quick and dirty solution: (don't do this for production code) use System Properties.
Disadvantage: with every change you need to reboot the container, but you don't need to recompile the app.
To use system properties in Glassfish you can go to the section "Configuration -> System Properties" and add properties there. Then from inside your application just call
String myValue = System.getProperty("myProperty");
To get the value. All java applications support these properties, but I don't know how to configure them in Websphere.
Alas, Java EE has a giant hole in the head when it comes to application configuration.
Your best bet is to either:
use JNDI to store config in the application server environment. This is hard to do portably, painful, and an absolute nightmare for the user to do any configuration. Configuration UI depends on which app server and version is in use and may be a command-line-only utility specific to that app server.
Use the Preferences API to store your configuration, and produce your own UI to edit it. This is OK ... except that you can't control when your settings are flushed and re-inited. Some app servers will do this when your app is re-deployed, which you probably don't want.
All in all, the situation absolutely stinks. There's no clean, sensible way for an app server to provide an app with a simple properties map and UI to edit it using the app server's admin tools.
I tried to work around this using web context parameters, but found that they too were buggy. Glassfish was ignoring more than the first web context parameter that was being set, and they were hard to access without having a servlet context so you couldn't really get to them easily across the whole app.
If anyone has a better answer I'd love to hear it, because the situation as it stands seems downright amazing for a spec that's been through several major iterations.
see also: Storing and editing configuration for Java EE applications
Application configuration is unfortunately container dependent. In general you access your configuration through JNDI. The approach I've recently used was the following:
Make a database available to your app (through JNDI, use the Glassfish database "wizard"). This is part is container dependent.
Create an entity bean that deserializes your settings from the database. The simple solution here is to have something like this:
#Entity
public class Setting {
#Id
private String name;
private String value;
...
}
Then it's a question of doing em.find(Setting.class, "whateveriwant").getValue(). Alternatively, you could create a single entity bean with all the settings as attributes.
Either way, this approach reduces the container dependency to a minimum.
The best solution I've found so far is "EAC4J (External Application Configuration For Java)". I've used successfully in many projects.
Put the following code in the contextInitialized method of a ServletContextListener:
ServletContext sc = sce.getServletContext();
Properties systemProps = System.getProperties();
String path = sc.getRealPath("WEB-INF/application.properties");
systemProps.load(new FileInputStream(path));
This reads from application.properties from the the WEB-INF folder of your web app when it starts. This will require a restart every time the configs change, but in my opinion, that is as it should be.

Version control for VBA file

I have a huge MS Access document with built-in VBA codebase. Is it possible to track the file (as I am developing it) with a (mercurial) version control system? Can I extract code and track that? Or is it just the-binary-file-path? Thanks.
It's possible with MS Access to export most of the code through scripts. I posted some here a while ago:
How do you use version control with Access development?
It's possible to version-control binary files, but it would be a little cleaner (IMO) to have the code separate. If it works for you though, then by all means do what you do.
There is a nice tool here https://github.com/hilkoc/vbaDeveloper .
It allows you to easily export and import all your vba code and can do this automatically as soon as you click 'save'.
The export files are all plain text which you can then put in version control in the usual way.
Access all the way up to 2010 has supported source code control, and that includes support for team foundation server. The fact that you place all files in ONE zip file, one folder on a hard drive, or one container called an accDB is a MOOT point. As long as EACH individual object can be viewed as a SEPARATE object, then why do you care if one is using a zip file, or an accDB file? This is a “logical” view vs a physical view issue.
The simple matter is EACH OBJECT IN ACCESS CAN BE EXPORTED AS A TEXT OBJECT. Thus Access has supported source control integrate using this ability with the standard Microsoft SCC interface since Access 97 (that is 17+ years!!).
When you use SCC such as Visual Source safe or Team Foundation server then the BUILT IN UI in Access supports display the objects status in question. You have resolution down to the form, report, sql query and code module level. So multiple developers can all work on the application at the same time. They only need check out the forms, reports quires etc. they are working on. Each developer thus has their own local build.
If using Visual Source Safe, then you see this in the ribbon:
If you using team foundation server, then you see this:
And for objects checked out, you see this:
And when you open, or even right click on an object, you see these additional options:
Of course given that “few” use this feature or even know what it is (and the posts on SO confirm this lack of knowledge), then it is LITTLE surprise that the feature was dropped in Access 2013 after all these years!. However some 3rd party add-ins claim to restore this ability. So the ability to export objects in 2013 as individual text files STILL remains in place.