Logic thread between output folders and input transactions

I’m studying the bitcoin protocol and I don’t have very clear things, for example the logical thread that exists between an output transaction and a subsequent input transaction, where that output is direct.

I realized that the input transaction contains the reference to the output transaction through the Outpoint type, but now how could the input transaction related to the output transaction be identified?

an example

Bob sells a coffee to Alice and Alice pays in bitcoins, then bob spends his input transaction coming from the alice output transaction, Now I want to find and the two Rawtransactions where the alice transaction information and the bob information are contained for connect the two RawTransactions. I believe that I haven’t understood any important steps to do this

Sorry for my terrible English but I’m learning

Can’t delete files from external hard drive / Input – Output error

I can’t delete some files from a external hard drive. This the result i get in the terminal when i try to do it:

camilo@camilo-S400CA:~$   sudo rm -r '/media/camilo/TOSHIBA EXT/Descargas' [sudo] password for camilo:  rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Dragon Ball Z Season 1 BrRip FullHD 1080p Spa Latino, Japanese, English + Sub/14. Princess Snake.mkv.part': No such file or directory rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Dragon Ball Z Season 1 BrRip FullHD 1080p Spa Latino, Japanese, English + Sub/38. Nursing Wounds.mkv.part': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 1997 - Paroles Musicales': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 1956 - Violeta Parra, acompañada de guitarra (Folklore de Chile Vol. II)/13 - Tonada del medio.mp3': Is a directory rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 1956 - Violeta Parra, canto y guitarra (Folklore de Chile Vol. I)/17 - La paloma ingrata.mp3': No such file or directory rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 1971 - Canciones Casa de las Americas': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 2003 - Memoria del cantar popular/05 - Que dirá el santo padre.mp3': No such file or directory rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 2004 - Grandes Exitos': No such file or directory rm: cannot remove '/media/camilo/TOSHIBA EXT/Descargas/Violeta Parra - 26 discos/Violeta Parra - 2004 - Puras Cuecas/23 - Aromas.mp3': No such file or directory camilo@camilo-S400CA:~$   sudo rm -r '/media/camilo/TOSHIBA EXT/Juegos/Doom' rm: cannot remove '/media/camilo/TOSHIBA EXT/Juegos/Doom/Mods/Doom 64/D64RTR_BRIGHTMAPS.PK3': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Juegos/Doom/Mods/Doom 64/D64RTR_CHANGELOG.TXT': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Juegos/Doom/Mods/Doom 64/D64RTR_INSTRUCTIONS.TXT': Input/output error rm: cannot remove '/media/camilo/TOSHIBA EXT/Juegos/Doom/Mods/Doom 64/D64RTR_README.TXT': Input/output error camilo@camilo-S400CA:~$    

Apart from these the drive is working ok.

I tried to run a SMART test to the drive but i was unable to because according to GSmartControl and GnomeDisks the hd does seem to have Smart Control, which is weird because i buyed this thing like two or three months ago.

Thanks in advance!

Prints information about a restaurant (provided by user input) using a .txt file

My code works, but not the way I want it to. If a user provides a string, even if the string doesn’t match a name in the array, it will print information about all 5 restaurants. If I put a break statement, it will only print the information for the first one (as I would expect it to).

Code:

