media – Getting image data from phone camera (MediaDevices.getUserMedia) into user post

Sorry for the newbie, and poorly arranged question…

I’m trying to develop a super simple user based wordpress site. I want logged in users to take a photo with their phone which is then uploaded as a WP post (with a few additional fields, but I think that’s the easy part). Ideally the image or Post should be geotagged (I’m working with Google Maps API – I’ve got the site to ask permission for user location and show on Google Maps where the user is situated).

I’ve got some of the various components working separately, but not yet together.

I’m using the Navigator.mediaDevices web API to get the user camera working (I used this reference: https://blog.prototypr.io/make-a-camera-web-app-tutorial-part-1-ec284af8dddf)

BUT I cannot figure out what process I must take to save/embed this captured image into a WP post?

I know I can do a more simple ‘user upload’ form, where the user simply clicks ‘upload file’ then selects ‘camera’ and takes a photo, but the problem with this solution is it requires more steps of the user, and I need the camera to be ‘live”https://wordpress.stackexchange.com/”active’ as soon as they log onto the site.

I know this is super vague so far, so I don’t expect any solid answers, but some tips on which path I should follow would be much appreciated!

Thanks

what kind of locks are applied by Azure Synapse when loading data using COPY INTO

what kind of locks are applied by Azure Synapse when loading data using COPY INTO, if we are running extract from synapse dw (say from table A) and simultaneously loading new data into a some other (say table B). Will it cause any locks, will we face slowness or any locks while extracting data from table A

c# – What data structure works best with File Explorer-type applications?

I’m working on a desktop application in C# that reads a directory and displays in a DataGridView the directory entries of the PDFs found in that directory, like a File Explorer that only shows PDFs. The user will need to be able to rearrange the order of the files in the DataGridView by dragging and dropping (single row select, not multi). This reordering is not written to disk and is completely arbitrary, not by date or file name or anything like that. This is why the user reorders the files by dragging and dropping. After this, the user has the application process the PDFs in the rearranged order by looping through the rows of the DataGridView.

I had originally used a DataSet with a DataTable to store the directory contents. This DataTable is bound to the DataGridView with a BindingSource. I used this approach because it let me do a lot in the Visual Studio Designer. However, you can’t insert and remove elements from a BindingSource if its bound to a DataTable. You would have to do the inserting and removing at the DataTable, but there’s no way to insert a row at a specific location in a DataTable, so basically, I need a different kind of data source for my DVG.

Although Lists are not multicolumn, I know you can create an array of objects, one object per column, and store the array as a List entry. I know you could also use a Class or a Dictionary, but I don’t know the pros and cons of using each. Can you give a brief rundown of each?

What about not using an in-memory structure but instead use the DVG in unbound mode, programmatically adding the rows as each directory entry is read? Once the files are ordered as the user desires, whatever processing is done to them will be done with a loop that cycles through the DGV rows, not the rows in the DataSource. Everything I read encourages to use data sources with their DGVs, but is this a use case that calls for unbound mode?

What do you call a data structure containing multiple lists?

I was thinking about a data structure to make concatenation of lists easier, something that contains multiple lists (in a sequence) internally, but can be treated as a single contiguous list. I know such a data structure must exist out there already, and I would like to find articles about its performance, but I don’t know what it’s called. The closest thing I’ve found so far is a skip list, but that seems to be more like a binary search tree and isn’t just for dumping elements in.

I thought of implementing it something like this – the data structure L starts out containing an empty doubly-linked list of arrays.

()

Then, when an array or other list-like data structure is added to it, it becomes the first element.

Add (100, -4, 2) to L
Head -> (100, -4, 2) <- Tail

The next array added becomes its second element, and so on.

Add (2, 6, 1) to L
Head -> (100, -4, 2) <-> (2, 6, 1) <- Tail

Add (4, 5) to L
Head -> (100, -4, 2) <-> (2, 6, 1) <-> (4, 5) <- Tail

L will only expose methods to iterate over it one at a time, so it can be treated as a normal list.

database – When would I pick NoSQL over SQL when dealing with partly schema-less data?

so, I’m currently developing a feature for a website of mine, which aims to gather a set of financial data from the user so the user can start and take care of a budget, as well as the website offering some budgeting advice and offer some finance charts.

The data is supposed to be used like this:

  • Users have to enter a set of a few “base” expenses or incomes, being groceries, salary etc.
  • Additionally, the user will be offered the possiblity to offer as much free fields as he/she wants, which basically just consist of a name, type (income/expense) and value.
  • There is not much data processing to be done, all my application will use is a accumulated number of total cashflow. The rest of the data is queried from DB, and directly forwarded to the UI
  • The data can be updated at any time

Personally, I have only worked with regular relational databases before, except for Azure TableStorage. But besides that, barely any practical NoSql knowledge. However, I roughly know the differences, advantages and disadvantages. In this case I thought this was a perfect fit for a NoSql database, because:

  1. There’s no complex or rigid relation to be held here
  2. The data is (partly) schemaless and needs to be extensible
  3. This is potentially an operation that is executed a lot

However, after talking to a few people, they still suggested to use SQL for this. The way to do this is quite clear to me, I’d probably have a table with the type (income/expense), the name of the item, the value, and an indication to map this to a given user.

Okay, perfectly valid. However, I thought this is very much a good use case of NoSQL. This is not the first time I thought I hit a good use case for a NoSQL usage, just to find out in the end (when talking to people who definitely know better) that a traditional relational database is the way to go.

So, what boxes would my use case have had to tick in addition to this to be considered a good NoSQL use case?

data – function over list mathematica

I work on problem that need to define function with two list of data as follow

a = {0.1, 0.233, 0.65, 1.56};
b = {0.99, 0.8, 0.9, 1.9};

ELCDM1(z_?NumericQ, om_?NumericQ) := 1/Sqrt(om*(1 + z)^3 + 1 - om);

angdist(zmin_?NumberQ, zmax_?NumberQ, om_?NumberQ) := (3*10^5)/(

   1 + zmax) NIntegrate(ELCDM1(z, om), {z, zmin, zmax});

“a” is list of lower bound of integrate and b is upper bound. The true outcome for my function “angdis” is
{100707., 71762., 25625.6, 13508.}. For me I should put first list “a” to my function and at the end of my program put list “b” so as I did as follow the outcome is different with {100707., 71762., 25625.6, 13508.}.

angdist3(x_, 
   om_) := (3*10^5)/(1 + #) NIntegrate(ELCDM1(z, om), {z, x, #}) & /@ 
   b;

angdist4(om_) := angdist3(#, om)((#)) & /@ a;

angdist4(.3)

here is the outcome :

{{100707., 92199.9, 97142.2, 111441.}((
  0.1)), {82220.6, 71762., 77779.9, 98755.}((
  0.233)), {32424.9, 16710.2, 25625.6, 64584.9}((
  0.65)), {-42008.8, -65580.4, -52333.9, 13508.}((1.56))}

Any suggestions would be greatly appreciated.

c# – Get User Data from Entry in View Page in Xamarin

In my Xamarin App, I was able to get the data from user through Entry and bind it in ViewModel.cs.

But, now I want to get this user data from Entry in ViewPage.

Below is code for Entry in .xml page and also of the Data Biding I was using ViewModel (it was working perfectly).

How could I get the user data through Entry in PageView.xml.cs too.

PageView.xml

<Entry
    Text="{Binding Email}"
    Keyboard="Email"
    ReturnType="Done"
    FontSize="15"
    Placeholder="Enter Email" >
</Entry>

<Entry
    Text="{Binding Password}"
    Keyboard="Numberic"
    ReturnType="Done"
    FontSize="15"
    IsPassword="true"
    MaxLenght="8"
    Placeholder="Enter Password" >
</Entry>

<Button
    x:Name="SubmitButton"
    Text="Submit" />

PageView.xml.cs

FormDataButton.Clicked += async (sender, args) =>
{
    if (Email != null && Password != null && Password.Lenght == 8)
    {
        // sample code
        var email = Email;
        var password = Password;
    }
    else{
        Console.WriteLine("Error");
    }
}

Data Binding I was using in ViewModel.cs

private string _Email;
public string Email
{
    get => _Email;
    set => this.RaiseAndSetIfChanged(ref _Email, value);
}

private string _Password;
public string Password
{
    get => _Password;
    set => this.RaiseAndSetIfChanged(ref _Password, value);
}

mysql cursor not fetching data from select query inside stored procedure

I have written the following procedure but the the cursor is not displaying or inserting any data. I have ran the select query separately and it returns data properly.

I tried checking other solutions on stack overflow and dba stack exchange but the solutions are not fixing the issue.

The most close answer found was This

As advise in the answers in the above mentioned links I renamed all the variables with _ in varibalename but still it cursor doesn’t display or insert data

Any help would be appriciated.

DELIMITER $$

CREATE PROCEDURE getUniquePartnerIds()
BEGIN

DECLARE temp_partnerId INTEGER DEFAULT 0;
DECLARE is_finished INTEGER DEFAULT 0;

DECLARE cursor_Partnerid CURSOR FOR 
SELECT DISTINCT(partnerId) FROM multiplepartners WHERE partnerId NOT IN (SELECT partnerId FROM partner_language);

DECLARE CONTINUE HANDLER FOR NOT FOUND SET is_finished = 1;
        
OPEN cursor_Partnerid;
        
get_PartnerId: LOOP
FETCH cursor_Partnerid INTO temp_partnerId;
SELECT temp_partnerId;
IF is_finished = 1 THEN LEAVE get_PartnerId;
END IF;     
        
-- INSERT INTO `partner_language`(`partnerid`)
-- VALUES (temp_partnerId);     
END LOOP get_PartnerId;
CLOSE cursor_Partnerid;
    
END$$

DELIMITER ;

How to perform a http post using c++ and json data

Obrigado por contribuir com o Stack Overflow em Português!

  • Certifique-se de responder à pergunta. Entre em detalhes sobre a sua solução e compartilhe o que você descobriu.

Mas evite

  • Pedir esclarecimentos ou detalhes sobre outras respostas.
  • Fazer afirmações baseadas apenas na sua opinião; aponte referências ou experiências anteriores.

Para aprender mais, veja nossas dicas sobre como escrever boas respostas.

data collection – InfluxDB with Zabbix or Telefraf?

I’m considering the use of InfluxDB to store thousands of measurements per second from routers in a network. Each measurement is lightweight (between 10-20 bytes). Now, I’m wondering what is the best strategy: InfluxDB + Zabbix? Or Telefrag? Or another alternative?

  1. InfluxDB + Zabbix: according to

https://www.zabbix.com/integrations/influxdb

there is a possible integration. However, it seems the integration involves taking data that was collected in a Zabbix database and moving it to an InfluxDB to take advantage of InfuxDB using much less storage. So they meant it to be for archiving large amounts of data.

However, we believe Zabbix itself is too slow, no? The integration above would not work for online data collection, right? We need fast storage, and we do not want Zabbix to be a bottleneck. Are there known benchmarks and recommendations about Zabbix + InfluxDB integration, for online collection + storage?

  1. InfluxDB + Telegraf: according to

    https://www.influxdata.com/blog/monitoring-openwrt-with-telegraf/

there is also the possibility of integrating InfluxDB + Telegraf for data collection. Are there best practices and/or benchmarks about data collection with Telegraf + storage with InfluxDB?

  1. Are there other alternatives and/or suggestions for large scale data collection and integration with InfluxDB?