Migrating big data to new database

Uncategorized
Question: I'd like to transfer a large amount of data from SQL Server to MongoDB (Around 80 million records) using a solution I wrote in C#. I want to transfer say 200 000 records at a time, but my problem is keeping track of what has already been transferred. Normally I'd do it as follows:Gather IDs from destination to exclude from source scope Read from source (Excluding IDs already in destination) Write to destination Repeat The problem is that I build a string in C# containing all the IDs that exist in the destination, for the purpose of excluding those from source selection, eg. select * from source_table where id not in () Now you can imagine what happens here when I have already inserted 600 000+ records and then…
Read More

QProcess won’t finish on kill() close() or terminate()

Uncategorized
Question: I'm trying to play video through QProcess (sadly QMediaPlayer still work poorly when it's needed to play lot of files during one session and I have no time to learn vlc at the moment), but I need to stop playback at some moments. I'm trying to kill process at some moment, but it just continue to work and I don't understand what am I doing wrong. Can someone help me please? Launch code:process_ = new QProcess(this); int screen_ = 2; QString path_ = "D:\Movies\video.avi"; QString vlc_path = ""c:\Quest\VLC\VLCPortable.exe""; QStringList arguments; arguments
Read More

Medica – Medical HTML Template

Uncategorized
Medica – Medical HTML Template is powerful and eye-catching HTML Template. It is fully responsive, well structured and beautiful HTML template which is specifically designed for for hospital,psychology, clinic, doctor, dentist, surgeon, gynecologist, drugstores, health-care, pharmacies, medical labs and other medical related organizations. This template is very easy to customize.
Read More

.NET Core Angular VS2017 Templates not building

Uncategorized
Question: I created a new NetCore Angular project in VS 2017 using dotnet new --install Microsoft.AspNetCore.SpaTemplates::* It was working fine until I made some changes like removing some existing components from template. There is only one home component in the template After that, I run project without any change. I tried to clear cache and refresh the browser but unfortunately, i'm getting the same problem. Nothing change Is there anything missing? The components I removed are still there. Why? Best regards, Henry Answer: Read more
Read More

How to calculate the weight of haar-like features?

Uncategorized
Question: I'm trying to implement Viola-Jones algorithm. And I refer opencv docs, I found difference between the original algorithm and opencv. Original Algorithm: haar features = rect1 -rect2; Opencv: haar features = w1*rect1 - w2*rect2; I have already known Adaboost algorithm. But I haven't find the way of defining weight(w1,w2). Could anyone tell me that way or a good reference? Answer: Read more
Read More

How to get the bond interface session IP

Uncategorized
Question: I have a bond consisting of 3 IPs bond1 - 10.196.124.35 bond1:1 - 10.196.124.36 bond1:2 is a virtual interface - 10.196.124.30 When I open a putty session to one of the IPs, how can I check from the shell if I'm currently using the virtual interface or to one of the physicals? Answer: You can figure out which target IP you are using (with openssh server). Variable SSH_CONNECTION contains source IP, source port, target IP and target port. read -r sip sp tip tp
Read More

How do I access this property of an object from a RESTful API?

javascript
Question: I'm writing to the community today as I'm having some confusion while trying to access an Object Provided by an API. API Used:Cloudflare's v4 API is used: The applicable documentation is available at https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules Concept: I'll receive an object identical to myObject when accessing the API however to make sure that we understand the object I've included source code that can access it below. The object with pretty formating { "result": [{ "id": "e9a821b6379bd22539226a4cc6956144", "mode": "challenge", "allowed_modes": ["block", "challenge", "whitelist", "js_challenge"], "status": "active", "notes": "BY API", "scope": { "id": "981969ce21909a61b62905c585ec9aaa", "email": "user@example.com", "type": "user" }, "configuration": { "value": "AD", "target": "country" }, "created_on": "2017-08-06T17:05:19.126546Z", "modified_on": "2017-08-06T17:05:19.126546Z" }], "result_info": { "page": 1, "per_page": 1, "total_pages": 251, "count": 1, "total_count": 251 }, "success": true, "errors": [], "messages": [] } The code…
Read More

Laravel SQL Query

Uncategorized
Question: I have sample database id | Name | Email | Group 1 John Doe jdemo@yahoo.com A 2 Robert Chow robertdemo@gmail.com B 3 Lee Tee leedemo@aol.com C I use autocomplete(Ajax for search and to show data on table) On my SearchController This is my Code if ($request->ajax()) { $output = ""; $orderinfo=DB::table('tb_client') ->where('email','LIKE','%' .$request->search. '%' ) ->orWhere('id','LIKE','%' .$request->search. '%') ->orWhere('group','LIKE','%' .$request->search. '%') ->get(); } I want to have filter this that Only Group (A) should be listed on my html table so if user search for Lee Tee it will show not belong to your Area , Answer: Change your where clause :$orderinfo = DB::table('tb_client') ->where(function ($query) { $query->where('email','LIKE','%' .$request->search. '%') ->orWhere('id','LIKE','%' .$request->search. '%'); }) ->where('group', 'A') ->get(); Also I don't recommend to use LIKE on id field! Read more
Read More