How to set splitter exactly to half window width in p4merge? - p4merge

I'm wondering if there is a way to set the splitter in p4merge window exactly to 50% screen width. For instance in Total Commander you can right click on splitter and choose from list but there is nothing like that in p4merge.

I used Process Monitor from Sysinternals to track where p4merge writes settings.
Appears that settings file resides here
%USERPROFILE%\.p4merge\ApplicationSettings.xml
and it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!--perforce-xml-version=1.0-->
<PropertyList varName="ApplicationSettings" IsManaged="TRUE">
<String varName="CharSet">utf8-bom</String>
<PropertyList varName="Connection" IsManaged="TRUE">
<String varName="ApplicationLanguage">en</String>
</PropertyList>
<String varName="DiffOption">dl</String>
<ByteArray varName="DiffSplitter">AAAA/wAAAAAAAAACAAAA8wAAAUMBAAAAMgEAAAAB</ByteArray>
<Font varName="Font">
<family>Courier</family>
<pointSize>10</pointSize>
<weight>Normal</weight>
<italic>false</italic>
</Font>
<!--i cut it here for concise-->
</PropertyList>
My guess was:
<ByteArray varName="DiffSplitter">AAAA/wAAAAAAAAACAAAA8wAAAUMBAAAAMgEAAAAB</ByteArray>
is a place where p4merge stores the splitter position.
I didn't feel like decrypting the value so i just deleted the whole tag and splitter moved to exactly 50% width of window.

Related

Intellij/Android Studio Find/Replace a multiline view in xml layout (Android)

I have to replace this
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone"
app:spb_color="#FF0000"
app:spb_mirror_mode="false"
app:spb_progressiveStart_activated="true"
app:spb_progressiveStart_speed="1.5"
app:spb_progressiveStop_speed="3.4"
app:spb_reversed="false"
app:spb_sections_count="4"
app:spb_speed="2.0"
app:spb_stroke_separator_length="4dp"
app:spb_stroke_width="4dp" />
by this
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar
android:id="#+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="4dp"
android:visibility="invisible"
style="#style/GNowProgressBar"
android:indeterminate="true"/>
thoroughout my entire project using Intellij/Android Studio's Find/Replace.
Is it possible?
(For MAC and similarly for Windows)
Click on Edit (Top Left of your Intellij/Android Studio window)
Hover your cursor to "Find"
Then select "Replace Structurally"
Now the find/replace structurally window will open. Towards the bottom side of the window, uncheck all the boxes(Otherwise it might not identify the snippet through out the project).

How to make a layout is totally wrap content the background in the drawable folder?

i have an issue here. I have an .xml file in the drawable which is the android:shape="line". below is the code:
<stroke android:width="2dp" android:color="#FF00FFFF" />
<size android:height="1dp"/>
when this .xml is applied to my linear layout as background as in figure below:
the left side and the right side of the line is touch to the linear layout. but, if i increase the "android:width" to '11', the line thickness will increase, but the left and the right side of the line didn't touch anymore to the linear layout as in figure below:
I want the line touch the left and the right side of my linear layout even the stroke "android:width" is increase.
please help.
You can also try to use linear layouts' divider property.
<LinearLayout
...
android:divider="#drawable/divider_vertical">
<TextView />
<TextView />
</LinearLayout>
File: drawable/divider_vertical.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="1dp" />
<solid android:color="#FF00FFFF" />
</shape>
I already solve my problem :). It is simply put padding but not in the shape element because if I put in the shape element, the padding doesn't work. We must put the padding outside the shape region, or in other word, put padding in item region. Means that, the root element is layer-list, since item element and shape element is in same .xml file:
<item android:left="-7px" android:right="-7px">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="11dp" android:color="#FF00FFFF" />
<size android:height="1dp"/>
</shape>
</item>

selector for actionBarItemBackground not working

