How can I access an xpath with a colon in the name? [duplicate] - xpath

This question already has answers here:
How does XPath deal with XML namespaces?
(2 answers)
Closed 2 months ago.
I am trying to access the contents of the path below:
/newsMessage/itemSet/newsItem[2]/contentSet/remoteContent[3]/rtr:altId
However, the path is not being accepted due to the colon, is there any way to escape this character or make the contents of this path accessible.
I have tried using something similar to this:
/*[name()='rtr:altId']
however I'm unsure where I would put this in the CSS and if I have formatted correctly.

Try this:
/newsMessage/itemSet/newsItem[2]/contentSet/remoteContent[3]/*[name()="altId"]
or
/newsMessage/itemSet/newsItem[2]/contentSet/remoteContent[3]/*[local-name()="altId"]

Related

ruby way - relative path [duplicate]

This question already has answers here:
How to do a safe join pathname in ruby?
(2 answers)
Closed 5 years ago.
I am using File.read('file.txt') in a ruby script. But I don't know what is the best way to create a correct relative path, I can do
File.read(File.dirname(__FILE__) + '/file.txt)
but I wonder if there a more beautiful way in ruby?
There's a number of ways, but this one is the most flexible:
File.read(File.expand_path('file.txt', File.dirname(__FILE__))
You may also want to use Dir.pwd to be relative to the current working directory in your shell.
Note that using string concatenation for paths may work, but using expand_path or join is more reliable and properly handles platform differences, like on Windows where parts are natively joined with backslash instead.

How to get rid of auto generated comments - sass [duplicate]

This question already has answers here:
How to run compass compile without file or line reference?
(3 answers)
Closed 7 years ago.
I am new to Sass and Compass and I'm trying to figure out how to disable the auto generated comments when my css file is generated. Here is what it looks like now:
Is there a way to get rid of those comments?
Can't you just delete them, like... backspace? Or are you looking to disable auto-generated comments from all your CSS files?
Try using a hash (#) before the comments you want to omit

Check if file matching regex, glob, or wildcard pattern exists? [duplicate]

This question already has an answer here:
Check if a file exists using a wildcard
(1 answer)
Closed 7 years ago.
I'm aware of File.exists?, but that appears to operate with strings or IO objects. What I need is the ability to use a regex, glob, or wildcard.
For example, I want to say File.exists?("/pictures/tank_man.*"), to see if an image named tank_man exists, whether it's a jpg, tif, png, whatever.
You can use Dir["/pictures/tank_man.*"]
It will return existing paths

How to show content of variables in Xcode? [duplicate]

This question already has answers here:
Xcode Debugger: view value of variable
(8 answers)
Closed 9 years ago.
In many cases xCode does not show the content of the variables when I move the mouse over them.
Is there an alternative way to show the content?
For example of simple bytes, arrays of bytes, ...
Is there a way to specify the output format somehow?
There is now much improved variable formatting via the lldb debugger, where you can specify the formatting for your own types. Read the docs on how to specify these, then put them in a python script and in ~/.lldbinit add the line:
command script import path/to/my/formatters.py
For more information on LLDB data formatters see:
http://lldb.llvm.org/python-reference.html
http://llvm.org/svn/llvm-project/lldb/trunk/examples/synthetic/ - has examples for STL formatters
look at the bundled scripts in Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/formatters
Some times Xcode doesn't show the content when place mouse over the variable.for getting the value you can write like po (variable name ) in console.
once check this one

Change text colour in WINDOWS command line [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
how to have multiple colors in a batch file?
Colorizing Windows command line output from PHP
Let me just make this very clear: I am on WINDOWS, so \033[0;35mText WILL NOT WORK.
Sorry to have to emphasize like that, but every possible duplicate I have seen has people saying to use the above code regardless of what OS the question is about.
Now, I know it's possible without too much trouble - ffmpeg does exactly the kind of thing I want to do:
(source: adamhaskell.net)
So how hard can it be?
Use SetConsoleTextAttribute to set the text colour.

Resources