How to configure emacs to open a wide compilation window? - emacs

Usually I edit source code in emacs with two (emacs-)windows side-by-side -- The second
windows opened via 'C-x 3. Like this:
+------------+-------------+
| | |
| src1 | src2 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+------------+-------------+
| mini-buffer |
+------------+-------------+
When I now start compile, eg with F9, the new *compilation* buffer replaces one of my src-buffers.
Instead I would like the *compilation* buffer to open on-top of the mini-buffer, if it is not visible already (if it is, use it, of course).
+------------+-------------+
| | |
| src1 | src2 |
| | |
| | |
| | |
| | |
+------------+-------------+
| |
| *compilation* |
| |
+------------+-------------+
| mini-buffer |
+------------+-------------+
The *compilation*-buffer should have a height of about 30% of the while window or 6-10 lines.
How to accomplish that?

One way to achieve this would be to use popwin.el. I've never used it but it seems pretty customizable and the default config includes *compilation* already.

Related

How to convert text-based table to image from terminal in the same structure?

I'm trying to convert text-based table to the image, but the structure is broken after convertation.
I have file with the next structure:
+-----------+------+------------+-----------------+
| City name | Area | Population | Annual Rainfall |
+-----------+------+------------+-----------------+
| Adelaide | 1295 | 1158259 | 600.5 |
| Brisbane | 5905 | 1857594 | 1146.4 |
| Darwin | 112 | 120900 | 1714.7 |
| Hobart | 1357 | 205556 | 619.5 |
| Sydney | 2058 | 4336374 | 1214.8 |
| Melbourne | 1566 | 3806092 | 646.9 |
| Perth | 5386 | 1554769 | 869.4 |
+-----------+------+------------+-----------------+%
after a conversation with ImageMagick and command below:
convert label:"$(cat test.txt)" result1.png
I have next image:
As you can see, the structure of the columns is broken.
Do you have an idea of how can such an issue be solved?
Regards,
Ihor
You need to set the TypeFace to something monospace to match the terminal.
convert -font "Liberation-Mono" label:#test.txt result1.png
You can identify which fonts on the system by running
identify -list font | grep Mono

Swift & Firebase - Split data for user info?

I currently coding a fitness app that permits to record all the personal records for a user.
I'm really new with Cloud Firestore from Firebase, so I really don't know how I could structure the database.
In my mind, I have two options:
OPTION 1
Users
|
+--UserID
| |
| +--Name
| +--Phone
| +--etc..
|
|
Users-records
|
+--UserID
| |
| +--RecordName
| | |
| | +--recordValue
| | +--recordType
| |
| +--RecordName
| | +--recordValue
| | +--recordType
OPTION 2
Users
|
+--UserID
| |
| +--Name
| +--Phone
| +--etc..
| +--Records
| | |
| | +--RecordName
| | | |
| | | +--recordValue
| | | +--recordType
| | +--RecordName
| | | |
| | | +--recordValue
| | | +--recordType
The questions are: Do I have to split the collection for the user?
Do you think this architecture is well designed for the purpose (ie record personal records from users)?
Thank you very much
Your database structure really depends on how you are going to use it. Keep in mind that whenever you observe a node, you are also observing all of the children nodes.
So I'd probably go with something closer to Option two, maybe like this:
Users
|
+--UserID
| |
| +--UserInfo
| | |
| | +--Name
| | +--Phone
| | +--etc..
| |
| +--Records
| | |
| | +--RecordName
| | | |
| | | +--recordValue
| | | +--recordType
| | +--RecordName
| | | |
| | | +--recordValue
| | | +--recordType
I'd choose this, because I'd image you'd want to get all of the UserInfo at once, So we can observe that "UserInfo" node and get all of the children: name, phone, etc....
Then I'd think you'd also want to get all of the records at once, so we can observe that "Records" node and get all of that data.
Additionally, if you wanted, you could get everything at once by observing the UserID!
However, if you were maybe going to be getting a list of all the users, then you definitely don't want all this data in one spot and this design wouldn't work, because that is a lot of data to observe just to get all the users.
In summary: Choose an option which makes it easiest for you to get what you need, without getting extra data you don't want!