I have to following problem, I want to change the selector from the actionbar item (just the normal actionbar, neither support actionbar nor actionbarsherlock). The backgroud color should be grey instead of default blue if the item icon is pressed. I have searched a lot and know that I need to override the attribute android:actionBarItemBackground in styles, but still my selector doesnt work, the background color is transparent, but the color in on pressed state is not grey, it stays transparent. :/
here is my code:
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarItemBackground">#drawable/action_bar_item_drawable</item>
</style>
and here the drawable
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="#android:integer/config_shortAnimTime">
<item android:drawable="#android:color/transparent"/>
<item android:drawable="#color/grey" android:state_pressed="true"/>
</selector>
anyone an idea?
When you supply a selector as a drawable, the first matching item that satisfies all conditions will be displayed.
In your drawable, the transparent color gets chosen every time because it doesn't have any condition such as state_pressed="true".
You should put items with more restricting conditions first and item without any condition as the last one.
Your drawable should instead look like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="#android:integer/config_shortAnimTime">
<item android:drawable="#color/grey" android:state_pressed="true"/>
<item android:drawable="#android:color/transparent"/>
</selector>

How do I change CFCHART title font?

I am using the WebCharts3D interface to create and modify charts, and then using the generated XML style as an in-line style in my Coldfusion code.
So this shows up correctly in the WebCharts3D:
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>
This simply shows the example title with no box around it, and set to the desired font size and weight. You can take this code, copy it into the WebCharts "XML Style" window, apply it, and see that it works.
I use this in my Coldfusion code like this:
<cfsavecontent variable="piecontent">
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>
</cfsavecontent>
<cfchart name="mychart" format="png"
style="#piecontent#">
<cfchartseries type= "pie">
<cfchartdata item="sample1" value="10">
<cfchartdata item="sample2" value="20">
</cfchartseries>
</cfchart>
The title correctly has "decoration" set to "none", because there is no box around it, but the title font size and weight is totally ignored. Is this a bug? Is there a workaround?
EDIT: It appears that this problem of ignored font size and weight is ALSO true for the overall font, like if you put this: <pieChart depth="Double" style="Solid" font="Arial-16-Bold">.
It seems like those particular settings are ignored in favor of the cfchart tag's font attributes. Try using those instead:
<cfchart format="png" font="Arial" fontBold="true" fontSize="18">
EDIT: While the above works with pie charts (only), it seems like another bug... What does work is interfacing with webcharts directly. It is more involved, but offers complete control over chart settings.
My experience, though I can't find any proof online other than my own testing, is that ColdFusion's implementation of Webcharts does not support styling the title.

Evernote export format (ENEX) to HTML, including pictures?

