Wrong paths in Codename One preferences - codenameone

When I need to input a path in Codename One preferences, for example to set up the icon or the certificates to use, I use the browse button. However the path that is then filled up in the associated field leads to the jre (java runtime environnement) folder instead of the parent folder of the file I selected.
Moreover the path is preceded by "file:" where it should not be there.
Here is an example to make it clearer :
As a workaround I manually paste the folder path where the file I want to use resides, and then paste it in the field. So as it is a little bit annoying, I was wondering if I could do something to make it work as it should ?
Please note : my setup involves Eclipse Mars running under Linux 64 with Oracle's Java 8 JDK.
Any help appreciated,

This seems to be related to this issue, I wasn't able to reproduce it in full although I did fix the file: prefix. The paths I got were correct despite all my attempts.
My only guess is that this might be an issue that affected an earlier version of the tool so I've added a version number to the title (1.13 in my current version). If this still happens in the next plugin update and the title of the preferences is 1.13 or newer I'd like to know.

Related

How to fix function (that validates input) from not reading a text file? [duplicate]

Trying out the Clion EAP on the Mac. How does one change the current working directory for a launched program? It appears to be set to the output directory of the binaries.
This can be changed via the Run -> Edit Configurations... dialog, just like Idea.
The mix of needing to make changes to CMakeLists.txt for so much of the configuration just threw me, and I've been hunting for a way to change it there, but this bit at least is consistent with the other IDEs, which is good.
Hopefully they'll improve the rest of the Project Settings in a similar fashion.
The "Working Directory" is where the executable starts. Modifying the "Working Directory" in the Configurations setting tells Clion to change to the "Working Directory" after the executable starts execution.
If you want to change where the executable starts execution you will need to add a line to the CMakesLists.txt file.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(TimeServer ${SOURCE_FILES})
Position in the cmakes file is important. If you add the set command after the add_executable it will not work. It must come before.
These answers are relatively old. Not sure when the feature was added but there's a very nice UI way to set the current working directory now.
I made a YouTube tutorial for my COSC1030 (Beginning C++) students but the solution is the same for everyone:
https://youtu.be/dTtZEAfh_LM
If you know your CLion fairly well and don't need a demo, here's a short-hand version: Edit Configurations (from drop-down menu at top right of screen), enter the directory you want to use in Working Directory or select via "..." pop-up.

TYPO3 RealURL does not work after Backup

My RealURL path segments do not work anymore since a Backup.
I had TYPO3 7.6.10 on my Windows PC.
Then i installed TYPO3 7.6.11 on my new Mac.
I made a dump file of the database and copied all files of my TYPO3 Project.
After finishing, I could successfully login into the backend.
The only problem I have is, that my RealURL does not rewrite my paths anymore.
Actually my first page is called localhost/project/home/ instead of localhost/project/index.php?id=2.
However, the first one always ends up in a 404 - Error.
I don't know why that happens, since i also copied the _.htacces file in the project folder too. Or is that not the right way to back up?
Hope someone can help me.
EDIT
Problem solved: Since OSX is hiding some sepcial files like the .htaccess, i had to make them visible so i could copy them. Now everything is working as it shall!
Problem solved:
Since OSX is hiding some sepcial files like the .htaccess, i had to make them visible so i could copy them.
Now everything is working as it shall!

How link to any local file with markdown syntax?