#include <stdio.h> #include <malloc.h>  typedef struct restaurants{     char name[50];     char type[50];     float avg;     int rating; }restaurant;  int readRestaurantsFromFile(restaurant **restaurants, char fileName[]) {     int size, i;     restaurant *arr;     FILE *fp;     fopen_s(&fp, fileName, "r");     if (fp) {         fscanf_s(fp, "%d", &size);         arr = (restaurant *)malloc(sizeof(restaurant) * size);         for (i = 0; i < size; ++i) {             fscanf_s(fp, "%s", arr[i].name, sizeof(arr[i].name));             fscanf_s(fp, "%s", arr[i].type, sizeof(arr[i].type));             fscanf_s(fp, "%f", &arr[i].avg);             fscanf_s(fp, "%d", &arr[i].rating);         }         *restaurants = arr;         fclose(fp);     }     else {         printf("Can not open %s to read...\n", fileName);     }     return size; }  void printDetails(restaurant *arr, int size, char res_name) {     for (int i = 0; i < size; ++i) {         if (res_name = arr[i].name) {             printf("Food: %s\n", arr[i].type);             printf("Avg. Meal: $  %.2f\n", arr[i].avg);             printf("Rating: %d\n\n", arr[i].rating);         }     } }  int main() {     restaurant *arr;     int size = readRestaurantsFromFile(&arr, "C:\Users\Owner\source\repos\FedericoReadLab6Problem2\FedericoReadLab6Problem2\reviews.txt");     for (int i = 0; i < size; ++i) {         char buffer[50];         printf("Enter a restaurant: ");         char res_name = fgets(buffer, sizeof buffer, stdin);         printDetails(arr, size, res_name);     }     system("pause"); } 

Sample output (just for the first iteration):

Enter a restaurant: Chili's  Food: American Avg. Meal: $  10.95 Rating: 2  Food: American Avg. Meal: $  4.50 Rating: 1  Food: Breakfast Avg. Meal: $  9.50 Rating: 1  Food: AmericanizedItalian Avg. Meal: $  11.00 Rating: 1  Food: American Avg. Meal: $  6.75 Rating: 2 

Имитация :hover через input

Интересует возможность имитации наведения :hover через input type="checkbox", помимо того, что через input можно изменить стили смежных элементов. То бишь, к примеру, есть изображение с секторами, при наведении на один из секторов – выводится определенная информация. Можно ли через checkbox показать сразу всю предыдущую информацию, посредством :hover? Или придется дописывать дубликаты-стили к каждому объекту?

PHP 7 como puedo ver el error que estoy teniendo en un input file

Estoy subiendo una imagen desde movil , me llega a este fichero subida_imagen.php

Pero me esta diciendo que tengo un error,

$  fileError = $  _FILES['imagen']['error']; 

le hago un var_dump($ fileError) y obtengo lo siguiente:

array(size=5)   'name'=> string : '1675157615761576171651757165.jpg'   'type'=> string ''   'tmp_name'=> string ''   'error'=> int 1   'size'=> int 0 

Como puedo saber el error que me esta dando? solo me dice que tengo un error, pero cual es?

Magento 2.3: Uncaught SyntaxError: Unexpected end of JSON input

I have an error in my admin configuration when viewing Payment Methods section which only appears when I enable the Amazon_Core module which prevents me from being able to save settings for my payment methods:

Uncaught SyntaxError: Unexpected end of JSON input     at JSON.parse (<anonymous>)     at getData (main.js:58)     at Array.map (<anonymous>)     at Object.apply (main.js:74)     at HTMLDocument.bootstrap (bootstrap.js:106)     at fire (jquery.js:3232)     at Object.add [as done] (jquery.js:3291)     at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)     at jQuery.fn.init (jquery.js:2967)     at new jQuery.fn.init (jquery-migrate.js:241) 

If I disable the Amazon_Core module, this error goes away and the admin payment method section works as expected.

Any ideas how to trouble shoot this error?

Ultimately, we’re needing to be able to use the Amazon Login & Payment modules. What’s odd is this error is not present in our local environment, only on our live server.

Input data preparation for components [on hold]

Problem:

I’m lookin for lightweight templates system (not logic-less) / other solution, which have rich collection of functions that allows to operate on arrays and strings, data formatting etc., or other solutions that provides me safe possibility to manipulate on received, local data.

Languages:

PHP (required) / JS (optional but will be fine – will avoid communication beetwen frontend and backend).

What’s needed:

Components compilation in dedicated solution.

Limitations:

Solution that I working on will be redistributed on customers servers so I dont have access to servers configuration.

Important:

Components receives only data and are not able to prepare input data.

Also important:

Templates system / solution must be free for commercial use and redistribution. I ask question before writing custom solution to resolve my problem.

Changing Input Source not working in some apps