Weird ghost records in PostgreSQL - what are they?

I have a very weird issue on our postgresql DB. I have a table called "statement" which has some strange records in it.
Using the command line console psql, I query select * from customer.statement where type in ('QUOTE'); and get 12 rows back. 7 rows look normal, 5 are missing all data except a single column which is a nullable column but seems to hold real values entered by the user. psql tells me that 7 rows were returned even though there are 12. Most of the other columns are not nullable. The weird records look like this:
select * from customer.statement where type = 'QUOTE';
id | issuer_id | recipient_id | recipient_name | recipient_reference | source_statement_id | catalogue_id | reference | issue_date | due_date | description | total | currency | type | tax_level | rounding_mode | status | recall_requested | time_created | time_updated | time_paid
------------------+------------------+------------------+----------------+---------------------+---------------------+--------------+-----------+------------+------------+------------------------------------------------------------------+-----------+----------+-------+-----------+---------------+-----------+------------------+----------------------------+----------------------------+-----------
... 7 valid records removed ...
| | | | | | | | | | Build bulkheads and sheet with plasterboard. +| | | | | | | | | |
| | | | | | | | | | Patch all patches. +| | | | | | | | | |
| | | | | | | | | | Set and sand all joints ready for painting. +| | | | | | | | | |
| | | | | | | | | | Use wall angle on bulkhead in main bedroom. +| | | | | | | | | |
| | | | | | | | | | Build nib and sheet and set in entrance | | | | | | | | | |
(7 rows)
If I run the same query using pgAdmin, I don't see those weird records.
Anyone know what these are?
The plus sign before the separator (+|) indicates a newline character in the displayed string value in psql. So no additional rows, just the same row continued with line breaks. The final line of output in your quote confirms as much: (7 rows).
In pgAdmin you don't see the extra lines as long as you don't increase the height of the field (or copy / paste the content somewhere), but there are multiple lines as well.
Try in psql and in pgAdmin:
test=# SELECT E'This\nis\na\ntest.' AS multi_line, 'foo' AS single_line;
multi_line | single_line
--------------+-------------
This +| foo
is +|
a +|
test. |
(1 row)
The manual about psql:
linestyle
Sets the border line drawing style to one of ascii, old-ascii, or unicode. [...] The default setting is ascii. [...]
ascii style uses plain ASCII characters. Newlines in data are shown using a + symbol in the right-hand margin. [...]

How to create subheaders in scroll panel on GWT?

I am trying to create sub headers for the scroll table but not able to specify row span and col span.
I want to create a table like this through the scroll table.
+---------------------------------------------------------------+
| Heading1 | Heading2 | Heading3 |
| |-----------------------------| |
| |subhead1| subhead2 |subhead3 | |
| | | | | |
+---------------------------------------------------------------+
| |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+---------------------------------------------------------------+
Anybody know how to create like this ?
I think Flex table is what you are looking for. FlexTable's FlexCellFormatter has setColSpan and setRowSpan methods that should allow you to create the headings you desire.
Haven't tested this, but the following code should set the first row as you described:
flexTable.getFlexCellFormatter().setRowSpan(0, 0, 2);
flexTable.getFlexCellFormatter().setColSpan(0, 1, 3);
flexTable.getFlexCellFormatter().setColSpan(0, 2, 2);
See the FlexTable example for source code.

Cannot read (or find?) ResourceBundle

Below is my project structure.
Project
|
|--src
| |
| |--com
| | |
| | |--jasper
| | |
| | |--JasperDemo.java
| |
| |--i18n.properties
|
|
|--Arabic.jrxml
In the properties file there is a key text1.paragraph and it's value may be in any language(most preferable arabic).
In the .jrxml file I have set ResourceBundle="i18n" and in the textfield have used $R{text1.paragraph}
Now the problem is that when I run it from eclipse in the PDF file I get output of the field as $R{text1.paragraph} not it's value