When I type file://someDir/image.png in Visual Studio source code comment (2012, c#, for that matter), I guess it's a relative path. So what is the base address? is there a way to set, for instance, current project as the base address (or even use some kind of placeholder like %PROJECT% or something similar) ?
I want to use image to explain complicated idea, like:
// take a look at:file://ThisExplainsItBetter.png
ImageComments extension for Visual Studio can display images and use relative paths.
What you're asking for is not really possible, as there is no comment pre-processor for C#, or any other language that I can think of. The source code is turned into the executable, but the comments are ignored.
In addition, such a pre-processor would inadvertently edit your code before compilation, or do some other spooky stuff, which may change your executable's logic.
You can go with may be it will help you
string startupPath = System.IO.Directory.GetCurrentDirectory();
string startupPath = Environment.CurrentDirectory;
Or if you have Image folder inside your repository you can use "../../" or "~/"
It will get file from your project root.
Related
I'd like to know if it's possible, and how much of an effort it would be to use S3File as an image field in KeystoneJS. My testing indicates that while you can indeed upload an image to an S3File, the admin interface treats it as an arbitrary file. The thing I'm missing the most is a preview function like Types.CloudinaryImage provides.
Is the autogenerated admin interface easily extensible without it being ugly hacks? Or is it meant to be left untouched because of the simple fact that it already does so much for you?
Looks like they intend to improve this.
https://gist.github.com/JedWatson/8519769
https://github.com/JedWatson/keystone/issues/165
My hack solution is to directly edit the keystone template file in node_modules - until these issues are resolved. Edit node_modules/keystone/templates/fields/s3file/form.jade and add wherever you want:
img(src=item.get(field.paths.url))
Then remember to revert this hack after it's officially supported (as updates will blow away the hack).
I have a project with a sourcecontrol block which has a trunk url value.
I also use intervalTrigger with modification exists property.
I'd like to only build if there are modifications in a sub path of the trunk url, anyone know how I might do that?
Please check the following post, I think it's related:
how to customize buildCondition="IfModificationExists" on CruiseControlNet build?
and there's the filtered source control block which should do what you need:
http://cruisecontrolnet.org/projects/ccnet/wiki/Filtered
At the moment when you go to select an image inside an entry using the EE default file manager, the default view is 'show files as a list'.
Is there a way to show the thumbnail view as the default?
At this point I would be happy with a core hack.
I don't usually use the file manager for sites (much prefer Assets) but this client had a tight budget
I've wondered about doing this in the past as well - turns out it's pretty simple. Open up ee_filebrowser.js and search for the first instance of a("#dir_choice").val(). Immediately after that add this:
; a("#view_type").val('thumb').change();
Make sure you include the leading ;.
I've only tested this in Safari but I can't see why it wouldn't work everywhere. Incidentally, JS beautifier makes this sort of thing infinitely easier.
I don't recommend hacking core for any reason and I suggest it should be avoided at all cost.
With that said, I will provide what I've found out just the same.
Looks like the following files, in EE 2.5.3, are what you'd want to edit:
/themes/javascript/compressed/jquery/plugins/ee_filebrowser.js
/system/expressionengine/libraries/File_field.php
I found these doing a file search in my text editor for view_type which was from the id of that dropdown. The javascript is minified so you'd probably want to un-minify it and then rewrite the part which handles the switch. I'm not the best JS/jQuery person out there, and un-minified js makes it a bit harder too so, I won't offer any more than what I've found so far.
Consider pulling out the parts parts from the two files if you aren't great with js and maybe start a new post tagged accordingly.
Also note: there might be more to this than just those two files so consider this answer a start and nothing more.
I'm trying to automate a process for our documentation team. They have a pretty big batch of framemaker files across several books and use RoboHelp to generate EclipseHelp for two different versions of our project.
Each framemaker file has the appropriate tags set to indicate which version a particular piece of documentation applies to. Currently the writers modify the conditional build expression to specify the correct set of tags and run File->Generate->EclipseHelp each time. I can run the generation process just fine, but I can't figure out how to change which tags it's using.
I've read through RoboHelp's scripting guide and the only references I can find to Conditional Build Tags is the ability to create and delete them. I can't find any references to Conditional Build Expressions. Does anyone know any way to modify it from a script? Alternatively, if someone can suggest a different way of organizing RoboHelp/Framemaker that is more conducive, I'm all ears, though I have basically zero familiarity with either.
The Conditional Build Expression forms form of your EclipseHelp Single Source layout. As such your script needs to refer to the tags there.
I'm going to answer with what I found - even though it's only a partial answer - just in case it can help someone, or possibly give someone enough to figure out a more proper answer.
Basically I found that each Single Source Layout has a corresponding *.ssl file. If your layout is called OnlineHelp, it will be (in my experience) OnlineHelp.ssl and will be in the same directory as your .xpj file. The ssl file is just a bunch of xml and has some number of sections. One of the sections will have the same name as the content category where you would go in the UI to change the Conditional Build Expression. In that section is an element named "BuildExpression". Set that to whatever you need and reopen your RoboHelp project. It's a bit of a hack, but I set up a groovy script to do that before running my ExtendScript and it gets the job done.
In my Android application, for example when I am inserting a Button and adding a static value for it as follows:
android:text="MY BUTTON"
It gives a warning saying Hardcoded string "MY BUTTON", should use #string resource.
I am currently trying to extend some functionality in a previously developed app; do I have to change all those statically defined values to refer to the string.xml file?
Please can anyone give an opinion on the standard? Thanks in advance.
You don't have to fix this at all because it is a warning not an error. Your app will work perfectly well with hard-coded strings.
That said, it is advisable to fix it because it will make translating your app to other languages much easier should that ever become necessary.
Generally I try to always define strings in the strings.xml file because it really doesn't take too long when developing new code. However converting an existing project to use strings.xml may be a lot of work for little gain if you are unlikely to ever need to translate your app.
The warning you are getting is via the Android Lint utility.
Generally speaking, you ought to get into the habit of using string resources (as Mark Allison wrote) and never 'hard code' string literals in code or XML markup like you have done there regardless of whether you intend to internationalize your app or not.
It just makes sense in terms of future code maintenance.
In fact, I have setup my linter settings to mark hard coded strings as errors so I'm always mindful of it.
To do that, go to Project -> Preferences, expand Android, select Lint Error Checking and change "HardCodedText" from "Warning" to "Error".