How to automate getting ZKTeco Access Control Logs - sdk

How can I automate getting the logs of ZKTeco access control devices (InBio160/260)? The documentation regarding the SDK is not understandable at all. From the GUI perspective, you select the devices, press Get logs, and select delete all logs after downloading them. This is something that is done constantly so I don't understand why there is not a built-in scheduler performing this task?
If anyone has set up a ZKTeco access control system or worked with their SDK, any help would be appreciated. Attached is the UI and the get logs button I want to automate.
I need to sync data between different buildings but if the logs are not downloaded to the SQL Server a few times a day, the syncing program will not function properly.

I wrote an SDK wrapper in C#. Code on github
It contains all functions you may need, It can at least help you understand the SDK.
This is the function you want to call to get the log: ReadTransactionLog
Transaction[]? transactions = ReadTransactionLog(0); // 0 = all log, epoch time in seconds

Related

Firebase Analytics - Custom Event, see percentages instead of values (iOS)

In my ios app, users upload files. I am logging a custom event called "upload_time" because I would like to see approximately how long uploads are taking.
FIRAnalytics.logEvent(withName: "upload_time", parameters: [
kFIRParameterItemID: "upload_time_\(Constants.versionNumber)",
kFIRParameterItemName: val
])
I would like to be able to filter by the version number of the app and see the percentages of upload times. I have divided up times in 10s brackets so "val" is just rounded up to the nearest 10.
Just like how the select_content default event allows you to filter by content_type and then item_id, I would also like to be able to filter by version number and see the percentages for the different brackets of times in the console. At the moment, it seems that what I have setup is just adding up all the values for each day.
How I setup parameters in the console
Would greatly appreciate any help.
There's no way to configure ad hoc reports in the Firebase console.
If you want reports other than those provided in the console, then your best bet here would be to export the results to BigQuery and use a visualization tool.
Once you have these set up, the sky is the limit :)
Firebase Performance Monitoring sounds like a better fit if you're trying to measure upload times. Check out the getting started guide here. Performance Monitoring actually captures a bunch of network data automatically.
In addition, Performance Monitoring lets you filter by a number of parameters, such as device type, OS version, app version, and more. It's still in beta, so if there's some functionality that you'd like to have that isn't there yet, feel free to file a feature request.
To add another way to make this work in GA for Firebase is to Export the Firebase data to Big Query and run a query that calculates the percentage of upload time from all you app instances filtered by version.
Take a look at the Step 6 of this doc on sample query for Big Query data gather by Firebase.

Kimono Scrape Remains "In Progress"

I am having issues with Kimono Labs. Every scrape I run will run indefinitely without throwing an error or completing. Occasionally, the scrapes will randomly start working days in the future without any changes on my behalf - only to fail a few days later. I love Kimono because it is so easy to integrate with Google Sheets for friends to alter the data, but this has become problematic. There doesn't seems to be any related help in the Kimono help data for an issue such as this.
One of my scrapes is not behind a paywall and the other is. One is set to run daily and the one behind the paywall is set to run hourly.
What steps can I take to troubleshoot this error and get the ball rolling again?
I had a very simple API doing the exact same thing for weeks!
I'm only using a free account so I didn't have any support but I ended up sending a bug report at https://www.kimonolabs.com/support .
Strangely enough, the very next day, the API started working normally again (and has ever since). I assume they looked into it and fixed whatever was stopping my crawl from completing.

How can I use an online code compiler's output through in a code compiler app?

I want to make an app which compiles Swift code, so how can I use a website named www.swiftstub.com or any similar website to retrieve the output of the code? I want my app to have a simple UITextView in which the user can type the code. If a UITextView cannot be used, what can be used?
I want my app to send the code typed to this website, and then retrieve the output back and display it. How can this be done? Thanks!
Make an app that sends text to a server.
Have the server compile this code, run it, and capture the output.
Send this output back to the app.
Have the app display the output.
This is an extreme oversimplification, there are lots of things to consider, but these are kind of the big sections of whats there to to. You need to understand very well on the app side: UI and networking, and on the server side: triggering a compilation of text, capturing that output (command line, maybe Swift or Python can help you here) and HTTP(S) responses and requests (or sockets, even harder).
This does not sound like an easy task, so you are very courageous.
Build all components locally:
App:
- write an app with a textView and a button, and on the tap of that button, save the output to a textile. This is to avoid any networking complications at this point, later, instead of saving, you would send this to a server.
Server: (just build the things on your computer)
- write some script/program that can read in that textfile that was saved.
- Then you need to compile this code (lookup 'xcrun' on google) and capture the output. Save this output to a textile. Have your app load this file and display it.
The important thing to consider is the real server machine you will run this code on later: it has to be a machine that can compile, and execute Swift code. Currently, this means it has to be an OS X machine. This is hard to find, as most servers run linux, and there is no Linux Swift compiler yet.
Getting this to work would be a proof of concept: you can capture text from the app, you can grab this text and compile it, you can capture the output of the compilation, and you can have the app read that output and display it.
Once you've got this working, you would need to find a server that can do the compilation part, and run what you build to do that. Then you would need to write some code in your app that sends an HTTP request to your server containing this text, to which your server would respond with the output of that compilation.
As I said, this is a big undertaking, with lots of difficult parts and unexpected surprises, so don't expect this to be done in a couple of weeks, it will most likely be more like over six months.
Try to find someone who has experience on programming and setting up a server, that will really help you a lot.

Access Blackberry switch on/off and data usage logs

Not sure if this is the right place to ask the question.
I have a Blackberry Curve 9300 phone. Is it possible the access logs which shows when the phone was switched on and off. Also if it is logged when the data was used over network and over WiFi.
I would like to access it without using any code if possible. However, I do not mind a quick and dirty C# application that could allow me to do so. This is a once off activity and I do not really want to invest lot of time in writing code.
try using EventLogger API to get System events,and save it in Persistant DB as as the part of the your application and use it when required

What is the best way to make a Windows service ask the user for input?

I'm trying to write a program to ask me to input some information periodically, so I've written a service in C to run in the background, I can watch it reporting its okay by refreshing its log file. Now I'm stuck on how to get it to open up cmd and ask for the information.
I'd like to save this information to a log file. (I'm planning on monitoring my sleeping habits)
I tried using system("getinput.exe") and that seems to do nothing, I know using system() is bad but it was a first step.
CreateProcess() I simply cannot get to work, the example on MSDN http://msdn.microsoft.com/en-us/library/ms682512.aspx doesn't work for me, i just get CreateProcess failed (2) whenever i try createprocess.exe dir for example.
Surely there must be a way?
EDIT: Thanks for the replies I will try to take a different approach then. Where would I start with writing a background application that can occasionally ask for user input in C?

Resources