I have a symfony app, and I change locale in app/config/config.yml based on user preference.
I'm using this twig filter(from intl extension) on my template
<td> {{ entity.total | localizednumber('currency')}} </td>
For example, using 'es' locale I want this output
Id Total
28 250,00 $
For 'en' locale I want this output:
Id Total
28 $ 250.00
However I get this output:
Id Total
28 250,00 ¤
So what is that ¤ simbol? A error or I'm doing something wrong?
You probably declare the charset iso-8859-1 instead of iso-8859-15
in iso-8859-1, 0xA4 represent ¤
in iso-8859-15, 0xA4 represent €
Related
I want to change the default timestamp format on rsyslog. Currently I am running on RHEL7.2. Syslog version 7.4.7. Now the default format is the following:
Mar 23 09:35:30 localhost DEB [9125:<console>.<module>:2] debug info
Inside rsyslog.conf I have define the following template:
$template Mytemplate,"%timegenerated% %HOSTNAME% %syslogseverity-text:0:3:uppercase% %msg%\n"
How can I change the format to this YYYY-MM-dd H:i:s ?
The modification is the following:
$template Mytemplate,"%$year%-%$month%-%$day% %timegenerated:12:19:date-rfc3339% %HOSTNAME% %syslogseverity-text:0:3:uppercase% %msg%\n"
I have a file which i've encrypted in CENC, and i'm trying to now decrypt it using mp4decrypt from the bento4 mp4decrypt tools. The file consists of a single h264 track in an mp4 file. This is the output of mp4info --verbose
File:
major brand: dash
minor version: 0
compatible brand: iso6
compatible brand: dash
Movie:
duration: 0 ms
time scale: 120000
fragments: yes
Found 1 Tracks
Track 1:
flags: 7 ENABLED IN-MOVIE IN-PREVIEW
id: 1
type: Video
duration: 0 ms
language: und
media:
sample count: 0
timescale: 120000
duration: 0 (media timescale units)
duration: 0 (ms)
bitrate (computed): 6386.097 Kbps
display width: 1920.000000
display height: 817.021271
Sample Description 0
[ENCRYPTED]
Coding: encv
Scheme Type: cenc
Scheme Version: 65536
Scheme URI:
Protection System Details:
[schi] size=8+32
[tenc] size=12+20
default_AlgorithmID = 1
default_IV_size = 8
default_KID = [23 b6 70 1b e9 8b 4e ea 80 4e 9b 59 6c 59 37 a5]
Bytes: 0000000000000001000000000000000000000000000000000780033000480000004800000000000000010a41564320436f64696e670000000000000000000000000000000000000000000018ffff000000476176634301640028ffe1002e67640028acc8501e019effc0c7c0c81a808080a000007d200017701c00000301c9c380000773595359803c60c65801000668e938233c8f
Coding: avc1 (H.264)
Width: 1920
Height: 816
Depth: 24
AVC Profile: 100 (High)
AVC Profile Compat: 0
AVC Level: 40
AVC NALU Length Size: 4
AVC SPS: [67640028acc8501e019effc0c7c0c81a808080a000007d200017701c00000301c9c380000773595359803c60c658]
AVC PPS: [68e938233c8f]
Codecs String: avc1.640028
So to decrypt it using the above key, surely I would do:
mp4decrypt --key 1:23b6701be98b4eea804e9b596c5937a5 --show-progress input.mp4 output.mp4
MP4 Decrypter - Version 1.4
(Bento4 Version 1.5.0.0)
(c) 2002-2015 Axiomatic Systems, LLC
usage: mp4decrypt [options] <input> <output>
Options are:
--show-progress : show progress details
--key <id>:<k>
<id> is either a track ID in decimal or a 128-bit KID in hex,
<k> is a 128-bit key in hex
(several --key options can be used, one for each track or KID)
note: for dcf files, use 1 as the track index
note: for Marlin IPMP/ACGK, use 0 as the track ID
note: KIDs are only applicable to some encryption methods like MPEG-CENC
--fragments-info <filename>
Decrypt the fragments read from <input>, with track info read
from <filename>.
All I get is zero output on the command-line, and the output file is still unplayable.
Any ideas? the video track is for the whole file, it's not split into segments itself.
You are trying to decipher the file with the Key ID instead of the Key itself. "23 b6 70 1b e9 8b 4e ea 80 4e 9b 59 6c 59 37 a5" is the identifier of the key, not the key itself. Sure you will not decipher. It is in the file in order for the DRM system to retrieve the key (sending or searching the keyID for getting the Key itself in return).
Try to use the key value to decipher.
Your mp4encrypt command should have been used with an option like:
--key 1::0000000000000000
as your IV size is 8
Initial situation
I fetch the current weekday in my Controller
$dayname = date('l');
For translation I have one dedicated translation file only for the weekdays (weekdays.de.yml)
Monday: Montag
Tuesday: Dienstag
# ...
Now I pass the PHP variable $dayname to my twig file, so that I could call it there with using the trans filter.
{% trans_default_domain 'weekdays' %}
{{ dayname|trans }}
Easy going, works fine.
Objective target
To keep my translations folder tidied up, I want to migrate those weekdays.de.yml into one large single translation file, where I not just organize the weekdays, but all translation elements, e.g. trans.en.yml, trans.de.yml and trans.fr.yml.
# trans.en.yml
# ...
weekdays:
monday: Monday
tuesday: Tuesday
# ...
# trans.de.yml
# ...
weekdays:
monday: Montag
tuesday: Dienstag
# ...
I now could call the appropriate weekday in my twig file like this, e.g. for Monday:
{% trans_default_domain 'trans' %}
{{ weekdays.monday|trans }}
But how can I pass the $dayname variable to the twig file and chose the weekday from my according translation file?
{{ ('weekdays.'~ dayname )|trans }} should do it
In my bash_profile, I'm referencing an external alias.sh file, which has the following alias:
alias date="echo `date "+%Y-%m-%d at %H:%M":%S`"
If I issue date in a new terminal session, it constantly outputs the specific date at the time when the alias.sh file was sourced (i.e. when I started the new session) …
How do I make an alias that actually outputs the current date, when executing the aliased command?
Uhh, why not just?
alias date='date "+%Y-%m-%d at %H:%M":%S'
No need to echo it. When you use the backwards tick ( ` ), whatever's in it gets evaluated when alias.sh is sourced.
you can place a backslash character in front of each backquote character. :
sysadmin#localhost:~$ alias p=\'date\'
sysadmin#localhost:~$ p
Tue Apr 4 13:17:57 UTC 2017
sysadmin#localhost:~$ echo Today is $(p)
Today is Tue Apr 4 13:19:18 UTC 2017
Add this to your ~/.aliases file:
alias cd 'cd \!* ; set prompt = "\n`/bin/pwd`\n:%{^[];%~^G%}%{^[[0;37m%}(%{^[[1;36m%}%p%{^[[0;37m%})%{^[[0;35m%}%m%{^[[0;37m%}%{^[[0;33m%}>%{^[[0;37;37m%}:\n`/usr/bin/whoami`>>>>>>>>>>>>>>>> "'
Then run $source ~/.aliases
I have an ORU R01 version 2.4 message that I'm trying to get through, but for some reason, it keeps giving me a data type error on the receive side. Below is the message:
MSH|^~\&|HMED|DMC|||20110527104101||ORU^R01|M-TEST05|P|2.4|
PID|1|333333333|000009999999||MTEST^MALEPAT5^L^""|""|19900515|M|""|2||||||S|PRO|9999999995|333333333|""||
PV1|1|E|ED^OFF UNIT^OFFUNIT^02|1|||070706^TestDoc^Edward^S^""^""||||||||||||9999999995||||||||||||||||||||DMC|||||20110526231400|20110701014900||||||||
ORC|RE|339999-333333333-1-77777|339999-333333333-1-77777||||||||||
OBR|1|339999-333333333-1-77777|339999-333333333-1-77777|ED HP|||20110527003054|||||||||||||77777^MedVa Chart|77777-RES333333333-339999-1-9999999995|
OBX|1|FT|ED HP||~Depaul Medical Center - Norfolk, VA 23505~~Patient: MALEPAT5 L MEDVATEST DOB: 5/15/1990~~MR #: 333333333 Age/Gender: 21y M~~DOS: 5/26/2011 23:14 Acct #: 9999999995~~Private Phys: Patient denies having a primary ED Phys: Edward S. TestDoc, NP-C~ care physician.~~CHIEF COMPLAINT: Enc. Type: ACUITY:~~Sore throat Initial 4_Level 4~~HISTORY OF PRESENT ILLNESS ~Note~~Medical screening exam initiated: May 26, 2011 00:36~~HPI text: 21 year old male to the emergency room with a c/o sore throat pain~for the past week. Pt denies cough, N\T\V, diarrhea, and fever.~~Approximate time of injury/onset of symptoms 1 week(s) ago~~Medical and surgical history obtained.~~PAST HISTORY ~Past Medical/Surgical History~~ The history is provided by the patient~~ The patient's pertinent past medical history is as follows: Obesity~~ The patient's pertinent past surgical history is as follows: None~~ Patient allergies: No known allergies.~~ Home medications: Ibuprofen PO~~ The medication history was obtained from: verbally from the patient~~At the time of this signature, I have reviewed and agree with documented Past~History, Home Medications, Allergies, Social History and Family History.~~Past Social History~~Patient does not use tobacco.~~Patient does not use alcohol.~~Patient does not use drugs.~~EXAM ~CONSTITUTIONAL: Alert, in no apparent distress; well-developed;~well-nourished.~HEAD: Normocephalic, atraumatic~EYES: PERRL; EOM's intact.~ENTM: Nose: no rhinorrhea; Throat: no erythema or exudate, mucous membranes~moist. The bilateral tonsils are edematous and the uvula is mildly enlarged.~No exudates are noted. the tonsils do not touch.~Neck: No JVD, supple without lymphadenopathy~RESP: Chest clear, equal breath sounds.~CV: S1 and S2 WNL; No murmurs, gallops or rubs.~GI: Normal bowel sounds, abdomen soft and non-tender. No masses or~organomegaly.~GU: No costo-vertebral angle tenderness.~BACK: Non-tender~UPPER EXT: Normal inspection~LOWER EXT: No edema, no calf tenderness. Distal pulses intact.~NEURO: CN intact, reflexes 2/4 and sym, strength 5/5 and sym, sensation~intact.~SKIN: No rashes; Normal for age and stage.~PSYCH: Alert and oriented, normal affect.~~Printed By User N. Interface on 5/27/2011 12:30 AM~~Discharge Summary~~||||||S|
And here are the error messages I'm getting:
Error happened in body during parsing
Error # 1
Segment Id: PV1_PatientVisit
Sequence Number: 1
Field Number: 52
Error Number: 102
Error Description: Data type error
Encoding System: HL7nnnn
Error # 2
Segment Id: OBR_ObservationRequest
Sequence Number: 1
Field Number: 20
Error Number: 102
Error Description: Data type error
Encoding System: HL7nnnn
I have ensured that my party is set up properly and that Validate Body Segments is unchecked and Allow Trailing delimiters is checked.
This has been resolved. I ended up having to customize the segment and data type schemas in order to resolve the two errors above. The segment schema needed to be altered to add another field at the end of the PV1 segment in order to accept the last field. The OBR20 needed to reference a custom data type that took in two strings in order to process properly