Posts

Showing posts from December, 2020

Insert failed: 1064 (42000): You have an error in your SQL syntax;

import mysql.connector from mysql.connector import Error as MySQLError class DatabaseManager(): """ This class manages access and CRUD operations to a MySQL database """ def __init__(self, host, port, name, user, password): """The constructor Args: host (str): server host of the database port (int): server port of the database name (str): name of the database user (str): name of user password (str): password of user """ self.host = host self.port = port self.name = name self.user = user self.password = password self.__connection = None try: print( print( f"\n-->>> Connecting to MySQL Database: {user}@{host}:{port} <<<---\n") ) connection = mysql.connector.connect( host=host, port=port, user=user, passwd=password, db=name) self.__connection = conn...

Cannot POST /updatedata

1.I am trying to modify my data in mysql database but getting error I am able to add the data but unable to modify the data. I have created a seperate tab in main page as modify. What changes needs to be done? **var mysql = require('mysql'); var express = require('express'); var bodyParser = require('body-parser'); var connection = mysql.createConnection({ host : 'localhost', user : 'root', password : '', database : 'mr', port: '3308', }); var app = express(); app.use(bodyParser.urlencoded({extended : false})); app.use(bodyParser.json()); app.get('/', function(request,response){ response.sendFile(__dirname + '/home.html'); }); app.get('/update', function(request, response){ response.sendFile(__dirname + '/modify.html'); }); app.put('/updatedata',function(req,res){ connection.query('update hp set Name=?,Address=?,Country=?,Pho...

Java. Formatting array

My problem is this: i have 2d array which is filled with numbers. I have to output it in a way that it shows "*" between neighbours with different values and with " " if values are different. Example: ********* *1 1*3*4* ***** * * *2 2*3*4* ********* I have tried many things like creating another array with [Nx2][Mx2] size or System.out.format but it in the end its never formatte the way I like. Any suggestions how can I solve this? from Recent Questions - Stack Overflow https://ift.tt/380qo70 https://ift.tt/eA8V8J

How to make an icon slideshow with jQuery

Hi I am building a small slideshow of icons and also want to have data inside the icons like its speed and color. I've loaded jQuery from the top of my page. <body> <div class="main-container"> <div class="object-container"> <div class="icon-container"> <i class="fa fa-car" id="active"></i> <i class="fa fa-bicycle" id="not-active"></i> <i class="fa fa-plane" id="not-active"></i> <i class="fa fa-ship" id="not-active"></i> <i class="fa fa-fighter-jet" id="not-active"></i> <i class="fa fa-space-shuttle" id="not-active"></i> </div> <div class="arrow-buttons"> <a href="" class="right-arrow"></a> <a href=...

Error Message in Dsharp with String Prefix

var commandsConfig = new CommandsNextConfiguration { **StringPrefix = new string[] { configJson.Prefix },** //here is the error EnableDms = false, EnableMentionPrefix = true, }; So, I got an error which is saying "Cannot implicitly convert type 'string[]' to 'string' ". Can I ask why my code does not work? I am learning Dsharp by an online course and the man who made the course has no problem with this... Please help me! from Recent Questions - Stack Overflow https://ift.tt/2WZyo26 https://ift.tt/eA8V8J

Why do my TableView cells need reuse identifiers?

Image
To practice my programming and keep track of my progress I'm building an app for myself. I've created a tableview and for each section and independent cells for each requirement. Now Xcode is upset because each prototype cell doesn't have an identifier. I've looked at the Swift docs and gone through Youtube vids on the topic but I still don't understand what reuse identifiers are or what they are used for, let alone how it would help in my case. from Recent Questions - Stack Overflow https://ift.tt/34UQKFE https://ift.tt/38LLkxS

Copy a Map Object in Java

Tried to follow the same way as in < How do I copy an object in Java? >. But it does not work with Map object in the following codes. I want to copy the original map data to currMap. The current outputs are - 0 1 2 3 null null null I want it to be - 0 1 2 3 0 2 3 What are missing here? Thanks import java.util.ArrayDeque; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Queue; class mapCopy{ private Map<Character, Queue<Integer>> map; mapCopy(Map<Character, Queue<Integer>> map){ this.map=map; } mapCopy(mapCopy mapcopy){ this.map=mapcopy.map; } Map<Character, Queue<Integer>> getMap(){ return this.map; } } public class Test { static Map<Character, Queue<Integer>> BuildMap(){ String toMatch="able"; Map<Character, Queue<Integer>> map = new HashMap<>(); ...

I need help, homework

Hello I was working on a new robot and it s ay error await fart() c an someone tell me what is wrong? I try to replase text with js input. jest tekstem stosowanym jako przykładowy wypełniacz w przemyśle poligraficznym. Został po raz pierwszy użyty w XV w. przez nieznanego drukarza do wypełnienia tekstem próbnej książki. Pięć wieków później zaczął być używany przemyśle elektronicznym, let isFarted = false; let input = "hello my name is josh i am from united kingdom"; async function ILoveSmeell() { while (isFarted) { } } async function goStink() { isFarted = true; console.log("fixing"); await sleep(100); // sleep for bit input = input.replace("united kingdom", "AMERICA"); // ? isFarted = false; } async function fart_do() { if (isFarted) { await ILoveSmeell(); console.log("fixed 2") } else { await goStink(); console.log("löl") } } (async () => { ...

SqsAckSink makes the Akka stream hanging forever causing graph restarts

I'm trying to implement a simple workflow with an SQS source and a test with Localstack. And I cannot make it work if I add SqsAckSink , neither it works with SqsAckFlow . But if I remove SqsAckSink and just use Sink.seq() , then the test passes. Having the SqsAckSink or SqsAckFlow makes the test hanging forever. I have also enabled debug in the test and see that the same error repeats again and again making the graph restarting, but it doesn't make much sense to me. I'm posting the error messages below after the code snippets. The code is: public class DefaultWorkflow implements Workflow { private Function<Throwable, Supervision.Directive> errorStrategy; private final ActorSystem actorSystem; private FlowMonitor<ProvisioningResult> workflowMonitor; private final String queueUrl; private final SqsAsyncClient asyncClient; @Inject public DefaultWorkflow(ActorSystem actorSystem, String queueUrl) { this.errorStrategy = exc -> (Superv...

Passing in the key and returning the object javascript

With a JSON array structured like this one, "object1": { "key1": "value1" "key2": "value2" } "object2": { "key3": null "key4": null } } Could I pass in the key eg. key3 and get returned the object it is part of eg. object2? I know this would be possible with a for loop, but I have a lot of keys so I am wondering if there is another way. Thanks from Recent Questions - Stack Overflow https://ift.tt/2WYPKMk https://ift.tt/eA8V8J

How do I set a variable inside of an onComplete method?

Image
currently I am trying to pass a value to String variables inside of an onComplete() method. But, when I tried to use it outside of the method, it passes nothing. Here's my onComplete code: docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if(task.isSuccessful()){ DocumentSnapshot document = task.getResult(); if(document.exists()){ Log.d(TAG,"User full name: " + document.getString("FullName")); Log.d(TAG, "User email: " + document.getString("Email")); donorFullName = document.getString("FullName"); donorEmail = document.getString("Email"); Log.d(TAG, "donorFullName set: " + donorFullName); Log.d(TAG, "donorEmail se...

TimeoutError returned while connecting via ssh while using splitcopy

I usually use splitcopy to copy contents that are usually large from my server to the router. They work fine on all setups excepts for one setup where I get the following error: /usr/local/lib/python3.5/dist-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release ofcryptography. Please upgrade your Python. from cryptography.hazmat.backends import default_backend skipping publickey ssh auth as root != andy root@andy's password: ssh authentication succeeded TimeoutError returned while connecting via ssh: What can be the possible reasons that I am running into this issue? from Recent Questions - Stack Overflow https://ift.tt/3aUUZVr https://ift.tt/eA8V8J

JS convert Array of Objects into JSON GroupBy Format

I'm trying to find a way to convert the following array of objects into JSON Original Format const arr = [ { userid: '1000080542', photoname: '2c8a4709-ed7e-00a50-0da4ead1de55118-f3-1473281639’, datetime: ‘2020-01-24T20:46:05+11:00’ }, { userid: '1000081532', photoname: '73321038-c8bf-57c6e-5d803cd0a920e9a-95-1487447082', datetime: ‘2020-01-24T20:46:05+11:00’ }, { userid: '1000081532', photoname: '5c00bc65-db1b-7a394-dd65b462b9e75e2-c5-1487447019', datetime: ‘2020-01-24T20:46:05+11:00’ }, { userid: '1000081532', photoname: '986ee1e2-2f8e-bf070-0d70d2e67537835-e2-1473821119', datetime: ‘2020-01-24T20:46:05+11:00’ }, { userid: '1000081532', photoname: '09f7cde6-68c8-f462d-c01f7713a2c747f-eb-1474294185', datetime: ‘2020-01-24T20:46:05+11:00’ } ] Converted Format { 1000080542: { '2c8a4709-ed7e-00a...

Studying if/else vs if/if statement

I was trying to write a code where all the 0s will be moved to the right of the array. I just used a left and a right pointer. public class Solution { public int[] moveZero(int[] array) { // Write your solution here if (array.length==0) { return array; } int left=0; int right=array.length-1; while (left<=right) { if (array[left]!=0) { left+=1; } if (array[right]==0) { right-=1; } else { int temp = array[left]; array[left] = array[right]; array[right] = temp; left+=1; right-=1; } } return array; } } I know here I should use the if/else if instead of if/if, that's why I have the index out of the bound error. But I don't understand why? If I have the if/if statement, what's the difference does that make rather than using if/else if in this question?...

How do I resize my inputs depending on the screen size (chosen by the user in the popup)

const sheets = document.getElementById('sheets'); const siteDocument = document.getElementsByTagName('body')[0]; const amountOfColumns = 2; const amountOfRows = undefined; for (var i = 0; i < amountOfColumns; i++) { const myNewElement = document.createElement('input'); myNewElement.width = siteDocument sheets.appendChild(myNewElement) } for (var x = 0; x < amountOfRows; x++) { } #titletext { font-size: 5vh; } <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>repl.it</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="popup"></div> <h1 id="titletext">Excel Sheets</h1> <div id="buttons"></div> <div id="sheets"...

TypeError: Object(...) is not a function after refactoring from class to function component

I just refactored a legacy React 16.6.3 app from having a class-based SearchBar component to a function component like so: import React, { useState } from 'react'; const SearchBar = ({ onFormSubmit }) => { const [term, setTerm] = useState(''); const onSubmit = (event) => { event.preventDefault(); onFormSubmit(term); }; return ( <div className="search-bar ui segment"> <form onSubmit={onSubmit} className="ui form"> <div className="field"> <label>Video Search</label> <input type="text" value={term} onChange={(event) => setTerm(event.target.value)} /> </div> </form> </div> ); }; export default SearchBar; I do not see anything wrong with my code, it should work as expected even if I have yet to refactor the App component from class to function com...

having trouble with functions

I need a hand on this, not being able to solve it has been bothering me a lot. Here is my code: def build_profile(first, last, **user_info): """Build a user's profile dictionary.""" profile = {'first': first, 'last': last} for key, value in user_info.items(): profile[key] = value return profile user_0 = build_profile('albert', 'einstein', location='princeton') user_1 = build_profile('marie', 'curie', location='paris', field='chemistry') print(user_0) print(user_1) print('\n') def new_member(name, age, **extra_info): """Build a new member's profile""" portfolio = {'name': name, 'age': age} for key, value in extra_info.items(): portfolio[key] = value return portfolio member_1 = new_member('vinny geladro', '24', location='alabama') member_2 =...

The SMTP server requires a secure connection or the client was not authenticated. Help me please

I want to send an email from my application to verify the email that I used to register but getting this error. The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; I tried going into my Gmail settings and allow less secure apps On but it still doesn't work. UserController.cs [NonAction] public void SendVerificaitonLinkEmail(string email, string activationCode, string emailFor = "VerifyAccount") { var verifyUrl = "/User/" + emailFor + "/" + activationCode; var link = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, verifyUrl); var fromEmail = new MailAddress("dotnetawesome@gmail.com", "Dotnet Awesome"); var toEmail = new MailAddress(email); var fromEmailPassword = "**********"; // Replace with actual password string subject = ""; string body = ""; if...

JPA JPQL nested select statement

I have a very simple join table relating two tables, to simplify the problem we can say table1 is A and table 2 is B, with a join table AB. A AB B A_id AB_id B_id A_details A_id_fk B_details B_id_fk where A_id_fk and B_id_fk are foreign keys respectively. Im trying to create a query to retrieve all rows of A that have a relation to B. So my function receives B_id as an argument, and I want to search AB to get all rows where B_id_fk == b_id, and then use search A for all rows where A_id == the A_id_fk returned from previous search. I tested and it can be done in plain SQL using nested select like this: SELECT * FROM A WHERE A_ID = (SELECT A_id_fk from AB where B_id_fk = B_id); So i read the documentation for JPQL: http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/jpa_langref.html#jpa_langref_exists and tried this @Transactional public List<A> getA(int B_id){ TypedQuery<A> query = em.createQuery...

Is there a bug in the DateTime.Parse method when UTC is used with time zone offsets?

The Microsoft documentation states that, among other string representations of DateTime structures, DateTime.Parse(string) conforms to ISO 8601 and accepts Coordinated Universal Time (UTC) formats for time zone offsets. When I run the following unit test cases, DateTime.Parse(string) and DateTime.TryParse(string, out DateTime) accepts an additional character at the end of the source string. This seems to be a bug. When more than one additional character is appended, the method correctly fails to parse the string. [Theory] [InlineData("2020-5-7T09:37:00.0000000-07:00")] [InlineData("2020-5-7T09:37:00.0000000-07:00x")] [InlineData("2020-5-7T09:37:00.0000000-07:00xx")] [InlineData("2020-5-7T09:37:00.0000000Z")] [InlineData("2020-5-7T09:37:00.0000000Zx")] public void TestParse(string source) { DateTime dt = DateTime.Parse(source); Assert.True(dt != null); bool b = DateTime.TryParse(source, out dt); Assert.True(b); } This ...

How to validate user input while running a while with those values

I'm writing a password generator that asks the user to enter a password LENGHT and generates it that long (it works) Problem : I do validate user input (while/try/except), it gets the Value Error right, it gets the minimum length right BUT it does not take the maximum value and generates always the SAME password with the length PLUS the new length. Maybe some examples will help from random import randint lowerCase = "abcdefghijklmnopqrstuvwxyz" upperCase = lowerCase.upper() numbers = "1234567890" special = "!#$%&/()=?¡@[]_<>,." password_creation = lowerCase + upperCase + numbers + special password = "" lenght = 0 while True try: password_lenght = int(input("How many characters do you wish the password? Minimum 8 maximum 1024: ")) if password_lenght < 8 or password_lenght > 1024: print("Minimun 8 characters - maximum 1024, try again") except ValueError: print...

Listen to back button in mobile browser and e.preventDefault() then use our separate function in react function

I am working on a react web app add want to preventDefault back button to my function in react function for exact code use check - https://github.com/rishabhjainfinal/react-expence-calculator/blob/main/src/App.js yes I can use react routing but I wanna test this way first function App() { function onBack(){ if (CP === "Month"){ UpdateCP("Year") } else if (CP === "Day"){ UpdateCP("Month") } } //some event listener function to prevent to go back switch (CP){ case 'Day': return (<Day date={AD} CP={CP} UpdateCP={UpdateCP}/>) case 'Year': return (<Year monthNames={monthNames} CP={CP} UpdateCP={UpdateCP} UpdateAM={UpdateAM} Save_in_excel={Save_in_excel}/>) default : return (<Month month={AM} CP={CP} UpdateCP={UpdateCP} UpdateAD={UpdateAD} AM={AM} AY={AY} monthNames...

PHP remove empty tring from array

Image
I'm trying to remove all empty strings "" from the kat -array. I tried to do it by using array_filter function like this: $array = array_filter($array, "strlen"); The problem is that kat[4] is now an object instead of an array. Any idea how I can remove empty stings from an array without transforming them into an object? Before After from Recent Questions - Stack Overflow https://ift.tt/3nZ1gDw https://ift.tt/38RNdJk

SQS long polling and retention policy

I have two questions regarding SQS which I couldn't find answers to. Seems like polling in the AWS console is always Long Polling, although the queue is set to short polling. It always polls for 30 seconds even when the Receive message wait time is set to 0. Is this possible or I didn't get it? When I have a DLQ connected to the standard queue and the retention period of the queue is over, will the message get to the DLQ or just disappear? When trying it, seems like the message disappears but I want to be sure that's the expected behavior. from Recent Questions - Stack Overflow https://ift.tt/34Xbz3s https://ift.tt/eA8V8J

Move all versions of a given file in a S3 bucket from one folder to another folder

I have set up an S3 bucket with versioning enabled. One external process is writing the json files, ( each json file corresponds to a single Student entity ) to the S3 bucket. I have decided the S3 bucket folder structure as follows: s3://student-data/new/ <-- THIS WILL CONTAIN ALL THE UNPROCESSED JSON FILES s3://student-data/processed/ <-- THIS WILL CONTAIN ALL THE PROCESSED JSON FILES. Now, I have a Cron that runs periodically, once at every 6 hours. New JSON files are written to new folder by external process. I would like the Cron to process all the JSON files with associated versions in new folder and after processing is over, move all the files with all existing versions in new folder to processed folder. Here I am able to fetch the current version for a json file written to new folder and move this to processed folder post processing. But I am not getting an idea regarding how can I move a file with all its versions from new to processed so that in the fu...

how to make responsive table with bootstrap

Image
need help to make table responsive. On this size everything is ok: but when screen size is reduced im getting smth like this: table is displayed on col-md-7: <div class="row"> <div class="col-md-7"> <div class="ritekhela-fancy-title-two"> <h2>Turnyrinė lentelė</h2> </div> <div class="rs-point-table sec-spacer"> <div class="tab-content"> <table> <tr> <td>Vieta</td> <td class="team-name">Komanda</td> <td>Sužaista</td> <td>Perg.</td> ...

Cannot get Query elements on razor page

I have two query-selection on my page one for customers and one for suppliers. Why do I not see any elements? == c# code == c# code of page Pic of VS19 with debugger in debugger elements are shown see pic number 2 == in Razor Page== Pic of HTML Code Unfortunately I cannot see any items. Any Ideas? Layout of page Attached you get my code sorry for only posting pictures My c# Code using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Mvc.Rendering; using WorkCollaboration.Data; using WorkCollaboration.Models; namespace WorkCollaboration.Pages.Contacts { public class CreateModel : PageModel { private readonly WorkCollaboration.Data.WorkCollaborationContext _context; public CreateModel(WorkCollaboration.Data.WorkCollaborationContext context) { _context =...

How do I replace a value in one cell based on value in another cell?

function CopyinData_AM_A() { /* Edit the vars below this line for your needs */ var sourceSheet = "Students AM" ; // Enter the name of the sheet with the source data var sourceRange = "B7:N77" ; // Enter the range of the cells with the source data var targetSheet = "Students AM A" ; // Enter the name of the target sheet var targetRange = "B7:N77" ; // Enter the range of cells you wish to copy data to. Note this must be same size as source range. var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName(sourceSheet); var values = sheet.getRange(sourceRange).getValues(); ss.getSheetByName(targetSheet).getRange(targetRange).setValues(values); } How would I add this into the above script? The action needs to occur after the data is copied into the sheet. I am only a VB coder. 'Students AM A' is a formula free sheet. For each cell in ‘Students AM A'!N7:N77 then If Ncell= ‘Menu!D14' then Hcell...

Microsoft sql sever + c# - save not working

private void button4_Click(object sender, EventArgs e) { try { // first table SqlConnection cn = new SqlConnection(@"Data Source = DESKTOP - MO4HHVS; Initial Catalog = MechanicProject; Integrated Security = True"); cn.Open(); string dateoftheday = dateTimePicker1.Value.Year + "-" + dateTimePicker1.Value.Month + "-" + dateTimePicker1.Value.Day; SqlCommand cmd = new SqlCommand("insert into Clients (Imie,Nazwisko,Adres,Nr_rejstracji,Nr_telefonu,Marka_samochodu,Data,Rok,Moc_silnika,nr_VIN,Przebieg,Rzeczy_uszkodzone,Rzeczy_naprawione,Komentarz,Podsumowanie_ceny) values('" + textBox1.Text+"','"+ textBox63.Text + "','" + textBox3.Text + "','" + textBox2.Text + "','"+textBox5.Text+"','"+textBox4.Text+"','"+dateoftheday +"','"+textBox7.Text+"...

Find the same part in two different view images

I have two images from two cameras like below. camera 1 camera 2 How can I find the overlapping view of two cameras and mark the overlapping views in two images? Thank you for any suggestions. from Recent Questions - Stack Overflow https://ift.tt/37YAdCM https://ift.tt/eA8V8J

Slick Slider covers up elements below

My slick slider images are covering up the elements that are supposed to sit below, and I'm not sure why. I need #features to sit below #slideshow , but right now it's covered up. I'm not sure what's making the slider overlap the elements below it on the page. I don't want to just "push" the #features div down with CSS, like by using bottom: -50px or whatever because I'm aiming for responsive design. I need the slideshow slider and slides to take up the same amount of height that the images do. Hopefully this makes sense! Here's my code: HTML: <div id="slideshow"> <div class="slide"><img src="images/Need Space.jpg"></div> <div class="slide"><img src="images/Open Lot.jpg"></div> <div class="slide"><img src="images/IMG_0713a.jpg"></div> <div class="slide"><img src="images/IMG_0...

How do you watch a callable object's arguments and return values?

I have a Python object and I want to know what args, kwargs, and return values it made. The solution should be something like this. class Fizz(object): def do_something(self, item, blah=8): return "done" buzz = Fizz() with watch(buzz.do_something) as container: buzz.do_something("asdf") buzz.do_something("another", blah=10) container # [(("asdf", ), dict(), "done"), (("another", ), {"blah": 10}, "done")] So the key points are Able to watch args, kwargs, and return values Is temporary (I can decide when and how to watch and when to un-watch) Ideally, this should work with instance objects. But at minimum, it needs to be able to at least work with class, method, and function definitions (like how mock.patch does it). Similar Things That Already Exist mock.patch allows you to watch arguments but, as far as I know, it replaces the class / function / method. The original call...

How can I combinate two MySQL queries and sort them?

I have 3 tables: Parts, Store and Delivery store.id store.mainpnid = parts.id store.mainpn store.subid store.bnsn store.class store.expire store.status store.station delivery.id delivery.mainpnid delivery.mainpn delivery.subid delivery.bnsn delivery.class delivery.expire delivery.status delivery.to delivery.statindlvr parts.metctrl parts.description parts.id parts.class I have two queries until now: SELECT store.id, store.mainpnid, store.mainpn, store.subid, store.bnsn, store.class, store.expire, store.status, store.station, parts.metctrl, parts.description, parts.id, parts.class FROM store INNER JOIN parts ON store.mainpnid=parts.id WHERE (store.status='SA' OR store.status='US' OR store.status='QRT') AND parts.metctrl='yes' AND (parts.class = 'TR' OR parts.class = 'T') ORDER BY store.mainpn ASC, store.bnsn ASC and SELECT delivery.id, delivery.mainpnid, delivery.mainpn, delivery.subid, delivery.deliveryn, delivery.bnsn, delivery.c...

ProgressBar with loaded percentage when Glide image is loading

I'm trying to show a progress bar with the currently loaded percentage of the image, like 1% - 50% - ... I looked it up a lot, every answer is just to show a simple ProgressBar with setVisibility without showing loaded percentage. I tried AsyncTask, but the progress doesn't change. Thanks from Recent Questions - Stack Overflow https://ift.tt/34U8b9z https://ift.tt/eA8V8J

Why cant i delete a local Git branch in IntelliJ?

Image
So Im new to Git, and to test i have created the local Branch "test". But for some reason, I can not delete it, just the master branch. I just dont have the option to do that, but there is not a single person on the internet that asked the same question, from Recent Questions - Stack Overflow https://ift.tt/3pwI5Bc https://ift.tt/3o2K1Ru

In Python, How can i compare two similar 'QRcode'?

I recently got two QRcode, and these seem similar. But i'm novice in python. How can i compare in number(like 'indentical 100%', 'similarity 97%') Thank you. from Recent Questions - Stack Overflow https://ift.tt/2WXh8KC https://ift.tt/eA8V8J

Simple question about slicing and for loops without indices

If I was making this loop: for i in range(len(array)): for j in range(len(array)+1): # some code using array[i] and array[j] Would there be a way to do the same thing in this format? for element in array: for next_element in array: # some code using element and next_element Or would I just be better off using the i, j format? from Recent Questions - Stack Overflow https://ift.tt/34Uz0dB https://ift.tt/eA8V8J

Why is data undefined from json?

I want to get the names of the cocktails through api. I brought the data. But I can't read the properties inside. This is JSON { "drinks": [ { "idDrink": "12784", "strDrink": "Thai Iced Coffee", "strCategory": "Coffee / Tea", "strIBA": null, "strAlcoholic": "Non alcoholic", "strGlass": "Highball glass", "strDrinkThumb": "https://www.thecocktaildb.com/images/media/drink/rqpypv1441245650.jpg", "strIngredient1": "Coffee", "strIngredient2": "Sugar", "strIngredient3": "Cream", "strIngredient4": "Cardamom", "strMeasure1": "black", "strMeasure3": " pods\n", "strImageAttribution": null, "strCreativeCommonsConfirmed": ...

Trying to figure out how to combine two queries for a subreport

I'm trying to update an Access database to be easier to maintain and update. To anonymize the data, I altered the data to use food ordering as a metaphor/analog. My experience with Access is not exactly basic, but very much learning to solve issues as I've come across them. So I don't know how close, or how far off, I am currently. A Google Sheet I'll be referencing: https://docs.google.com/spreadsheets/d/1UYt1SKbBrKqE6IWCTyUHVNV89jGfy4KoHWTzCXtO0CM/edit?usp=sharing NOTE: In response to GMP's comment I tried to convert the information into this post directly. Goal How it started was each "order" was a single row in a table. There are 20 some near identical reports with minor differences that hard coded values based on the "product". The primary goal is to remove the hard coded per report data. In the end combining the "generic" and "order specific" certificate of analysis like data into a report. I've been trying to ma...

2D array size problem loading from csv file

int main() { auto base_dir = fs::current_path(); auto dataset_1 = data_names_1; auto dataset_name = base_dir / "NAimg_20101026_145727.csv"; //double data[10][3]; std::ifstream file(dataset_name); matrix<DataType> data_length; file >> data_length; auto pre_num_row = data_length.nc(); static const int num_row = 73;//data_length.nr(); static const int num_column = 74496; //data_length.nc(); std::cout << num_row << "\n"; std::cout << num_column << "\n"; double data[73][74496]; for (int row = 0; row < 73; ++row) { std::string line; std::getline(file, line); if (!file.good()) break; std::stringstream iss(line); for (int col = 0; col < 74496; ++col) { std::string val; std::getline(iss, val, ','); if (!iss.good()) break; ...