Faster alternative for large files: pdflib or princexml? - html

I've got some good experience with pdflib when it comes to speed of pdf-generation, even for large files. I was excpecting the same speeds from princexml as for pdflib, as both run natively on my linux server (they're not just php-classes). When generating a 1 page pdf with text and graphics, I see a 4 second time lapse between begin and loading of the document in the log file? Is this normal? The conversion itself doesn't seem to be long...
Mon Apr 16 19:17:30 2012: ---- begin
Mon Apr 16 19:17:34 2012: Loading document...
Mon Apr 16 19:17:34 2012: Converting document...
Mon Apr 16 19:17:34 2012: finished: success
Mon Apr 16 19:17:34 2012: ---- end

Are there network connections involved in your setup? Is there DNS name resolution involved? If yes, try to use IP addresses instead of hostnames and try again...

Related

Reading OBD2 DTC codes procedure

I am trying to read dtc codes using following procedure:
1 - send 0101 which means get the number of the dtc codes
receive - 41 01 82 07 61 01 which means I have 2 trouble codes
2 - send 0x03 to receive codes and
receive - 43 01 33 03 01 00 00 which are the 2 codes : P0133 and P0301
Using a diagnostic service tester I get 5 codes on the same car: P0133, P0301 (the ones I get also) and P0303, P0300 and C1513
How can I see the other 3 codes using my OBD?
Here are pictures with the tester:
You might have multiple OBD2-conform ECUs in your car. To access these, use broadcast addressing or query each and every one separately by adjusting your arbitration ids.
That said, some readers may also show pending (0x07) or permanent (0x0A) DTCs.

SGE Setting to Slow Down Specific Job

One of the SGE job was running slow and killed by qmaster to enforce the h_rt=1200.
Is that possible SGE admin dynamically change the setting to make the job(id=2771780) running slow? If yes, what could be the setting to do so? If not, what could cause this?
qname test.q
hostname abc
group domain
owner jenkins
project NONE
department defaultdepartment
jobname top
jobnumber 2771780
taskid undefined
account sge
priority 0
qsub_time Mon Dec 20 11:46:06 2021
start_time Mon Dec 20 11:46:07 2021
end_time Mon Dec 20 12:06:08 2021
granted_pe NONE
slots 1
failed 37 : qmaster enforced h_rt, h_cpu, or h_vmem limit
exit_status 137 (Killed)
ru_wallclock 1201s
ru_utime 0.088s
ru_stime 8.797s
ru_maxrss 5.559KB
ru_ixrss 0.000B
ru_ismrss 0.000B
ru_idrss 0.000B
ru_isrss 0.000B
ru_minflt 23574
ru_majflt 0
ru_nswap 0
ru_inblock 128
ru_oublock 240
ru_msgsnd 0
ru_msgrcv 0
ru_nsignals 0
ru_nvcsw 24156
ru_nivcsw 66
cpu 1454.650s
mem 54.658GBs
io 495.010GB
iow 0.000s
maxvmem 1014.082MB
arid undefined
ar_sub_time undefined
category -U arusers,digital -q test.q -l h_rt=1200
If you are saying that usually the job finishes in 1200s, but ran slowly on this particular occasion, this could be for various external factors such as contention for storage or network bandwidth. You may have also landed on a different compute node type that had slower CPU. An SGE admin can change various resource settings before the job starts executing such as the number of cores, but the more likely issue is contention for storage/io or even throttled cpu for thermal reasons.

Time difference between chrome / edge on windows 10

