Extract data from website using TEdgeBrowser Delphi 10.4 - parsing

I would like to know how to extract some data from this website
https://estrelabet.com/ptb/games/detail/casino/demo/7787
It is a game.
I need to extract the last coeficient of each round, and the total of bets to feed a table.
For example:
Total Bets: 2100
Payout coeficient: 2.35
I need to save 2100 and 2.35 in my table.
I am trying to do a data analisys about the game statistics.
I am using Delphi 10.4 and loading the game using TEdgeBrowser.
Thank You

Related

Quandl wiki data different than Yahoo or Bloomberg data

Does anyone notice quandl WIKI or EOD data are different than Yahoo or Bloomberg? I notice this when I was comparing data providers, which I am using AAPL as a test. AAPL split its stock 7 for 1 on Jun 9, 2014, so I think it is an ideal candidate to compare data.
Here is a picture of data comparison:
Do you know why they are different and which one I should trust? If I should trust neither, is there any other free data provider I can trust?
It depends on whether you adjust the dividends too (the series starting at 52 is adjusted for dividends, the series starting at 58 is not).
For reference, Bloomberg data:
Unadjusted price Adjusted for split Adjusted for split & div
27/12/2011 406.53 58.0757 52.4533
28/12/2011 402.64 57.52 51.9514
29/12/2011 405.12 57.8743 52.2714
etc.

Data storage for time series data