I have a local markdown file containing several links and I want that links head to local file like pdf.
I use the following syntax:
[my link](file:///C:/my_file.pdf)
But when I open my markdown file into a Firefox page and click on the link, nothing happens.
What exactly have I missed? Is it possible to open local file?
None of the answers worked for me. But inspired in BarryPye's answer I found out it works when using relative paths!
# Contents from the '/media/user/README_1.md' markdown file:
Read more [here](./README_2.md) # It works!
Read more [here](file:///media/user/README_2.md) # Doesn't work
Read more [here](/media/user/README_2.md) # Doesn't work
How are you opening the rendered Markdown?
If you host it over HTTP, i.e. you access it via http:// or https://, most modern browsers will refuse to open local links, e.g. with file://. This is a security feature:
For security purposes, Mozilla applications block links to local files (and directories) from remote files. This includes linking to files on your hard drive, on mapped network drives, and accessible via Uniform Naming Convention (UNC) paths. This prevents a number of unpleasant possibilities, including:
Allowing sites to detect your operating system by checking default installation paths
Allowing sites to exploit system vulnerabilities (e.g., C:\con\con in Windows 95/98)
Allowing sites to detect browser preferences or read sensitive data
There are some workarounds listed on that page, but my recommendation is to avoid doing this if you can.
You link to a local file the same way you link to local images. Here is an example to link to file start_caQtDM_7id.sh in the same directory as the markdown source:
![start_caQtDM_7id.sh](./start_caQtDM_7id.sh)
After messing around with #BringBackCommodore64 answer I figured it out
[link](file:///d:/absolute.md) # absolute filesystem path
[link](./relative1.md) # relative to opened file
[link](/relativeToProject.md) # relative to opened project
All of them tested in Visual Studio Code and working,
Note: The absolute and relative to opened project path work in editor but don't work in markdown preview mode!
If you have spaces in the filename, try these:
[file](./file%20with%20spaces.md)
[file](<./file with spaces.md>)
First one seems more reliable
This is a old question, but to me it still doesn't seem to have a complete answer to the OP's question. The chosen answer about security being the possible issue is actually often not the problem when using the Firefox 'Markdown Viewer' plug-in in my experience. Also, the OP seems to be using MS-Windows, so there is the added issue of specifying different drives.
So, here is a little more complete yet simple answer for the 'Markdown Viewer' plug-in on Windows (and other Markdown renderers I've seen): just enter the local path as you would normally, and if it is an absolute path make sure to start it with a slash. So:
[a relative link](../../some/dir/filename.md)
[Link to file in another dir on same drive](/another/dir/filename.md)
[Link to file in another dir on a different drive](/D:/dir/filename.md)
That last one was probably what the OP was looking for given their example.
Note this can also be used to display directories rather than files.
Though late, I hope this helps!
Thank you drifty0pine!
The first solution, it´s works!
[a relative link](../../some/dir/filename.md)
[Link to file in another dir on same drive](/another/dir/filename.md)
[Link to file in another dir on a different drive](/D:/dir/filename.md)
but I had need put more ../ until the folder where was my file, like this:
[FileToOpen](../../../../folderW/folderX/folderY/folderZ/FileToOpen.txt)
If the file is in the same directory as the one where the .md is, then just putting [Click here](MY-FILE.md) should work.
Otherwise, can create a path from the root directory of the project. So if the entire project/git-repo root directory is called 'my-app', and one wants to point to my-app/client/read-me.md, then try [My hyperlink](/client/read-me.md).
At least works from Chrome.

C code autocomplete in Eclipse

I'm a Java developer and I've downloaded the Eclipse for C (course purposes) and to my amazement the control+space shortcut (for autocomplete) did not work.
I've created a new project and a new class using the wizzards and started to type "print" and then tried to find an autocomplete feature.
After a bit of googling I arrived at C/C++->Editor->Content Assist->Advanced and there I verified that Help proposals,Parsing-based proposals and Template proposals options were checked.
I then went over to the Keys preferences page using the link at that page and entered a binding for all relevant content assist from before C\C++ Content Assist (type...) and chose in the When box the C\C++ Editor option.
But alas no autocompletion was offered.
Can someone please point me to the right direction?
UPDATE: I'm accepting the answer not because I'm sure it's right but because I've realised I've made some mistakes with the configuration of the eclipse and have seen that with another installation/configuration (i.e. a friend of mines) eclipse does auto complete, even if it still lack many of the java version features.
Use the Advanced panel in the Preferences window to configure the behavior of the Content Assist (Ctrl+Space) command. Go to Preferences->C/C++->Editor->Content Assist->Advanced. Check the parsing-based-Proposals in Default Proposal kinds.
Although the eclipse doesn't provide perfect auto-complete, but it works..
This sometimes happens when you have the indexer turned off.
Try to enable the indexer and rebuild the index.
See this question in CDT FAQ. It contains info about how to find indexer error which might prevent auto-complete.
I'm no Eclipse expert (and I don't even play one on TV), but it might be that it only autocompletes function names that are declared in the current scope - have you added #include <stdio.h> to the top of your source file to get the declarations for the standard I/O functions?
You should verify that you have the gcc home (i.e. C:\MinGW-4.4.1\bin) defined in the path environment variable (if you're using windows and if not then it's equivelant). Also verify that the file has a .c suffix and that the indexer is on as yousf said.
I think, not sure, that you need to then run eclipse with the -clean flag and the autocomplete will work.
Ittai
i answered it here:
Eclipse: How to add include path to be used by autocompletion
You have to explicitly tell it where to find the header:
⇒ Right click on your project ⇒ go to 'C/C++ Include Paths and
Symbols' ⇒ select 'Add External Include Path...' ⇒ browse
to the location of your header files ⇒ refresh
Maybe it is related with KeyAssist bindings.
If you have tried with content assist:
Enter into Window > Preferences. Menu "General" -> "Keys"
Inside search for "Template" and set:
Key Binding to -> "Ctrl + Space"
When: "Editing Test"
Image helper Image Menu Key Assist Code Complete
Vim offers this functionality by scanning your #include's (the shortcut is Ctrl-N, or Ctrl-P to search backwards). If you can't find any better solution, one last resort could be looking into eclim, which integrates vim features into Eclipse (or vice-versa), and that's sure to offer this feature.

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change?
I'm not sure exactly what you mean by "setting up the debugger" (perhaps you can clarify), but under "Preferences -> Run/Debug -> Launching -> Default Launchers" you should be able to select your preferred launcher for different kind of launch modes. This can also be selected individually for each launch configuration.
Typically it is up to the toolchain and/or project to determine which debugger/launcher is suitable to use for that specific project, but I know there is a bug in CDT which prevents toolchains from properly specifying the default launcher to use.
I only use Eclipse for Java, so I can't give you an authoritative answer. But since no one else seems to be answering:
Java projects have a (more or less) hidden file in the project directory called .project and another one called .settings . I'm not sure if this would apply to the C environment as well, but it seems likely. You may want to look at the set of such "hidden" files for a well set up project and a virginal project side by side to find out which settings make the difference.
Given that information, you may be able to simply edit (perhaps with some assistance from a script you can write yourself) the file(s) in question to do the configuration textually without a lot of mouse clicking.

Resources