I get TZ difference on windows 10 between Chrome and Edge.
When I run this code in the console:
> var date = new Date(2013, 2, 29, 1, 0, 0, 0);
> date
This will be the output when running in on Edge
> [date] Fri Mar 29 2013 01:00:00 GMT+0200 (Jerusalem Standard Time)
While This will be the output on Chrome:
> [date] Fri Mar 29 2013 01:00:00 GMT+0300 (Jerusalem Daylight Time)
It seems that in Chrome it is recognise as DST but in Edge it doesn’t, which is correct.
(Attached screenshot)
If I turn off the “Adjust for day light saving time automatically” configuration - Chrome date becomes the same. (image2)
Someone, can explain why? and how to get the correct TZ in chrome in any "Date and Time" configuration?
Edge version: 20.10240.16384.0
Chrome version: 56.0.2924.75 (64-bit)
This indeed appears to be a bug.
The TZ Database shows:
# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
# in March. DST ends at 02:00 on the last Sunday of October.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Jerusalem 2:20:54 - LMT 1880
2:20:40 - JMT 1918 # Jerusalem Mean Time?
2:00 Zion I%sT
Therefore, in 2013, DST should have started on the Friday before the last Sunday in March, which was March 29. (The previous Friday was March 22, which doesn't meet the Fri>=23 rule in the time zone data.) This is date is also corroborated by timeanddate.com.
Windows appears to have this data correct. Examining the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time\Dynamic DST
The last part I highlighted in green is the DST start date.
00 00 = Year (ignored)
03 00 = Month (March)
05 00 = Day of week (Friday)
05 00 = Day number (5 = last)
02 00 = Hour (02:00)
00 00 = Minute
00 00 = Second
00 00 = Millisecond
So both the Windows and the IANA data are pointing at the same date. Yet somehow Chrome is getting it wrong.
I also tested FireFox, which also appears to be getting it wrong:
I can also reproduce these results in Node.js.
But yes, Edge is getting it correct:
Do note that the browsers also differ in which direction they adjust a local time that falls into the "gap" created by the spring-forward transition. This is expected, and is being worked on in for a future version the of ECMAScript spec.
I don't work on the actual implementation within these browsers, but my understanding is that both Chrome, Node, and FireFox rely on ICU for their time zone internals. My guess is that it is an ICU bug that is being exposed here. Update: It appears to be a bug in the Microsoft C/C++ Runtime. I'm working on getting it to the right folks.
As far as what to do about it - if accurate historical time zone data is essential to your application, I strongly suggest you not rely on the environment to provide it, but bring it yourself using one of the libraries I listed here, such as moment-timezone (which I help maintain).

EMV Offline Approval/Decline

I'm developing an interface to a VeriFone VX terminal. Although, this is really a general EMV question. Our processor has a zero floor limit, so it will always be sent online. However, in case it ever changes, how do you know (what tags) if the transaction was approved or declined offline? Or, in other words, how do you know to go online or not?
how do you know (what tags) if the transaction was approved or declined offline? Or, in other words, how do you know to go online or not?
The terminal has to decides either to proceed the transaction offline, to go online or to reject the transaction. Here terminal send a command (AC) to the card and response of this command helps terminal to decide the action next followed.
Decision making is depend on three fields -
1) - Issuer Action Code
2) - Terminal Action Code
3) - TVR
IAC, TAC and TVR have the same structure. For more to know this data you can see EMV BOOK 3
IAC Usage Example-
suppose IAC-ONLINE (TAG - 9F0F) = 08 00 00 00 00 ,
here byte 1 bit 4 is on i.e. offline DDA Failed ,
Here Issuer want to go online if offline DDA Failed.
when terminal perform DDA and it fails, it set corresponding bit in TVR
that means TVR says- offline DDA is failed for this card.
now terminal check IAC online and found DDA_Failed bit is on and same on in TVR, here terminal decision would be to go online and then it send a Gen AC command to card with p1 = 80 ( ARQC - Online authorisation requested).
Coding of P1 as below
Ex- Gen AC command
C: 80 AE 80 00 other data
R: SW1/SW2=9000 (Normal processing: No error) Lr=32
77 1E 9F 27 01 80 9F 36 02 02 13 9F 26 08 2D F3
83 3C 61 85 5B EA 9F 10 07 06 84 23 00 31 02 08
.
Now decision is made by card, Terminal get card decision in the response of Gen AC command. Card return tag 9F27 - Cryptogram Information Data. here card return 80 i.e. cards wants transaction to go Online.
Really your question is important and you need to read more spec for clarity on this topic. Please checks EMV BOOKs, for more in this topic. also can read - Terminal action analysis or Card Action analysis
Assuming you're using VeriFone's VIPA API, then the first 'Continue Transaction' command (GenAC1) returns tags wrapped in a TLV template (or 'constructed' TLV tag). The value of this template determines the result:
E3: Locally authorized
E4: Requires online authorization
AFAIK (in vanilla EMV) the tag Cryptogram Information Data ('9F27') returned during 1st GENERATE AC should serve this purpose.
See EMV Book 3, Table 14.
Beware, that this tag contains the decision of the card, so you won't see the cryptogram type the kernel required.

Converting a .log file into CSV format

I am performing a number of trace routes to different IP's throughout the course of 1 week. Ive got a script that performs a set of trace routes and writes and appends them to the same .log file.
This file is obviously now quite large as I'm performing trace route 3 times a day on 6 targets for a week. Im trying to write a simple program that will convert my log files into CSV format for analysis in Excel.
Before each trace route runs it prints ''--- START ---'' and finishes with ''--- END ---''. See the following example:
--- START ---
Mon Mar 12 22:45:05 GMT 2012
traceroute to xxxxxxxx (xxxxxx), 30 hops max, 60 byte packets
1 xxxxxxx (xxxxxxx) 1.085 ms 1.662 ms 2.244 ms
2 xxxxxx (xxxxxx) 0.792 ms 0.782 ms 0.772 ms
3 xxxxxx (xxxxxx) 8.545 ms 9.170 ms 9.644 ms
4 etc
5 etc
--- END ---
--- START ---
Mon Mar 12 22:45:05 GMT 2012
traceroute to xxxxxx (xxxxx), 30 hops max, 60 byte packets
1 xxxxxxx (xxxxxxx) 0.925 ms 1.318 ms 1.954 ms
2 xxxxx (xxxxxx) 0.345 ms 0.438 ms 0.496 ms
3 xxxxxxx (xxxxxx) 0.830 ms 2.553 ms 0.809 ms
4 etc
5 etc
--- END ---
I was going to use the START and END to delimit and separate each trace route from one another. I also need to take the total number of jumps that each trace routes makes, that being the last number on the line before ''--- END ---".
If anyone could help me out it would be great. I need something that will run through each trace route, separating them. And then showing the number of hops each trace route makes... Im currently using MATLAB.
Cheers.
The best way to solve your problem is using regex. Just find those start and end tags and for each match make the necessary processing :)