Octopress: Tables and Definition Lists not showing in rake preview - octopress

Hi I dont know if this is the normal behaviour but if possible would like to preview tables and definition lists.
Using latest versions:
I am using the kramdown version of markdown.
I haven't deployed yet which means I only have
a source but no Masters folder.
I use rake generate or rake preview commands only.
I have tried
| First cell|Second cell|Third cell
| First | Second | Third |
First | Second | | Fourth |
size material color
---- ------------ ------------
9 leather brown
10 hemp canvas natural
11 glass transparent
and for definition lists
apples
: Good for making applesauce.
oranges
: Citrus!
tomatoes
: There's no "e" in tomatoe.

Related

Why my bash terminal shows "?[30;43m" instead of a well formatted text when using Symfony CLI commands like server:start?

I switched from Windows cmd terminal to bash in PhpStorm and now when I run Symfony CLI commands like server:start it shows characters like ?[30;43m instead of a formatted text.
I tried these Symfony commands on both PhpStorm and Visual studio code with the same results. It did work on git bash terminal though.
Here a screenshot from PhpStorm executing server:start:
and a screenshot using Windows cmd for the same command:
Do you know how to solve this problem?
My solution
I left Windows to Linux. Now everything works fine. I could not make it work properly on Windows though.
I think the ? means that my terminal on windows had trouble with the escape character used to interpret the formatting code [30;43m.
Here is my homemade explanation of this kind of formatting code:
Use echo -e to use text formatting.
Syntaxe:
\e[FORMAT;FORMAT;FORMATm
\e is the escape character (\033 works too).
[ mark the beginning of the format code.
; separate formating code sequence.
m mark the end of the format code.
FORMAT has to be replaced by a formatting code:
character effects using 1 digit:
code | effect
---- | ------
0 | normal
1 | bold
4 | underlined
5 | blinking
7 | reverse colors
colors using 2 digit:
first digit (the target):
code | effect
---- | ------
3 | foreground
4 | background
second digit (the color):
code | effect
---- | ------
0 | black
1 | red
2 | green
3 | brown
4 | blue
5 | purple
6 | cyan
7 | light gray
These are color codes, from the ANSI Escape codes : https://en.wikipedia.org/wiki/ANSI_escape_code
Some terminals use these codes to apply text formatting, while others just display them as regular text. Most programs that print such codes in an attempt to color their output also have an option to silence them, in order to make the display more readable on dumber terminals.

How to address SpecFlow Scenario Outlines with too many parameters?

We are using SpecFlow for functional tests that suppose to replace manual testing when a human reads generated email and validates that all sections match specification. The problem is that Scenario Outlines become to grow to have too many parameters
Scenario Outline: generate and send confirmation email
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section1 should have parameters '<Param1_1>', '<Param1_2>', '<Param1_3>',...
Then section2 should have parameters '<Param2_1>', '<Param2_2>', '<Param2_3>',..
Then section3 should have parameters '<Param3_1>', '<Param3_2>', '<Param3_3>',...
....
Examples:
| EmbeddedItinerary | Param1_1| Param1_2| Param1_3| Param2_1| Param2_2| Param2_3| Param3_1| Param3_2| Param3_3|...
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 | Value2_1 | Value2_2 | Value2_3 |Value3_1 | Value3_2 | Value3_3 |...
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 | Value2_1 | Value2_2 | Value2_3 |Value3_1 | Value3_2 | Value3_3 |...
But the number of columns in Examples would become unmanageable. I wish to have multi-line examples ( but with different reason then in Multiple Multi-Line Examples in SpecFlow Feature File).
The option that I see is to store all ExpectedResults in embedded xml or json resource file, and have SpecFlow features quite small e.g.
Scenario Outline: generate and send confirmation email with correct email address for flight section
Given I have stored embedded resource '<EmbeddedItinerary>'
When Generate confirmation email
Then sections should be as specified in '<ExpectedResultsFile>'
Examples:
| EmbeddedItinerary | ExpectedResultsFile
| Itinerary_1 | ExpectedResults1 |
| Itinerary_2 | ExpectedResults2 |
...
Is it a good idea?
Can anyone suggest better way ( more SpecFlow style)?
My concern is that moving expected data to separate files I am loosing visibility, that is one of advantages of SpecFlow features.
Update: while writing this question I found commercial product ($AUD 255 per user) Specflow+Excel http://www.specflow.org/plus/excel/getting-started/ , which may satisfy my requirement to maintain many columns.
Is it a mature/reliable product? Should I use it instead of own parsing expected results files in proprietary format?
If I have a lot of parameters in a Scenario Outline, I try to work as much as possible with default parameters or split the Scenario Outline in multiple ones.
I think in your case, it should be possible to split the one 'generate and send confirmation email' Scenario Outline in multiple ones that you have a scenario outline for every section.
This would reduce the amount of needed parameters per scenario and you get faster feedback if an error occurs. You immediately see in which section you have an error.
e.g.:
Scenario Outline: generate and send confirmation email - section 1
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section1 should have parameters '<Param1_1>', '<Param1_2>', '<Param1_3>',...
Examples:
| EmbeddedItinerary | Param1_1 | Param1_2 | Param1_3 |
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 |
Scenario Outline: generate and send confirmation email - section 2
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section2 should have parameters '<Param2_1>', '<Param2_2>', '<Param2_3>',..
Examples:
| EmbeddedItinerary | Param2_1 | Param2_2 | Param2_3 |
| Itinerary_1 | Value2_1 | Value2_2 | Value2_3 |
Scenario Outline: generate and send confirmation email - section 3
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section3 should have parameters '<Param3_1>', '<Param3_2>', '<Param3_3>',...
Examples:
| EmbeddedItirerary | Param3_1 | Param3_2 | Param3_3 |
| Itinerary_1 | Value3_1 | Value3_2 | Value3_3 |
About SpecFlow+Excel: That is also an option. Maintaining examples in Excel is most of the time easier than in the feature- file. It will at least solve your problem in short term, but you have to be also careful to write scenarios that are still understandable and readable.
You can get a trial license for it from here: http://www.specflow.org/request-your-specflow-trial-license/
Full Disclosure: I am one of the developers of SpecFlow+ (Runner & Excel).

Print and update multiple lines in fixed position

I would like to print an output like the following in a fixed position while the numbers in the block keep updating every couple of seconds. It is similar to what top does.
Jobs monitor:
+-----------------------------------------+
| Waiting | Launched | Running | Finished |
+-----------------------------------------+
| 319 | 364 | 94 | 201 |
+-----------------------------------------+
Elapsed time: 21s
Is there a way to do that?
With only one line, I could do it with STDOUT.flush and "\r", but it does not work for multiple lines since the carriage will put the cursor at the beginning of the new line only.
The curses library is one way to make this work. It allows you to write to locations on a 2-d screen so you're not constrained to the current line. This question has some good resources for learning curses.

InDesign - how do I know if an image already placed?

I am working on a book with many images, and I want to ensure that I place each picture only once. Is there a way to tell indesign to to check if image exist before placing it? Or a way to define a preflight profile for it?
Thank you,
Omer
You should be able to see a list in the links panel.
It shows the number of times and the page number it appears on.
example:
Name | ! | Pg |
--------------------|---|----|
my-image.psd (2) | | |
my-image.psd | | 1 |
my-image.psd | | 4 |

Sonar 3.6.1 : Manual metrics and treemap components

I have a problem with SonarQube 3.5.1 / 3.6 / 3.6.1.
I use web API to inject manual metrics values for a project like this :
curl -u user:password -d "resource=<project>&metric=<key of metric>&val=<value>" http://localhost:8081/sonar/api/manual_measures
More over, I use sonar-runner (with a .properties file) to run analysis after injected these values.
One of these metrics is a percentage and this metric is declared as a Percent Unit value in Sonar (in Settings => Manual Metrics menu).
I have a project with components and each project and components have this metric value injected and I can see it in Sonar.
When I want to show this metric as a color metric in a "treemap of components" widget, all the treemap is grey (as if values are not defined).
But if I put mouse on the name of component in treemap, I see the color metric value as a percentage value like this :
myComponent - ncloc: 800 - myMetric: 84,0%
Moreover, scale metric color does not appear in treemap title (after Size ncloc Color <my metric>).
Colors and scale appear if I choose an other metric for color (not a manual metric).
In fact feeding a manual metric is a two steps mechanim:
Define the value of this manual metric as you did by calling for instance the 'manual_measures' web service
Launch a Sonar analysis on this project to 'associate' this manual measure to the latest quality snapshot of this project
Then you should be able to use this manual metric in a treemap.
I finally found a solution for this problem.
In metrics table in database, i realized that my manuals metrics for color treemap don't have worst_value and best_value (value was NULL).
select * from metrics where name like 'sp_violations_density';
Result :
+-----+-----------------------+------------------+-----------+--------+-------------------------------+-------------+----------+--------------+---------+--------+------------------------+--------------------------+----------------------+--------+------------------------+
| id | name | description | direction | domain | short_name | qualitative | val_type | user_managed | enabled | origin | worst_value | best_value | optimized_best_value | hidden | delete_historical_data |
+-----+-----------------------+------------------+-----------+--------+-------------------------------+-------------+----------+--------------+---------+--------+------------------------+--------------------------+----------------------+--------+------------------------+
| 161 | sp_violations_density | Rules compliance | 0 | Issues | SyncPerl Compliance Rules (%) | 1 | PERCENT | 1 | 1 | GUI | NULL | NULL | NULL | NULL | NULL |
+-----+-----------------------+------------------+-----------+--------+-------------------------------+-------------+----------+--------------+---------+--------+------------------------+--------------------------+----------------------+--------+------------------------+
So i set them with 0 and 100.
update metrics set worst_value='0' where name LIKE 'sp_violations_density';
update metrics set best_value='100' where name LIKE 'sp_violations_density';
Need a Tomcat restart, and then it works.
Treemap has colors now.

Resources