I have a couple of Input Sources set up (Australian and Teknia Greek, the latter added into ~/Library/Keyboard Layouts). These work correctly in some apps (e.g. Chrome, TextMate), but in other apps (all Office apps, TextEdit, Notes) I am unable to use Teknia Greek. Even if this is selected while focused on another app, as soon as I focus back on one of these apps, the Input Source switches back to Australian. This only affects my MacBook Pro. My iMac has the same setup and works correctly. Both are running Mojave.

How to prevent Cross Site Scripting when input using “Full HTML” mode of ckeditor in Drupal?

I am using Drupal version 8.3.7 and ckeditor 4.11.3. I create a basic page contains some scripts as following: Page creation

In the detail page, I can see that the script in onmouseover="alert('222222')" is executed when I move my mouse over the “click” text.

Page detail

Hacker can easily add a malicious script by this way. How can we avoid this ?

Issue is not only for “Full HTML” mode, but also other modes if we configure a proxy between browser and server to change the encoded value to the raw value.

For example, if we select the “Unfiltered HTML” mode and we input <a href="#" onmouseover="alert('111111')">click</a> to the body field. When we save the page, the body value will be sent with a POST request that it is HTML encoded: &lt;a href=&quot;#&quot; onmouseover=&quot;alert(&#39;111111&#39;)&quot;&gt;click&lt;/a&gt;. But in the proxy above, we configure to change the encoded value to the raw value. Then the raw value <a href="#" onmouseover="alert('111111')">click</a> is saved into DB which will cause the same issue with “Full HTML” mode.

A solution that we can encode the output in theme preprocessing hook. But it seems require us to add a lot of codes because our system may have many entity types and fields.

how to test input image from pre trained CNN model

i have saved my CNN model in .pth file. Using Pytorch. I want to predict input image from my .pth file .I m getting this error. File “C:/Users/MS/PycharmProjects/GUI_last/test.py”, line 148, in print(‘Accuracy of the network on the test images: %d %%’ % ( 100 * (correct) /total)) ZeroDivisionError: division by zero

Process finished with exit code 1 and my code is here

    def testing(self):          model=torch.load("last_brain1.pth")         print(model)         criterion = nn.CrossEntropyLoss()         optimizer = optim.SGD(model.parameters(), lr=0.001, momentum=0.9)         loss = 0.0         correct = 0         total = 0.0         itr = 0         model.eval()         trainloss = []         testloss = []         trainaccuracy = []         testaccuracy = []         itr = 0;         itrloss = 0         itr = 0          for images, labels in testloader:             images = Variable(images)             labels = Variable(labels)             # CUDA=torch.cuda.is_available()             # if CUDA:             # images=images.cuda()             # labels=labels.cuda()             outputs = model[images]             loss = criterion(outputs, labels)             loss += loss.item()             _, predicted = torch.max(outputs, 1)             total += labels.size(0)             correct += (predicted == labels).sum()             itr += 1         testloss.append(loss / itr)         testaccuracy.append((100 * correct / len(testset)))           print('training loss:%f %%' % (itrloss / itr))         print('training accuracy:%f %%' % (100 * correct / len(model)))         print('test loss:%f %%' % (loss / itr))         print('test accuracy:%f %%' % ((100 * correct / len(testset)))) loss = 0.0 correct = 0 total=0 itr = 0  #print('Accuracy of the network on the  test images: %d %%' % (   100 * (correct) /total)) class_correct = list(0 for i in range(3)) class_total = list(0 for i in range(3)) with torch.no_grad():     model=torch.load("last_brain1.pth")     for data in testloader:          images,labels = data         images = Variable(images)         labels = Variable(labels)         outputs = model[images]         _, predicted = torch.max(outputs, 1)         c = (predicted == labels).squeeze()         # class_total=[]         for i in range(labels.size(0)):             label = labels[i]             class_correct[label] += c[i].item()             class_total[label] += 1 for i in range(3):     print('Accuracy of %5s : %2f %%' % (classes[i], 100 * class_correct[i] / class_total[i]))