Apply skinparam to individual group in PlantUML sequence diagram - formatting

Hi I want to change the border color of only one of my diagrams groups. My current attempt seems to always set a global for all groups:-
#startuml
group Blue group
TEST1->TEST2: Test1
end
group Red group
skinparam sequenceGroupBorderColor red
TEST1->TEST2: Test2
end
#enduml
How can I do this?
(also posted on plantuml forum: https://forum.plantuml.net/10716/apply-skinparam-to-individual-group-in-sequence-diagram)

OK - you can customise individual elements via the it's <<.stereotype>> but only certain objects can have this, and I don't believe groups are one of them.
Luckily there is the following syntax to work around this limitation::
group#Blue #LightBlue Blue
TEST1->TEST2: Test1
end group
group#Red #violet Red
TEST1->TEST2: Test2
end group
Found in https://forum.plantuml.net/6410/can-we-format-groups-or-have-different-styles-for-group-alt

Related

SQL to determine which rows to retain and which to remove

Good Morning Everyone,
I am having a bit of a mental block and was going to see if anyone can help me. I have a table that inventories PDF Files that our office creates. We have changed the naming convention and I am trying to develop logic that specifies when a PDF with the new naming convention has been created to tag the old one so that I can develop a batch script to move them out of the files location. Below are some examples. Each file is its own row in the table by the way.
PAR ORIGFILENAME
111100000012 | 1100000012.pdf
111100000012 | 1100000012_C_1_UB.pdf
111100000012 | 1100000012_R_1.pdf
The new naming convention contains _R_Number or _C_Number. In the above example The first file is old and I want to retain the second 2.
A second example that has a bit more. Below are 5 files. I want to retain the last two that have the new naming convention and remove the top 3.
PAR ORIGFILENAME
1100000076 1100000076-2.pdf
1100000076 1100000076-3.pdf
1100000076 1100000076.pdf
1100000076 1100000076_C_7_BARN.pdf
1100000076 1100000076_R_1.pdf
My plans if I can key on these old files when a new one exists is to develop those names into a batch script and incorporate it into a SSIS package that will run weekly to keep our PDF repository clean. I appreciate any help and incite.
The following should work, although a more varied amount of sample data would be useful.
The following uses an updatable CTE to identify the old/new format names and deletes the old format where the same PAR has a new format
with f as (
select *,
case when OrigFilename like '%*_%' escape '*' then 0 else 1 end del
from t
)
delete from f
where del=1
and exists (select * from f f2 where f2.par=f.par and f2.del=0)
If you're trying to highlight the records you want to remove - and you only want to return the records in the old format, when both a C_7 and R_1 record exists, maybe something like this?
;WITH c_7_records AS (
SELECT par
FROM my_table
WHERE origfilename LIKE '%_C_7_%'
),
r_1_records AS (
SELECT par
FROM my_table
WHERE origfilename LIKE '%_R_1%'
),
records_to_remove AS (
SELECT
DISTINCT mt.origfilename
FROM my_table AS mt
JOIN c_7_records AS cr ON mt.par = cr.par
JOIN r_1_records AS rr ON mt.par = rr.par
WHERE mt.origfilename NOT LIKE '%_C_7_%'
AND mt.origfilename NOT LIKE '%_R_1%'
)
SELECT * FROM records_to_remove;
sql fiddle

How validate two select list in oracle apex

I'm using Oracle apex, and i have 2 select list components that get the elements from the same table. i want build a currency converter, and the list of currency are "divisas"
My problem is: i want validate that when on one select component, one value is selected, the other component doesn't contain that element from select list 1. And vice verse
Also when on select 1 is null on the select 2 must show all result from the table, and vice verse.
I start with this query, but i can't do it works
select *
from divisas
where EN_APP = 'S'
and (
case when :P12_DIVISA is not null then (cod_divi <> :P12_DIVISA) else EN_APP = 'S' end
)
;
can somebody help me?
There's the Cascading List of Values property for Select List items. However, as you want to handle both items at the same time, you'll enter circular reference & dead loop so it won't just work.
Here's an option which does what you wanted; see if it helps:
create two items, e.g. P59_CURR_1 and P59_CURR_2 (for two currencies)
their type is Select List item
Page action on selection = "Redirect and set value"
SQL query looks like this (for P59_CURR_1)
select cod_divi d, cod_divi r
from divisas
where cod_divi <> nvl(:P59_CURR_2, 'X') -- would be `:P59_CURR_1` for another item
order by cod_divi
don't set cascading list of values parent item!
That's it; run the page and see how it behaves. Looks OK to me on apex.oracle.com's Apex 20.1 version.

Using SQL to Copy specific content based on conditions of other colums

I need to use either SQL or Excel to copy the picture columns data of the other corresponding picture values for the SAME model and color when the field is NULL.
For this picture shown I need D-2 and D-4 to also say A-2.jpg instead of NULL
(It's the same A model and the color is red so copy the existing A model and red picture that's there). I need D-7 to either copy D-5 or D-6's picture value (A-4.jpg or A-5.jpg would work). So on.... If there are not particular pictures for that group (ie. model B and Black) then it can be left as NULL.
I'm trying to use group by functions and nested selects, but I am getting nowhere with this.
If you are using MS SQL Server, you can use a self join to update the table.
update r set r.picture = l.picture
from Item l
join Item r on l.model = r.model and l.color=r.color
where
l.picture is not null and
r.picture is null
Assuming your table is called "products" you might be able to do something like this:
UPDATE products p SET picture = (
SELECT picture
FROM products p2
WHERE p2.model = p.model
AND p2.color = p.model
)
WHERE p.picture IS NULL
The rules about update commands vary between different Database systems. Let us know which database you are using if the above query does not work.

SQL Query to show all available rooms under a property

My SQL knowledge is not my strongest and I am struggling to find out how I can achieve what I am looking for.
When I run my query I want to show the name of the house and then underneath I would like to display all rooms which pertain to that house (these rooms can be rented)
Desired Display
15 Property Way - PP34PQ
Double bedroom - £500.00P/M
Single bedroom - £300.00P/M
Current Display
15 Property Way - PP34PQ Double bedroom - £500.00P/M
15 Property Way - PP34PQSingle bedroom - £300.00P/M
I am guessing I need to write some sort of grouping query to do this, but I am not quite sure of how I can achieve this. My current query looks like this
SELECT properties.prop_details, properties.num_rooms, addresses.addr_line_1,
addresses.addr_postcode, addresses.addr_city, room_details
FROM rooms
JOIN properties ON properties.property_id = rooms.property_id
JOIN addresses ON addresses.addr_id = properties.prop_addr
JOIN cities ON addresses.addr_city = cities.city_id
WHERE rooms.property_id = 1;
Any help would be greatly appreciated.
it sounds like you try to build a Report and try to do the display in SQL instead of your web solution.
Keep the data and its presentation separate.
Get your datatable, and then loop through it with PHP, creating a table for every building.
Ordinarely, you would use recursion, but MySQL doesn't support it.
You can use
ORDER BY premise.name, premise.id, room.nr, room.id
My guess is you need to group by room and property fields, using the max aggregate function for address and city fields, because a property (building) can have multiple addresses, one for each entrance...
SELECT
premises.field_1
,premises.field_2
,premises.field_3
,room.field_1
,room.field_2
,room.field_3
,max(address.field1) as adr_f1
,max(address.field2) as adr_f2
,max(address.field3) as adr_f3
FROM Whatever
JOIN WHATEVER
WHERE (1=1)
AND (whatever)
GROUP BY
premises.field_1
,premises.field_2
,premises.field_3
,room.field_1
,room.field_2
,room.field_3
HAVING (WHATEVER)
ORDER BY premises.field_x, room.field_y

str_replace in SQL UPDATE?

Here's a sample table:
name | picture
John S. | http://servera.host.com/johns.png
Linda B. | http://servera.host.com/lindab.png
...
Let's say there are several hundred more records.
Let's also say we moved servers from "servera" to "serverb".
Would it be possible to go into this table with one query to rename the content in the column "picture" for every record to read the correct server name?
T-SQL:
update TBL
set picture = Replace(picture, 'servera', 'serverb')
where picture like '%servera%'
Oracle:
update TBL
set picture = replace(picture, 'servera', 'serverb')
where picture like '%servera%'
MySQL:
update TBL
set picture = REPLACE(picture, 'servera', 'serverb')
where picture like '%servera%'
UPDATE users
SET picture = REPLACE(picture, 'http://servera.host.com/', 'http://serverb.host.com/')
WHERE picture LIKE 'http://servera.host.com/%';
I'm including more of the string because I'd worry about 'fixing' an image named 'somethingserverasomething.jpg'. I might also think about having a base_url table and just storing image file names in users, but that's not the question you asked ;-)