#Solved
The two subquestions I have created have been solved (yay for splitting this one up!), so this one is solved. I'll award the check mark to samjudson, since his answer was the closest. For actual working solutions though, see the below subquestions; both my implemented solutions and the checked answers.
#Deprecated
I am splitting this question into two separate questions, since this is a fairly complicated problem. Answers are still welcome though.
The suquestions are:
XSLT: Convert base64 data into
image files
XSLT: Obtaining or matching hashes
for base64 encoded data
Hi, just wondering if anyone here has had any success in converting Evernote's export format, which is XML, to HTML including the pictures. I do know that Evernote has an export to HTML function which does this, but I eventually want to do more fancy stuff with it.
I have managed to accomplish getting the text only using the following XSLT:
Sample code removed
See child questions for implemented solutions.
However, a.t.m. this simply ignores any pictures, and this is where I need help.
Stumbling block #1: Evernote stores its pictures as GIFs or PNGs, and when exported, it embeds these GIFs & PNGs directly in the XML using what appears to be base64 (I could be wrong). I need to be able to reconsitute the pictures. If you open the file in a text editor, look for the huge blocks of data in the **//note/resource/data**. For example (indents added manually):
<resource>
<data encoding="base64">
R0lGODlhEAAQAPMAMcDAwP/crv/erbigfVdLOyslHQAAAAECAwECAwECAwECAwECAwECAwECAwEC
AwECAyH/C01TT0ZGSUNFOS4wGAAAAAxtc09QTVNPRkZJQ0U5LjAHgfNAGQAh/wtNU09GRklDRTku
MBUAAAAJcEhZcwAACxMAAAsTAQCanBgAIf8LTVNPRkZJQ0U5LjATAAAAB3RJTUUH1AkWBTYSQXe8
fQAh+QQBAAAAACwAAAAAEAAQAAADSQhgpv7OlDGYstCIMqsZAXYJJEdRQRWRrHk2I9t28CLfX63d
ZEXovJ7htwr6dIQB7/hgJGXMzFApOBYgl6n1il0Mv5xuhBEGJAAAOw==
</data>
<mime>image/gif</mime>
<resource-attributes>
<file-name>clip_image001.gif</file-name>
</resource-attributes>
</resource>
Stumbling block #2: Evernote stores the file names of each picture under the resource node
**//note/resource/resource-attributes/file-name**
however, in the actual note in which it refers to the picture, it references the picture not by the filename, but by its hash, for example:
<en-media hash="4aaafc3e14314027bb1d89cf7d59a06c" type="image/gif" border="0" width="16" height="16" alt="Alt Text"/>
Can anyone shed some light on how to deal with (base64) encoded binary data inside XML?
Edit
I understand from the comments & answers that plain ol' XSLT won't get the job done handling images. The XSLT processor I am using is Xalan , however, if this is not good enough for the purposes of image processing or base64, then I am please suggest one that does do these!
Also, as requested, here is a sample Evernote export file. The code clips above are merely selected parts of this. I have stripped it down such that it contains just one note and edited most of the text out of it, and added indents for clarity.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export.dtd">
<en-export export-date="20091029T063411Z" application="Evernote/Windows" version="3.0">
<note>
<title>A title here</title>
<content><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">
<en-note bgcolor="#FFFFFF">
<p>Some text here (followed by the picture)
<p><en-media hash="4aaafc3e14314027bb1d89cf7d59a06c" type="image/gif" border="0" width="16" height="16" alt="A picture"/></p>
<p>Some more text here (preceded by the picture)
</en-note>
]]></content>
<created>20090925T063154Z</created>
<note-attributes>
<author/>
</note-attributes>
<resource>
<data encoding="base64">
R0lGODlhEAAQAPMAMcDAwP/crv/erbigfVdLOyslHQAAAAECAwECAwECAwECAwECAwECAwECAwEC
AwECAyH/C01TT0ZGSUNFOS4wGAAAAAxtc09QTVNPRkZJQ0U5LjAHgfNAGQAh/wtNU09GRklDRTku
MBUAAAAJcEhZcwAACxMAAAsTAQCanBgAIf8LTVNPRkZJQ0U5LjATAAAAB3RJTUUH1AkWBTYSQXe8
fQAh+QQBAAAAACwAAAAAEAAQAAADSQhgpv7OlDGYstCIMqsZAXYJJEdRQRWRrHk2I9t28CLfX63d
ZEXovJ7htwr6dIQB7/hgJGXMzFApOBYgl6n1il0Mv5xuhBEGJAAAOw==
</data>
<mime>image/gif</mime>
<resource-attributes>
<file-name>clip_image001.gif</file-name>
</resource-attributes>
</resource>
</note>
</en-export>
And this needs to be transformed into this:
<html>
<body>
<p>Some text here (followed by the picture)
<p><img src="clip_image001.gif" border="0" width="16" height="16" alt="A picture"/></p>
<p>Some more text here (preceded by the picture)
</body>
</html>
With the file clip_image001.gif being generated and saved.
There is a new Data URI specification http://en.wikipedia.org/wiki/Data_URI_scheme which may be of some help provided you are only intending to support modern browsers, and your images are small (for example IE8 only support <32k images).
Other than that the only other thing you can do is use some external scripts to export the image data to file and use them. This would depend greatly on what XSLT processor you are using.
It exists a pure XSLT answer to this issue ; look at this page