I have some scientific measurement data which should be permanently stored in a data store of some sort.
I am looking for a way to store measurements from 100 000 sensors with measurement data accumulating over years to around 1 000 000 measurements per sensor. Each sensor produces a reading once every minute or less frequently. Thus the data flow is not very large (around 200 measurements per second in the complete system). The sensors are not synchronized.
The data itself comes as a stream of triplets: [timestamp] [sensor #] [value], where everything can be represented as a 32-bit value.
In the simplest form this stream would be stored as-is into a single three-column table. Then the query would be:
SELECT timestamp,value
FROM Data
WHERE sensor=12345 AND timestamp BETWEEN '2013-04-15' AND '2013-05-12'
ORDER BY timestamp
Unfortunately, with row-based DBMSs this will give a very poor performance, as the data mass is large, and the data we want is dispersed almost evenly into it. (Trying to pick a few hundred thousand records from billions of records.) What I need performance-wise is a reasonable response time for human consumption (the data will be graphed for a user), i.e. a few seconds plus data transfer.
Another approach would be to store the data from one sensor into one table. Then the query would become:
SELECT timestamp,value
FROM Data12345
WHERE timestamp BETWEEN '2013-04-15' AND '2013-05-12'
ORDER BY timestamp
This would give a good read performance, as the result would be a number of consecutive rows from a relatively small (usually less than a million rows) table.
However, the RDBMS should have 100 000 tables which are used within a few minutes. This does not seem to be possible with the common systems. On the other hand, RDBMS does not seem to be the right tool, as there are no relations in the data.
I have been able to demonstrate that a single server can cope with the load by using the following mickeymouse system:
Each sensor has its own file in the file system.
When a piece of data arrives, its file is opened, the data is appended, and the file is closed.
Queries open the respective file, find the starting and ending points of the data, and read everything in between.
Very few lines of code. The performance depends on the system (storage type, file system, OS), but there do not seem to be any big obstacles.
However, if I go down this road, I end up writing my own code for partitioning, backing up, moving older data deeper down in the storage (cloud), etc. Then it sounds like rolling my own DBMS, which sounds like reinventing the wheel (again).
Is there a standard way of storing the type of data I have? Some clever NoSQL trick?
Seems like a pretty easy problem really. 100 billion records, 12 bytes per record -> 1.2TB this isn't even a large volume for modern HDDs. In LMDB I would consider using a subDB per sensor. Then your key/value is just 32 bit timestamp/32 bit sensor reading, and all of your data retrievals will be simple range scans on the key. You can easily retrieve on the order of 50M records/sec with LMDB. (See the SkyDB guys doing just that https://groups.google.com/forum/#!msg/skydb/CMKQSLf2WAw/zBO1X35alxcJ)
Try VictoriaMetrics as a time series database for big amounts of data.
It is optimized for storing and querying big amounts of time series data.
It uses low disk iops and bandwidth thanks to the storage design based on LSM trees, so it can work quite well on HDD instead of SSD.
It has good compression ratio, so 100 billion typical data points would require less than 100 GB of HDD storage. Read technical details on data compression.

Set printer driver specific data

We have an application that prints 2 invoice copies - 1 on white (for the cust) and 1 on blue (for us).
We print a LOT of these so we are getting a printer with 3 big trays. One tray (tray 5) holds 4000 sheets and the other two (trays 3 and 4) are a tandem set holding 1600 and 2000 sheets. The application automatically generates the invoice and sends one document to the tray with the white paper and one to the tray with the blue paper.
The user has no input in this process.
Now, my problem is this - if I specifically send the blue copy to tray 3 and there is no paper in tray 3, the job will go on hold until someone loads it up even though tray 4 has 2000 more sheets ready to go. On the other hand, if I tell the printer to print on Blue 8 1/2x11" paper, it is smart enough to know that that type of paper is in both trays and to pull from either one until they are both empty. So, I want to change our application to select a paper type/size and color instead of a specific tray.
The program is written in Delphi and I have been looking at the DEVMODE structure returned by TPrinter.GetPrinter. The DEVMODE structure has a memory size in dmDriverExtra that indicates how much extra data the print driver is adding to the structure for its own storage.
Does anyone know of anyway to access this data and make changes to it? If you have examples in other languages, I can probably adapt it to Delphi so anything will help.
There are actually two different items in the questions:
How to set the pater size and type:
PaperSize would be stored in dmPaperSize (value DMPAPER_LETTER)
PaperType is a bit more difficult. I'd guess that it's in dmMediaType (use DeviceCapabilities to retrieve available media types and their names)
How to access / edit "DriverExtra" data:
In short: don't!
A bit longer: dmDriverExtra is described as "Contains the number of bytes of private driver-data that follow this structure". So this data is private to the driver (which means that you need very good documentation for the driver to actually know the format and content of this data. It's not guaranteed that different versions of the driver use the same format).
So the only thing you can do is to use a print dialog, retrieve the DevMode structure and store it for further use (however as I said: If the driver changes, this data may become invalid...)

parsing UniMag II encrypted swipe data to get Track1 and Track 2?

I am using a IDTech Shuttle to swipe card data in my iOS app and I need to send Track1 and Track2 as separate values to my card processor. I have researched getting track1 and track2 data and it looks pretty straight forward except my returned swipe data does not follow the same format as described my all of the posts I have read.
My swipe data looks something like this:
J(LbÐðhQRÍm©½gÝD|}xÆÁ°ø)Cc+­%N9;Aq6*ØÉ\ØsÀüÝXþYü;tHÎMHãøÃH¡æ´v­¤æe£õ®;PJá#÷{oö zú5OËáÒðìåÍ.;°¿äT125007331bI$A
Æ
How do I parse that into 2 separate tracks? I am assuming there is some sort of format here
IDTECH encrypted devices (ED), Shuttle included, are HEX output and HID. You will need to acquire the SDK for the Shuttle specifically as there are 2 output formats for IDTECH ED's and I think the Shuttle uses the newer of the 2.
You can then build a parser which will count the field lengths, some are are just 2 (I believe the first 6 to 8 are) and some are variable with padding to conform to a fixed length.
I believe you can there are 3 fields, track 1 and 2, track 1 and track 2, you would be interested in.

Resampling of time-series data

Suppose I have an array of integer numbers. Each integer number represents the number of requests against a database within a 10 minute window. The array contains 20,000 numbers, representing a 4-month-period of continuous 10 minute windows. Now suppose I have 10 such arrays which come from 10 different real-world databases.
Now I want to generate 400 arrays out of the existing 10 arrays. I don't have much background in statistics but I read that simple bootstrapping is not applicable to time-series data (or dependent data in general). Is there a simple method based on bootstrapping that works for time-series data and what software (stand-alone or libraries, preferably free) is available to get this done without putting in more than 2 days of development?
Thanks for your help,
Jan

Resources