instruction
stringlengths
0
30k
I'm trying to develop a school schedule generator in JavaScript for a high school with various subjects, teachers, and classes. The goal is to create a balanced and efficient schedule that minimizes conflicts while considering teacher preferences and availability. **Constraints:** If I wanted to distribute the lectures to one class and the teacher did not teach more than one subject in more than one class, it would be easy, but I find it difficult to distribute the teachers’ lectures to all classes in the most fair way. So, I'm struggling with the algorithm for subject distribution. Ideally, I'd like an efficient algorithm that can handle these constraints: 1. Balanced subject distribution across classes throughout the week. 2. Respecting teacher preferences unavailable days 3. Distributing teachers’ lectures to classes in an organized and fair manner for all. 4. distributing lectures equally during workdays, with one day the teacher completing his lectures early. The Constraints seem complicated but I wanted to make it as clear as possible **Additional Information:** I'm familiar with basic object-oriented programming concepts in JavaScript and have looked at some online resources on scheduling algorithms. However, they seem too complex for my needs. Are there any efficient algorithms suitable for this scenario, or can you suggest an approach for distributing subjects effectively while considering the mentioned constraints? **Example Data:** ``` const teachers = [ { name: "Math-Teacher", id: "T1", workDays: 6, unavailableDays:[], subjects: ["M1", "M2", "M3"], }, { name: "Quilting-Teacher", id: "T2", workDays: 2, unavailableDays:['Mon'], subjects: ["Q1", "Q2", "Q3"], }, { name: "Italian-Teacher", id: "T3", workDays: 6, unavailableDays:[], subjects: ["I1", "I2", "I3"], }, { name: "Biology-Teacher", id: "T4", workDays: 4, unavailableDays:[], subjects: ["B1", "B2", "B3"], }, { name: "history-Teacher", id: "T5", workDays: 2, unavailableDays:['Sat', 'Tue'], subjects: ["H1"], }, { name: "Phasics-Teacher", id: "T6", workDays: 5, unavailableDays:[], subjects: ["P1", "P2", "P3"], }, { name: "Italian-Teacher", id: "T7", workDays: 3, unavailableDays:[], subjects: ["I1", "I2", "I3"], }, { name: "Chemistry-Teacher", id: "T8", workDays: 3, unavailableDays:[], subjects: ["C1", "C2", "C3"], }, { name: "English-Teacher", id: "T9", workDays: 4, unavailableDays:[], subjects: ["M1"], }, { name: "Arabic-Teacher", id: "T10", workDays: 6, unavailableDays:[], subjects: ["A1", "A2"], }, ]; const subjects = [ //1-sec subjects { name: "Math", class: "1-sec", id: "M1", weeklyLectures: 7, }, { name: "Biology", class: "1-sec", id: "B1", weeklyLectures: 4, }, { name: " Quilting", class: "1-sec", id: "Q1", weeklyLectures: 3, }, { name: "Isramic Culture", class: "1-sec", id: "I1", weeklyLectures: 3, }, { name: "Phasics", class: "1-sec", id: "P1", weeklyLectures: 5, }, { name: "History", class: "1-sec", id: "H1", weeklyLectures: 3, }, { name: "English", class: "1-sec", id: "E1", weeklyLectures: 5, }, { name: "Arabic", class: "1-sec", id: "A1", weeklyLectures: 6, }, { name: "Chemistry", class: "1-sec", id: "C1", weeklyLectures: 3, }, //2-sec subjects { name: "Math", class: "2-sec", id: "M2", weeklyLectures: 7, }, { name: "Biology", class: "2-sec", id: "B2", weeklyLectures: 4, }, { name: " Quilting", class: "2-sec", id: "Q2", weeklyLectures: 3, }, { name: "Isramic Culture", class: "2-sec", id: "I2", weeklyLectures: 3, }, { name: "Phasics", class: "2-sec", id: "P2", weeklyLectures: 5, }, { name: "English", class: "2-sec", id: "E2", weeklyLectures: 5, }, { name: "Arabic", class: "2-sec", id: "A2", weeklyLectures: 6, }, { name: "Chemistry", class: "2-sec", id: "C2", weeklyLectures: 3, }, //3-sec subjects { name: "Math", class: "3-sec", id: "M3", weeklyLectures: 7, }, { name: "Biology", class: "3-sec", id: "B3", weeklyLectures: 4, }, { name: " Quilting", class: "3-sec", id: "Q3", weeklyLectures: 3, }, { name: "Isramic Culture", class: "3-sec", id: "I3", weeklyLectures: 3, }, { name: "Phasics", class: "3-sec", id: "P3", weeklyLectures: 5, }, { name: "English", class: "3-sec", id: "E3", weeklyLectures: 5, }, { name: "Arabic", class: "3-sec", id: "A3", weeklyLectures: 6, }, { name: "Chemistry", class: "3-sec", id: "C3", weeklyLectures: 3, }, ]; const classes = [ { name: "1-secondary", id: "1-sec", DailyLectures: 7, subjects: ["M1", "Q1", "I1", "A1", "E1", "H1", "C1", "B1", "P1"], }, { name: "2-secondary", id: "2-sec", DailyLectures: 7, subjects: ["M2", "Q2", "I2", "A2", "E2", "C2", "B2", "P2"], }, { name: "3-secondary", id: "3-sec", DailyLectures: 7, subjects: ["M3", "Q3", "I3", "A3", "E3", "C3", "B3", "P3"], }, ]; const daysOfWeek = ["Sat", "Sun", "Mon", "Tue", "Wed", "Thr"]; ``` **Expected Output**: I expect the output to be a weekly schedule for each class, with lectures of teachers evenly distributed across the working days. For example(like this but in a efficient way): ``` 1-sec: { Sat: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: ' Quilting', class: '1-sec', id: 'Q1', weeklyLectures: 3 }, { name: ' Quilting', class: '1-sec', id: 'Q1', weeklyLectures: 3 }, { name: 'Isramic Culture', class: '1-sec', id: 'I1', weeklyLectures: 3 }, { name: 'Biology', class: '1-sec', id: 'B1', weeklyLectures: 4 }, { name: 'History', class: '1-sec', id: 'H1', weeklyLectures: 3 }, { name: 'History', class: '1-sec', id: 'H1', weeklyLectures: 3 } ], Sun: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: ' Quilting', class: '1-sec', id: 'Q1', weeklyLectures: 3 }, { name: 'Isramic Culture', class: '1-sec', id: 'I1', weeklyLectures: 3 }, { name: 'Biology', class: '1-sec', id: 'B1', weeklyLectures: 4 }, { name: 'History', class: '1-sec', id: 'H1', weeklyLectures: 3 }, { name: 'Phasics', class: '1-sec', id: 'P1', weeklyLectures: 5 }, { name: 'Chemistry', class: '1-sec', id: 'C1', weeklyLectures: 3 } ], Mon: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Isramic Culture', class: '1-sec', id: 'I1', weeklyLectures: 3 }, { name: 'Biology', class: '1-sec', id: 'B1', weeklyLectures: 4 }, { name: 'Phasics', class: '1-sec', id: 'P1', weeklyLectures: 5 }, { name: 'Chemistry', class: '1-sec', id: 'C1', weeklyLectures: 3 }, { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 } ], Tue: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Biology', class: '1-sec', id: 'B1', weeklyLectures: 4 }, { name: 'Phasics', class: '1-sec', id: 'P1', weeklyLectures: 5 }, { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Arabic', class: '1-sec', id: 'A1', weeklyLectures: 6 } ], Wed: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Phasics', class: '1-sec', id: 'P1', weeklyLectures: 5 }, { name: 'Arabic', class: '1-sec', id: 'A1', weeklyLectures: 6 } ], Thr: [ { name: 'Math', class: '1-sec', id: 'M1', weeklyLectures: 7 }, { name: 'Arabic', class: '1-sec', id: 'A1', weeklyLectures: 6 } ] } ```
I'm trying to write a gsheet appscript that replaces an image in google slide. Ultimately, i want to iterate through the spreadsheet and for each row create a new slide with the image of the row in the spreadsheet. Currently, I can't get it to work once. My code is below: ```javascript function updatePresentation() { // Replace with your actual presentation ID const PRESENTATION_ID = "My_ID" // Get the spreadsheet object const sheet = SpreadsheetApp.getActiveSheet(); // Get data range (excluding header row) const dataRange = sheet.getDataRange().getValues().slice(1); // Access the Slides service const slidesApp = SlidesApp.openById(PRESENTATION_ID); // Get the template slide const templateSlide = slidesApp.getSlides()[0]; const pageElements = templateSlide.getPageElements(); Logger.log(pageElements) imageName = "test01.png" const imageBlob = DriveApp.getFilesByName(imageName).next().getBlob(); const left = 0; // The x-coordinate of the top left corner of the image const top = 0; // The y-coordinate of the top left corner of the image const width = 200; // Width of the image const height = 100; // Height of the image // Add the image to the slide Logger.log(templateSlide.insertImage(imageBlob, left, top, width, height)); } ``` The current error message is " Exception: The image you are trying to use is invalid or corrupt." I've tried this a number of different ways with no success. Any help would be appreciated.
AppScript to replace image in google slides
|javascript|google-sheets|google-apps-script|
I was able to figure out what was going on here. Essentially traffic was being routed to a private subnet that was mapping traffic to an NAT gateway instead of an Internet gateway. Because there were two instances running, only sometimes would the requests be sent to an instance attached to the troubled subnet. To solve the problem, I updated the default subnet to point to an internet gateway on the Route table. (inbound traffic 0.0.0.0 -> IGN). I did this because I was not able to easily change how EBS picks the VPC and default subnets when launching from the command line. There were a lot of things that led to this problem, which made it hard to troubleshoot. To be clear: 1. If you create an EBS environment from the command line, it will select default VPC and thus the default subnets for that VPC. (Yes, there are actually defaults that can be set.) 2. Routetables can also be set as defaults, which can ruin your life if you are not careful with how things are being created. 3. My original EBS instance was set up with a classic load balancer. I later tried to migrate it to Application. That migration process had no impact to the Elastic beanstalk environment. EBS continued to use the old load balancer and configuration settings on it.
|excel|vba|charts|
|excel|vba|ms-word|
I know `serialVersionUID` is used serialization and deserialization. I read https://stackoverflow.com/questions/285793/what-is-a-serialversionuid-and-why-should-i-use-it So if we are using distributed cache like hazelcast or coherence or redis we need serialVersionUID. Example entity or VO classes needs that. My question is little bit further. Do we need to define that for app specific **exception** in spring boot application no EJB no weblogic no websphere, regular tomcat no distributed cache or session sharing exist, just an instance of spring boot application rest services no UI. example ```Java public class MyBusinessException extends Exception { private static final long serialVersionUID = 7718828512143293558L; public MyBusinessException() { super(); } } ``` I have never seen an app specific excpetion deserialized before in prod or anywhere. So do we really need `serialVersionUID` here ?
I use a very similar setup: Windows 11, VS Code, Conda environments. This does not appear as an issue for me. However, when I open the terminal, a pop up message appears in the bottom right corner: [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/lMqcb.png The "Learn more" link points to a wiki page on the VSCode-Python github page: https://github.com/microsoft/vscode-python/wiki/Activate-Environments-in-Terminal-Using-Environment-Variables
|excel|vba|ms-word|
I create two services in an ASP.NET Core Web API. One service is for Identity and generates a JWT token. The second service gets the JWT token from Identity. These two services are connected using http. This is the code from the second service which gets the JWT token from the Identity service ``` builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.Authority = builder.Configuration["IdentityServiceUrl"]; options.RequireHttpsMetadata = false; options.SaveToken = true; options.TokenValidationParameters.ValidateAudience = false; options.TokenValidationParameters.NameClaimType = "username"; options.Configuration = new OpenIdConnectConfiguration(); }); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseAuthentication(); app.UseAuthorization(); ``` ``` [Authorize] [HttpPut("create-age-category")] public async Task<ActionResult> CreateAgeCategory(AgeCategoryDto ageCategory) { try { await _ageCategoryService.CreateAgeCategory(ageCategory); return Ok("success"); } catch (Exception ex) { return BadRequest(ex); } } ``` When I try to access this private root, I get a http 401 unauthorized error, even though I sent the token in the authorize tab in Postman. I'm new to micro services I don't know where to start to fix this issue. First I change both service's url to http and I still receive the http 401.
HTTP 401 unauthorized ASP.NET Core Web API microservices
Why cant I use a space when creating this table?
|sqlite|
null
I've isolated this as much as I can ... And indeed the copyright info is rotated correctly, reading up and down along the left edge. *However*, when I hover over the parent `<div>` instead of rotating 90º degrees, so that ireading left-to-right along the bottom edge, it rotates 180º so that it is facing the opposite way! The only way to get the text to transition from reading up and down along the left edge, to reading right to left along the bottom is to rotate it 360º, which makes no sense to me. What on earth have I done? <script async src="//jsfiddle.net/davidgs/qjow7hzb/23/embed/html,css,result/dark/"></script> <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> .parent { height: 100vh; } .copy-txt { color: rgba(255, 255, 255, 0.5); font-size: 10px; text-align: center; } .copy-txt > a { color: rgba(255, 255, 255, 0.5); font-size: 10px; } .copyright { position: absolute; rotate: -90deg; transition: rotate 0.3s ease-in-out; margin-left: 45px; background-color: rgb(10, 28, 46); width: 150px; height: 60px; padding-top: 0px; top: 40%; color: rgba(255, 255, 255, .5); text-align: center; } .parent:hover .copyright { display: block; rotate: 360deg; transition: rotate 0.3s ease-in-out; } <!-- language: lang-html --> <div class="parent"> <div class="copyright"> <p> <span class="copy-txt"> &copy;&nbsp;<a href="https://davidgs.com/">David G. Simmons 2023 </a> </span> <br /> <span class="copy-txt">All rights reserved</span> </p> </div> </div> <!-- end snippet -->
CSS Rotation isn't rotating the way I think it should
|css|
For SpringBoot 2.x set spring.servlet.multipart.enabled=false.
Your original code: ```py ((x == a and y == b) or (x == b and y == a)) ``` is already the optimal solution for most cases. It's readable and easy to understand, and doesn't involve allocating tuples or sets, or performing sorting. These approaches are arguably less clear since they introduce an operation layer on top of the variables, and are certainly less performant since they allocate and garbage collect heap memory. Now, it's important not to prematurely optimize performance, but that doesn't mean fancier solutions with more abstractions are necessarily better, either. In this case, I would keep it simple and boring. If you plan to introduce another variable, then the set solution may begin to make sense, although you're likely going to want to keep these variables in some sort of long-term data structure that makes sense for your use case. In general, it's an antipattern to pack loose variables into data structures just for a single condition test.
I want the pass the dynamic values in `params` from input.txt file? **input.txt file:-**<br/> term=ditech process solutions,country=IN,action=get_search_companies **For this code:-** import requests from bs4 import BeautifulSoup def read_params(file_path): params = {} with open(file_path, 'r') as file: for line in file: key, value = line.strip().split('=') params[key] = value return params api_url = "https://lei-registrations.in/wp/wp-admin/admin-ajax.php" input_file_path = "input.txt" params = read_params(input_file_path) # manual using params # params = { # "term": "ditech process solutions", # <-- search term # "country": "IN", # "action": "get_search_companies", # } headers = { "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0" } data = requests.get(api_url, params=params, headers=headers).json() if data["success"]: soup = BeautifulSoup(data["data"], "html.parser") for r in soup.select(".searchResults_title"): name = r.select_one(".searchResults_name").text number = r.select_one(".searchResults_number").text print(f"{name:<50} {number}")
How to route traffic between overlapping subnets on GCP
|google-cloud-platform|routes|google-compute-engine|vpc|
Create dtype string (not object) column from single string value without having to cast it
<!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> function hideLoadingAnimation() { console.log("Yükleme animasyonu gizleniyor, ana içerik gösteriliyor"); var loadingAnimation = document.getElementById("loading-animation"); var mainContent = document.getElementById("main-content"); loadingAnimation.style.display = "none"; mainContent.style.display = "block"; } window.onload = function() { console.log("Sayfa tamamen yüklendi"); hideLoadingAnimation(); }; <!-- language: lang-css --> #main-content { display: none; } * { box-sizing: border-box; } body { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-flow: column wrap; background: radial-gradient(circle, rgba(7, 50, 22, 255) 0%, rgba(0, 0, 0, 255) 100%); animation: shine 4s linear infinite; color: white; font-family: "Lato"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; } ul { margin: 0; padding: 0; list-style-type: none; max-width: 800px; width: 100%; margin: 0 auto; padding: 15px; text-align: center; overflow-x: hidden; } .card { float: left; position: relative; width: calc(33.33% - 30px + 9.999px); height: 340px; margin: 0 30px 30px 0; perspective: 1000; } .card:first-child .card__front { background: #5271C2; } .card__front img { width: 100%; height: 100%; object-fit: cover; } .card:first-child .card__num { text-shadow: 1px 1px rgba(52, 78, 147, 0.8) } .card:nth-child(2) .card__front { background: #35a541; } .card:nth-child(2) .card__num { text-shadow: 1px 1px rgba(34, 107, 42, 0.8); } .card:nth-child(3) { margin-right: 0; } .card:nth-child(3) .card__front { background: #bdb235; } .card:nth-child(3) .card__num { text-shadow: 1px 1px rgba(129, 122, 36, 0.8); } .card:nth-child(4) .card__front { background: #db6623; } .card:nth-child(4) .card__num { text-shadow: 1px 1px rgba(153, 71, 24, 0.8); } .card:nth-child(5) .card__front { background: #3e5eb3; } .card:nth-child(5) .card__num { text-shadow: 1px 1px rgba(42, 64, 122, 0.8); } .card:nth-child(6) .card__front { background: #aa9e5c; } .card:nth-child(6) .card__num { text-shadow: 1px 1px rgba(122, 113, 64, 0.8); } .card:last-child { margin-right: 0; } .card__flipper { cursor: pointer; transform-style: preserve-3d; transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); border: 3.5px solid rgba(255, 215, 0, 0.6); /* Altın sarısı rengi ve parıltılı efekt */ background-image: linear-gradient(45deg, rgba(255, 215, 0, 0.5), transparent, rgba(255, 215, 0, 0.5)); /* Arkaplan gradienti */ } .card__front, .card__back { position: absolute; backface-visibility: hidden; top: 0; left: 0; width: 100%; height: 340px; } .card__front { transform: rotateY(0); z-index: 2; overflow: hidden; } .card__back { transform: rotateY(180deg) scale(1.1); background: linear-gradient(45deg, #483D8B, #301934, #483D8B, #301934); display: flex; flex-flow: column wrap; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); } .card__back span { font-weight: bold; /* Metni kalın yap */ color: white; /* Beyaz renk */ font-size: 16px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .card__name { font-size: 32px; line-height: 0.9; font-weight: 700; } .card__name span { font-size: 14px; } .card__num { font-size: 100px; margin: 0 8px 0 0; font-weight: 700; } @media (max-width: 700px) { .card__num { font-size: 70px; } } @media (max-width: 700px) { .card { width: 100%; height: 290px; margin-right: 0; float: none; } .card .card__front, .card .card__back { height: 290px; overflow: hidden; } } /* Demo */ main { text-align: center; } main h1, main p { margin: 0 0 12px 0; } main h1 { margin-top: 12px; font-weight: 300; } .fa-github { color: white; font-size: 50px; margin-top: 8px; /* Yukarıdaki boşluğu ayarlayın */ } .tm-container { display: flex; justify-content: center; align-items: center; /* Eğer dikey merkezleme de istiyorsanız */ /* Diğer gerekli stil tanımlamaları */ } .tm-letter { display: inline-block; font-size: 30px; margin: 0 5px; margin-top: 10px; opacity: 0; transform: translateY(0); animation: letter-animation 6s ease-in-out infinite; } @keyframes letter-animation { 0%, 100% { opacity: 1; transform: translateY(0); } 10%, 40%, 60%, 90% { opacity: 1; transform: translateY(-10px); } 20%, 80% { opacity: 1; transform: translateY(0); } } #m-letter { animation-delay: 1.5s; } a { position: relative; display: inline-block; padding: 0px; } a::before { content: ''; position: absolute; top: 50%; /* Orta konumu */ left: 50%; /* Orta konumu */ transform: translate(-50%, -50%); /* Merkezden düzgün bir şekilde ayarlamak için */ width: 50px; height: 45px; border-radius: 50%; /* Eğer bir daire şeklinde efekt isteniyorsa */ box-shadow: 0 0 8px 4px rgba(110, 110, 110, 0.8); /* Buradaki piksel değerlerini gölgenin yayılımını kontrol etmek için ayarlayabilirsiniz */ filter: blur(4px) brightness(1.5); /* Parlaklık filtresi eklendi */ opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; z-index: -1; } a:hover::before { opacity: 1; } body.hoverEffect { background: radial-gradient(circle at center, #000000, #000033, #000066, #1a1a1a); } #gameCard { width: 300px; height: 450px; margin: 50px auto; padding: 20px; border-radius: 15px; box-shadow: 0 0 50px 10px #FFD700, /* Altın sarısı glow */ 0 0 100px 20px #0000FF, /* Mavi glow */ 0 0 150px 30px #000033; /* Koyu mavi shadow */ background: rgba(0, 0, 0, 0.7); /* Slightly transparent black to make the ambilight effect visible behind the card */ color: #FFD700; /* Altın sarısı text */ text-align: center; border: 3px solid #FFD700; /* Altın sarısı border */ } #gameCardLink span { font-size: 18px; margin-right: 5px; /* Harf aralarına 10 piksel boşluk ekler */ font-weight: bold; /* Metni kalın yapar */ } #gameCardLink span:last-child { font-size: 0.79em; /* ® simgesini küçült */ vertical-align: super; /* ® simgesini yukarı taşı */ opacity: 0.9; font-weight: bold; /* Metni kalın yapar */ text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5); /* Siyah gölge ekler */ } #loading-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: url("https://www.hdwallpapers.in/download/black_hole-1920x1080.jpg"); background-repeat: no-repeat; background-size: cover; display: flex; justify-content: center; align-items: center; z-index: 9999; } .loader { border-top: 9px solid #00a2ed; border-radius: 80%; width: 18vw; /* Genişliği viewport'un %25'i yapar */ height: 18vw; /* Yüksekliği de viewport'un %25'i yapar */ animation: spin 2s linear infinite; /* Burada spin animasyonunu kullanıyoruz */ position: absolute; /* Pozisyonu mutlaka absolute olarak ayarlamalısınız. */ left: 41%; /* X ekseninde ortalamak için sayfanın yarısı kadar sola kaydırın. */ top: 38%; /* Y ekseninde ortalamak için sayfanın yarısı kadar yukarı kaydırın. */ transform: translate(-50%, -50%) rotate(0deg); /* Yuvarlak halkanın tam ortasında olması için bu dönüşümü kullanın. */ } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } <!-- language: lang-html --> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <title>Game Cards App</title> <link rel="icon" type="image/png" href="https://cdn1.iconfinder.com/data/icons/entertainment-events-hobbies/24/card-game-cards-hold-512.png"> </head> <body> <div id="loading-animation"> <div class="loader"></div> </div> <div id="main-content"> <div class="tm-container"> <div class="tm-letter" id="t-letter">T</div> <div class="tm-letter" id="m-letter">M</div> </div> <audio id="flipSound" preload="auto"> <source src="https://cdn.freesound.org/previews/321/321114_2776777-lq.ogg" type="audio/wav"> </audio> <main> <div id="gameCardLink"> <span>G</span> <span>a</span> <span>m</span> <span>e</span> <span> </span> <!-- Boşluk eklemek için span ekledik --> <span> </span> <span>C</span> <span> </span> <span>a</span> <span> </span> <span>r</span> <span> </span> <span>d</span> <span> </span> <span>s</span> <span>®</span> <!-- Registered trademark simgesi için span --> </div> <p><a href="https://github.com/murattasci06"><i class="fab fa-github"></i></a></p> </main> <ul> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://gecbunlari.com/wp-content/uploads/2021/12/Spiderman-No-Way-Home.jpg" alt="Spiderman"> <p class="card__name"><span>Marvel</span><br>Spiderman</p> <p class="card__num">1</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/JfVOs4VSpmA?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#514d9b" stroke-width="35" /> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>1.89 Bil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://i.pinimg.com/736x/1e/f1/3d/1ef13dfa4b7b8c131302e242d1ec48d7.jpg" alt="Batman"> <p class="card__name"><span>DC</span><br>Batman</p> <p class="card__num">2</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/mqqft2x_Aa4?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#35a541" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>771 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://wallpapercave.com/wp/wp12279011.jpg" alt="Guardians_of_the_Galaxy_Vol_3"> <p class="card__name"><span>Marvel</span><br>Guardians_of_the_Galaxy_Vol_3</p> <p class="card__num">3</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/u3V5KDHRQvk?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#bdb235" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>845.4 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://wallpaperaccess.com/full/8940499.jpg" alt="Shazam"> <p class="card__name"><span>DC</span><br>Shazam2</p> <p class="card__num">4</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/AIc671o9yCI?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#db6623" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>462.5 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://images2.alphacoders.com/131/1316679.jpeg" alt="Flash"> <p class="card__name"><span>DC</span><br>Flash</p> <p class="card__num">5</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/hebWYacbdvc?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#3e5eb3" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>560.2 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src=" https://images3.alphacoders.com/121/1213553.jpg" alt="Dr_Strange_2"> <p class="card__name"><span>Marvel</span><br>Dr_Strange_2</p> <p class="card__num">6</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/aWzlQ2N6qqg?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#aa9e5c" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>955.8 Mil. $</span> </div> </div> </li> </ul> </div> </body> </html> <!-- end snippet --> **The link icluding full code:** https://drive.google.com/file/d/1wOhvYSmlcsi5r8m4vosOMFw8Ik2ZoWsW/view?usp=sharing Hello friends, while the page is loading, I normally expect the spin and background space-themed image to appear on the screen at the same time, but first the green background of the page that will be seen when it loads, then the spin and then the loading screen wallpaper. Is it because I downloaded the wallpaper with background-image in the loading-animation section of the style section, so I can't make them appear at the same time? But how will I ensure it? The second thing I don't understand is I block the main-content in the style at startup, how does the background green theme color appear at startup? My expectation is that only the loading screen, wallpaper and spin will appear.
|javascript|html|css|frontend|backend|
I am having trouble with a line of my code. I am trying to run st_union from the "sf" package on two sf objects, a shapefile that has been transformed into an sf object (EPSG:4326) and occurrence data that is also a sf object. I want my two sf objects to union as 1 sf object with the the number of occurrences ("summarize occurrences) of each "genus" in "occ_sf" to be grouped with the name of the county("FYLKESNAVN") found in the shapefile. I am not sure if the runtime is due to the amount of data I have in occ_sf, in which I have 900 000 occurrences. Or with the number of genera in the table. When I ran these two with st_join it ran pretty quickly. When I ran them with st_intersection it was taking a really long time, I had to manually terminate the run (multiple times). I think st_union is the more relevant function for the output I want. I have updated my packages and deleted the .RDATA file from my laptop, and I have also updated R to 4.3.3 "Angel Food Cake" to try to run this faster. But it's still running really slowly. I have also tried running a progress bar with the "progress" package but I could not get it to run the status of the st_union function. Any advice or new ideas? This is my code: ``` # Perform the spatial union of shp2 and occ_sf library(sf) library(dplyr) shp2_occsf_union <- st_union(shp2, occ_sf) class(shp2_occsf_union) View(shp2_occsf_union) # Group data grouped_union <- shp2_occsf_union %% group_by(FYLKESNAVN, genus) summarize(occurrences = n()) # View the result View(grouped_union) # Plot the union library("ggplot2") ggplot() + geom_sf(data = shp2) + geom_sf(data = grouped_union, aes(color = occurrences), size = 0.25) + geom_sf(data = shp) + theme_classic() ```
St_union function taking a long time to run (R)
|r|performance|runtime|r-package|
null
[ignor the bar][1]I have been experimenting with SVG recently and to be more specific on creating a 12-part wheel.I came across a code snippet in a previous post that fit my needs but consists of 6 parts and i need 12 segments.My problem is that i can not understand the proccess of the division. Below is the snippet that I'm trying to understand better and would appreciate some explanation or tips on how it worksor provide some insights on how to optimize it (adding 6 more segments). <svg width="500" height="500" viewBox="-2 -2 202 203" shape-rendering="geometricPrecision"> <a xlink:href="#"><path class="frag" d="M100,100 v-100 a100,100 1 0,1 86.6025,50" /><text x="135" y="42.5" text-anchor="middle">1</text></a> <a xlink:href="#"><path class="frag" d="M100,100 l86.6025,-50 a100,100 1 0,1 0,100" /><text x="170" y="105" text-anchor="middle">2</text></a> <a xlink:href="#"><path class="frag" d="M100,100 l86.6025,50 a100,100 1 0,1 -86.6025,50" /><text x="135" y="170" text-anchor="middle">3</text></a> <a xlink:href="#"><path class="frag" d="M100,100 v100 a100,100 1 0,1 -86.6025,-50" /><text x="65" y="170" text-anchor="middle">4</text></a> <a xlink:href="#"><path class="frag" d="M100,100 l-86.6025,50 a100,100 1 0,1 0,-100" /><text x="27.5" y="105" text-anchor="middle">5</text></a> <a xlink:href="#"><path class="frag" d="M100,100 l-86.6025,-50 a100,100 1 0,1 86.0025,-50" /><text x="65" y="42.5" text-anchor="middle">6</text></a> <a xlink:href="#"><path class="center" d="M100,100 v-50 a50,50 1 0,1 0,100 a50,50 1 0,1 0,-100" /></a> </svg> [1]: https://i.stack.imgur.com/Vng46.png
I have a project which uses Simple-git to clone the repo in my local folder but due to read-only file system in Mac it is not able to make a new directory Would Like to know if there's a way to grant +rw access to a particular directory... tried `chmod +rw src` but it ain't working code I ran : `await simpleGit().clone(url,"/deploy/"+id);` Error:` GitError: fatal: could not create leading directories of '/deploy/Izste': Read-only file system`
how to make read only file/directory in Mac writable
|node.js|macos|macos-sonoma|simple-git|
null
I still don't know how to do it updating the height as it changes. But I think one workaround would be to: 1. Apply `position: "fixed"` and `height: "100vh"` to the sidebar. 1. Create a context to hold and update the collapsing and width of the sidebar. 1. Use the context updates to update the `marginLeft` of the content.
Try changing your scopes to an array as per the 'docs': [https://github.com/AzureAD/microsoft-identity-web/blob/master/docs/blog-posts/downstreamwebapi-to-downstreamapi.md][1] [1]: https://Try%20changing%20your%20scopes%20to%20an%20array%20as%20per%20the%20'docs':%20%20%20https://github.com/AzureAD/microsoft-identity-web/blob/master/docs/blog-posts/downstreamwebapi-to-downstreamapi.md so "DownstreamApi": { "Scopes": { "Read": "api://<CLIENT_ID>/ToDoList.Read", "Write": "api://<CLIENT_ID>/ToDoList.ReadWrite" }, "BaseUrl": "https://localhost:7281" }, becomes: "DownstreamApi": { "Scopes": [ "api://<CLIENT_ID>/ToDoList.Read", "api://<CLIENT_ID>/ToDoList.ReadWrite" ], "BaseUrl": "https://localhost:7281" },
I'm trying to execute `md5sum` command in my program using `pipe`, `fork` and `dup`. I found some code that runs successfully but I don't understand a couple of lines of code. Code: ```c int main() { int infp, outfp; char buf[128]; if (popen2("md5sum", &infp, &outfp) <= 0) { printf("Unable to exec sort\n"); exit(1); } write(infp, "hello\n", 2); close(infp); *buf = '\0'; read(outfp, buf, 128); printf("buf = '%s'\n", buf); return 0; } ``` ```c #define READ 0 #define WRITE 1 pid_t popen2(const char *command, int *infp, int *outfp) { int p_stdin[2], p_stdout[2]; pid_t pid; if (pipe(p_stdin) != 0 || pipe(p_stdout) != 0) return -1; pid = fork(); if (pid < 0) return pid; else if (pid == 0) { close(p_stdin[WRITE]); dup2(p_stdin[READ], READ); close(p_stdout[READ]); dup2(p_stdout[WRITE], WRITE); execl("/bin/sh", "sh", "-c", command, NULL); perror("execl"); exit(1); } if (infp == NULL) close(p_stdin[WRITE]); else *infp = p_stdin[WRITE]; if (outfp == NULL) close(p_stdout[READ]); else *outfp = p_stdout[READ]; return pid; } ``` _( `popen2` example from https://stackoverflow.com/a/548148/4072736 )_ I don't understand the end of the `popen2` example. What do these lines do exactly? `*infp = p_stdin[WRITE];` `*outfp = p_stdout[READ];` How can pipes communicate with each other?
|microservices|asp.net-core-webapi|
I am using Firestore to fetch data based on a filter that utilizes the 'array-contains-any' operator. Here is the code I am using to fetch the data - ``` const fV = this.getFV(this.selectedButton); return qnaCollectionRef .where('qS', 'array-contains-any' , fV) .onSnapshot((querySnapshot) => { ``` here is the code for getFv ``` getFV(qF: QF): number[] { debugger; switch (qF) { case QF.All: return [1,2]; case QF.O: return [1]; case QF.A: return [2]; default: throw new Error('Unsupported filter option'); } } ``` Assume that my firestore db contains data like ``` for QF.All - [abc, dce, efg, hij] for QF.O - [abc, dce] for QF.A - [efg, hij] ``` Now I have a button which changes this fV to [1,2], [1], [2] which gets called in below query ``` .where('qS', 'array-contains-any' , fV) ``` The issue I'm facing is that regardless of the filter values I pass in fVs, the query always returns data from the fv [1,2]. However, when I modify the query and hardcode the operand to [1] or [2], it correctly returns the desired data from [1] or [2]. ``` .where('qS', 'array-contains-any', [2]) ```
I'm student in practicing PintOS Project. In Programming Project 3(Virtual Memory), I got ploblems about "preprocess in compiling" (C program). I had tried all attempt that do my best, but I'm absolutely lost at this point on how to fix it. Finally i come to here, had to ask you about this issue. **error** There is even stack growth, so I am modifying `syscall.c` to implement `mmap`, **the `spt` field is being recognized as an incomplete type and is not being excluded.** **current situation** The thread structure in question is declared in `thread.h`, and the type `supplemental_page_table` of spt, an element in the `thread` structure, is declared in `vm.h`. Above the thread structure in current thread.h `#ifdef VM #include "vm/vm.h"` is preprocessing the format vm.h. I am currently using the EC2 server(ubuntu 18.04) via SSH connection to VS code, and have tried solutions such as make clean, make, inserting and changing the order of #include preprocessing and forward declaration code, and rebooting + reinstalling EC2, but there is no progress. **Questions** 1. If `vm.h`, where the `spt` structure is declared in `thread.h`, is included before the thread structure, shouldn't it be able to be used without problems? ``` ... #ifdef VM // I'm in project3(VM) #include "vm/vm.h" ... struct thread { ... #ifdef VM /* Table for whole virtual memory owned by thread. */ struct supplemental_page_table spt; // The spt structure is defined in vm.h. ... ``` 2. If you look at the output, you'll see that `page_cache.c` reads `vm.h` on line 3, vm.h on line 32... and at the end of that it comes to `thread.h` and reaches the `thread` structure and fails to read `spt`. By the way, page_cache.c is in project.4, and if you search for it, it's all surrounded by `#ifdef EFILESYS` statements. If you look at the second picture, it still compiles page_cache.c, which was not printed before (stack growth). I haven't entered project 4 yet, the folder was made in vm/build, and the only thing I touched was modifying syscall.c and file.c in the userprog and vm folders. I'm trying to figure out why it's suddenly compiling page_cache, but I'm not sure. I'm writing this down in case it helps you troubleshoot 1. above. [![\[photo 1\](https://i.stack.imgur.com/8bEfe.png)][1]][1] [![\[photo 2\](https://i.stack.imgur.com/ds614.png)][2]][2] 3. Additionally, I have a customization called `tid_t` in `process.h` that is also defined in `thread.h`, and I've included it, but it doesn't reference it. I solved this problem by defining it again in process.h ,it is repeated, but I thought I'd ask along the same lines as above. For reference, I have the above issue after this. ``` /* Code in process.h */ #ifndef USERPROG_PROCESS_H #define USERPROG_PROCESS_H #include "threads/thread.h" bool install_page (void *upage, void *kpage, bool writable); // typedef int tid_t; // If i remove annotation in this line, going to problem mentioned above tid_t process_create_initd (const char *file_name); tid_t process_fork (const char *name, struct intr_frame *if_); int process_exec (void *f_name); int process_wait (tid_t); void process_exit (void); void process_activate (struct thread *next); #endif /* userprog/process.h */ /* Print */ In file included from ../../include/vm/vm.h:7:0, from ../../include/threads/thread.h:12, from ../../threads/init.c:24: ../../include/userprog/process.h:9:1: error: unknown type name ‘tid_t’; did you mean ‘size_t’? tid_t process_create_initd (const char *file_name); ^~~~~ size_t ``` ``` /* here is modified code i did, but i think it is not problem */ void *mmap (void *addr, size_t length, int writable, int fd, off_t offset) { if (offset % PGSIZE != 0) { return NULL; } if (pg_round_down(addr) != addr || is_kernel_vaddr(addr) || addr == NULL || (long long)length <= 0) return NULL; if (fd == 0 || fd == 1) { exit(-1); } if (spt_find_page(&thread_current()->spt, addr)) return NULL; struct file *target = find_file_by_fd(fd); if (target == NULL) return NULL; void * ret = do_mmap(addr, length, writable, target, offset); return ret; } void munmap (void *addr) { do_munmap(addr); } /* Do the mmap */ void *do_mmap (void *addr, size_t length, int writable, struct file *file, off_t offset) { struct file *mfile = file_reopen(file); void * ori_addr = addr; size_t read_bytes = length > file_length(file) ? file_length(file) : length; size_t zero_bytes = PGSIZE - read_bytes % PGSIZE; while (read_bytes > 0 || zero_bytes > 0) { size_t page_read_bytes = read_bytes < PGSIZE ? read_bytes : PGSIZE; size_t page_zero_bytes = PGSIZE - page_read_bytes; struct supplemental_page_table *spt = (struct supplemental_page_table*)malloc (sizeof(struct supplemental_page_table)); spt->file = mfile; spt->offset = offset; spt->read_bytes = page_read_bytes; if (!vm_alloc_page_with_initializer (VM_FILE, addr, writable, lazy_load_segment, spt)) { return NULL; } read_bytes -= page_read_bytes; zero_bytes -= page_zero_bytes; addr += PGSIZE; offset += page_read_bytes; } return ori_addr; } /* Do the munmap */ void do_munmap (void *addr) { while (true) { struct page* page = spt_find_page(&thread_current()->spt, addr); if (page == NULL) break; struct supplemental_page_table * aux = (struct supplemental_page_table *) page->uninit.aux; // dirty(사용되었던) bit 체크 if(pml4_is_dirty(thread_current()->pml4, page->va)) { file_write_at(aux->file, addr, aux->read_bytes, aux->offset); pml4_set_dirty (thread_current()->pml4, page->va, 0); } pml4_clear_page(thread_current()->pml4, page->va); addr += PGSIZE; } } ``` [Here is my Team git-repository][3] `Thank you very much for your time!` [1]: https://i.stack.imgur.com/Z3yIc.png [2]: https://i.stack.imgur.com/jmvKL.png [3]: https://github.com/KraftonJungle4th/Classroom5_Week10-11_Team3_PintOS/tree/DJ
As mentioned in the comments, it's not advisable to keep dates in a text format. Instead, always use a date or timestamp type. String concatenation can be done using `CONCAT()` not `+` as follows : WHERE month.ty LIKE CONCAT('%', YEAR(current_timestamp), '%')
The problem is that when you put HTML into innerHTML the system adds closing tags. You can see this by using your browser devtools inspect facility. Hence you are ending up with more than one table. A simple way of preventing this automatic closure is to make a string of all the HTML and then copy the string into the innerHTML. Here is the code (it cannot be a snippet as the snippet system does not allow access to local storage.) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Package Tracking - Admin</title> </head> <body> <h1>Admin Page</h1> <label for="packageIdAdmin">Package ID:</label> <input type="text" id="packageIdAdmin"> <br> <label for="status">Status:</label> <input type="text" id="status"> <br> <label for="location">Location:</label> <input type="text" id="location"> <br> <label for="estimatedDelivery">Estimated Delivery:</label> <input type="text" id="estimatedDelivery"> <br> <button onclick="addPackage()">Add Package</button> <br><br> <h2>List of Saved Packages</h2> <button onclick="viewPackageList()">View Package List</button> <div id="packageList"></div> <script> // Function to store package data function storePackage(packageId, status, location, estimatedDelivery) { const packageData = { status: status, location: location, estimatedDelivery: estimatedDelivery }; localStorage.setItem(packageId, JSON.stringify(packageData)); } // Function to retrieve package data function retrievePackage(packageId) { const storedPackage = localStorage.getItem(packageId); return storedPackage ? JSON.parse(storedPackage) : null; } // Function to add package by admin function addPackage() { const packageId = document.getElementById("packageIdAdmin").value.trim(); const status = document.getElementById("status").value.trim(); const location = document.getElementById("location").value.trim(); const estimatedDelivery = document.getElementById("estimatedDelivery").value.trim(); if (packageId && status && location && estimatedDelivery) { storePackage(packageId, status, location, estimatedDelivery); alert("Package added successfully!"); } else { alert("Please fill in all fields."); } } // Function to view list of saved packages by admin function viewPackageList() { const packageListDiv = document.getElementById("packageList"); let str = ""; str += "<table border='1'><tr><th>Package ID</th><th>Status</th><th>Location</th><th>Estimated Delivery</th></tr>"; for (let i = 0; i < localStorage.length; i++) { const packageId = localStorage.key(i); const packageData = JSON.parse(localStorage.getItem(packageId)); str += ` <tr> <td>${packageId}</td> <td>${packageData.status}</td> <td>${packageData.location}</td> <td>${packageData.estimatedDelivery}</td> <br> </tr> `; } str += "</table>"; packageListDiv.innerHTML = str; } </script> </body> </html> Here's a snippet to show it works (with data in the code rather than from local storage). <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Package Tracking - Admin</title> </head> <body> <h1>Admin Page</h1> <h2>List of Saved Packages</h2> <button onclick="viewPackageList()">View Package List</button> <div id="packageList"></div> <script> // Function to view list of saved packages by admin function viewPackageList() { const packageListDiv = document.getElementById("packageList"); let str = ""; str += "<table border='1'><tr><th>Package ID</th><th>Status</th><th>Location</th><th>Estimated Delivery</th></tr>"; str += ` <tr> <td>ID1</td> <td>READY</td> <td>NEW YORK</td> <td>1 APRIL</td> </tr> `; str += "</table>"; packageListDiv.innerHTML = str; } </script> </body> </html> <!-- end snippet -->
Out of the box from prometheus, process_cpu_seconds_total means # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. In your example, it is giving you the CPU usage for the instance="localhost:9090", job="prometheus". The value: 50.61 @1711710744.158 52.02 @1711711029.164 it used 50.61 seconds at GMT: Friday, March 29, 2024 11:12:24.158 AM it used 52.02 seconds at GMT: Friday, March 29, 2024 11:17:09.164 AM 1711710744.158 - this is the timestamp in epoch, which is what prometheus uses. So the above values are showing you the CPU usage for the last 5minutes when you ran it.
Error whiling read japanese char name file.without japanese char, file can be read "" import matplotlib.pyplot as plt import cv2 image_path = r"FAX注文0004.tif" image = cv2.imread(image_path) plt.imshow(image) plt.axis('off') plt.show() """ Note: while rename file from r"FAX注文0004.tif" to FAX0004.tif. File easily read Error: TypeError: Image data of dtype object cannot be converted to float
"FAX注文0004.tif" does not read from opencv but "FAX0004.tif" can be readbale
|python|opencv|
A list of data frames: my_list <- list(structure(list(id = c("xxxyz", "xxxyz", "zzuio"), country = c("USA", "USA", "Canada")), class = "data.frame", row.names = c(NA, -3L)), structure(list(id = c("xxxyz", "ppuip", "zzuio"), country = c("USA", "Canada", "Canada")), class = "data.frame", row.names = c(NA, -3L))) my_list [[1]] id country 1 xxxyz USA 2 xxxyz USA 3 zzuio Canada [[2]] id country 1 xxxyz USA 2 ppuip Canada 3 zzuio Canada I want to remove duplicated rows both within and between the data frames stored in that list. [This][1] works to remove duplicates within each data frame: lapply(my_list, function(z) z[!duplicated(z$id),]) [[1]] id country 1 xxxyz USA 3 zzuio Canada [[2]] id country 1 xxxyz USA 2 ppuip Canada 3 zzuio Canada But there are still duplicates between data frames. I want to remove them all, with the following desired output: [[1]] id country xxxyz USA [[2]] id country ppuip Canada zzuio Canada Notes: 1. I want to eliminate duplicates on `id` (other variables can be duplicated) 2. I need a solution where it is not needed to merge the data frames before checking for duplicates 3. If possible, I wish to retain the last observation. For example, in the desired output above, "zzuio Canada" existed in both df, but was kept in the last df only, that is, df 2. 4. I have more than 100 dfs, with variable names that don't necessarily match between dfs. That said, the id is always called "id" 5. I need to reassign the result to the same object (in the case above, `my_list`) [1]: https://stackoverflow.com/questions/42163966/remove-duplicate-rows-for-multiple-dataframes
Try using the following: =LET( lr,MATCH(2,1/(Master!L:L<>"")), fRng,Master!B3:INDEX(Master!B:M,lr,{1,11,12}), criteriaRng1,Master!L3:INDEX(Master!L:L,lr), criteriaRng2,Master!M3:INDEX(Master!M:M,lr), FILTER(fRng,(criteriaRng1=Metrics!A1)*(criteriaRng2="Negotiating"))) ---------- You need to change the `frng` from `Master!B3:INDEX(Master!M:M,lr)` this to `Master!B3:INDEX(Master!B:M,lr,{1,11,12})` ---------- Also I had prefer using `Power Query` since in your last post you had mentioned that you have some quite a large data and using formulas are not suitable as it will be ever expanding, hence formulas may slow down after certain number of rows of data, bt using `POWER QUERY` it will be quite faster, flexible and effortlessly can perform the task. ---------- Or, Use `CHOOSECOLS()` =LET( lr,COUNTA(Master!L:L), fRng,Master!B3:INDEX(Master!M:M,lr), criteriaRng1,Master!L3:INDEX(Master!L:L,lr), criteriaRng2,Master!M3:INDEX(Master!M:M,lr), CHOOSECOLS(FILTER(fRng,(criteriaRng1=Metrics!A1)*(criteriaRng2="Negotiating")),1,11,12)) ----------
I need to write a function that sorts this array based on dialog_node key and previous_sibling keys. The previous_sibling of the next object matches the dialog_node value of the previous object in the array. ``` function orderDialogNodes(nodes) { // Create a mapping of dialog_node to its corresponding index in the array const nodeIndexMap = {}; nodes.forEach((node, index) => { nodeIndexMap[node.dialog_node] = index; }); // Sort the array based on the relationship between dialog_node and previous_sibling nodes.sort((a, b) => { const indexA = nodeIndexMap[a.dialog_node]; const indexB = nodeIndexMap[b.previous_sibling]; return indexA - indexB; }); return nodes; } const inputArray = [ { type: "folder", dialog_node: "node_3_1702794877277", previous_sibling: "node_2_1702794723026", }, { type: "folder", dialog_node: "node_2_1702794723026", previous_sibling: "node_9_1702956631016", }, { type: "folder", dialog_node: "node_9_1702956631016", previous_sibling: "node_7_1702794902054", }, ]; const orderedArray = orderDialogNodes(inputArray); console.log(orderedArray); ```
How to sort Javascript array of objects based on mapped keys between objects
|javascript|arrays|sorting|
null
|android|android-studio|
Here's what my settings.json looks like inside .vscode folder. { "files.associations": { "**/templates{/**,*}.html": "django-html", }, "emmet.includeLanguages": { "django-html": "html" } } This will make vscode interpret that whenever it encounters a "template" folder any .html file inside will be considered a django html.
I have a LET & FILTER function used to use a drop down (green cell) and then it populates a report underneath based on data in sheet("Master") You can see it's bringing in all the ("Master") sheet columns B:M in order and I don't need columns C:K ![enter image description here][1] How can I change `fRng,Master!B3:INDEX(Master!M:M,lr)` to only index and populate columns B, L, M into the sheet with the green drop down (the sheet with my LET formula)? rest of formula: =LET( lr,COUNTA(Master!L:L), fRng,Master!B3:INDEX(Master!M:M,lr), criteriaRng1,Master!L3:INDEX(Master!L:L,lr), criteriaRng2,Master!M3:INDEX(Master!M:M,lr), FILTER(fRng,(criteriaRng1=Metrics!A1)* (criteriaRng2="Negotiating"))) Data that I am indexing and whatnot in formula: ![enter image description here][2] value error after trying to add an array to specify columns: ![enter image description here][3] [1]: https://i.stack.imgur.com/Fsn2b.png [2]: https://i.stack.imgur.com/0ctOr.png [3]: https://i.stack.imgur.com/MosUJ.png
Need clarification of popen2() in C
|c|pipe|fork|popen|dup2|
null
I am having a dict `statistics` in my `view.py` and give it as param in my `context` to my `index.html`. There I want to use it in my html like `{{ statistics.key1 }}`. But I also want to use it in `js`. When using `json.dumps` like this in my `view.py`: "statistics": json.dumps(statistics, cls=DjangoJSONEncoder), I can use it like this in my `js`: var statistics = JSON.parse('{{ statistics | escapejs }}'); But then I can't use it as a dict anymore in my html. Makes sense, as it is now a JSON-String. But when I just pass it like a dict, I can use it in my html. but var statistics = '{{ statistics | escapejs }}' gives me a JSON with single quotes so I can't just parse it. How can I do both? Still use the dict as normal in my HTML and also parse it to use it in js?
use dict from python in django html template and also in js
|python|django|django-views|django-templates|
``` <!DOCTYPE html> <html> <head> <title>Page Title</title> <!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">--> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { background-color: #373737 !important; } .modal-container { position: relative !important; top: 0; right: 0; bottom: 0; left: 0; background-color: #373737; z-index: 10; display: none; align-items: center; justify-content: center; } .modal-dialog { margin: 20px auto 0; width: 100% !important; height: 100% !important; display: flex; align-items: center; justify-content: center; } .modal-content { align-self: center; background-color: transparent; border: none; margin: 0; position: absolute !important; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } .modal-body-container { width: 80%; max-height: 80vh; background-color: black; display: flex; justify-content: center; /* Center horizontally */ /* Center vertically border-radius: 10px; overflow: hidden; } .modal-body img { max-width: 100%; max-height: 100%; height: auto; width: auto; margin: 0 auto; display: block; border-radius: 10px; } .btn-primary { background-color: #ffc107; border-color: #ffc107; color: #000; padding: 10px 20px; border-radius: 5px; margin-right: 10px; border-bottom: none; text-decoration: none; } .btn-primary:hover, .btn-primary:focus { background-color: #ffcd38; border-color: #ffcd38; color: #000; } body.modal-open { overflow: visible; position: relative; } .btn-secondary { background-color: #007bff; border-color: #007bff; color: #fff; padding: 10px 20px; border-radius: 5px; } .btn-secondary:hover, .btn-secondary:focus { background-color: #0056b3; border-color: #0056b3; color: #fff; } .modal-footer { align-self: center; text-align: left; border-top: none; } .modal-footer .btn { margin-right: 10px; } /*@media (max-width: 768px) {*/ /* .modal-content {*/ /* max-width: 90%;*/ /*top:3%;*/ } } </style> </head> <body> <!-- Your existing gallery code here --> <!-- Container for modal background --> <div class="modal-container"> <!-- Modal HTML --> <div id="imageModal" class="modal fade" tabindex="-1" role="dialog"> <div class=" d-flex flex-column modal-dialog" role="document"> <div class="modal-content"> <div class="modal-body-container"> <img id="modalImage" src="" class="img-fluid"> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <a id="downloadLink" href="javascript" download="image" class="btn btn-primary">Download</a> </div> </div> </div> </div> </div> <!-- Your existing script code here --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <script> jQuery(document).ready(function($) { $('.elementor-gallery-item').each(function() { $(this).on('click', function(e) { e.preventDefault(); var imageUrl = $(this).attr('href'); $('#modalImage').attr('src', imageUrl); $('#downloadLink').attr('href', imageUrl); var imagePosition = $(this).offset(); var imageTop = imagePosition.top; var imageLeft = imagePosition.left; $('#modalImage').css({ 'top': imageTop + 'px', 'left': imageLeft + 'px' }); $('#imageModal').modal('show'); $('.modal-container').show(); // Show the modal background container // window.scrollTo(0, 0); }); }); // Close the modal and hide the background container $('#imageModal').on('hidden.bs.modal', function (e) { $('.modal-container').hide(); }); }); jQuery(document).ready(function($) { // Your existing script code // Adjust z-index dynamically when modal is shown $('#imageModal').on('shown.bs.modal', function() { // Ensure backdrop and modal are siblings $(this).before($('.modal-backdrop')); // Set z-index of modal greater than backdrop $(this).css("z-index", parseInt($('.modal-backdrop').css('z-index')) + 1); }); }); </script> </body> </html> ``` this is working fine on the desktop size screen but when the screen size is smaller than 768px and I click in any Image the Modal shows in the centre of the screen You can see this behaviour by opening [](www.tweakball.com) all wallpapers navgation on mobile screen I want the modal to be shown exactly at that point of website where the image is clicked kindly help
Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
|html|jquery|css|bootstrap-5|
null
After conducting several tests by hosting my project on a Windows IIS, where a reverse proxy was configured to redirect server requests to the container, and performing massive requests using a testing tool, `app.k6.io`, the tests didn't go beyond 20 requests. The container would freeze, throwing a timeout error, causing it to hang and not respond. So, after researching and ensuring the server's resources, I tried increasing the server's resources by hosting it on AWS and boosting the CPU and memory resources. When applying the testing again, the massive requests were successful. Therefore, I can conclude that the main issue was a server resource problem. I will continue to conduct tests to further corroborate this statement I am making at this moment. But in case someone else encounters the same issue, this could be an indication of their solution.
I have a json like [ { "url": "https://drive.google.com/file/d/1tO-qVknlH0PLK9CblQsyd568ZiptdKff/view?usp=share_link", "title": "&#8211; Flexibility" }, { "url": "https://drive.google.com/open?id=11_sR8X13lmPcvlT3POfMW3044f3wZdra", "title": "&#8211; Pronouns" } ] I got it using `curl -Lfs "https://motivatedsisters.com/2019/07/08/arabic-review-sr-rahat-basit/" | rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r '{"url": "$1", "title": "$2"}' | jq -s '.'`. I have a command in my machine named `unescape_html`, a python scipt to unescape the html (replace &#8211; with appropriate character). How can I apply this function on each of the titles using `jq`. For example: I want to run: unescape_html "&#8211; Flexibility" unescape_html "&#8211; Pronouns" The expected output is: [ { "url": "https://drive.google.com/file/d/1tO-qVknlH0PLK9CblQsyd568ZiptdKff/view?usp=share_link", "title": "– Flexibility" }, { "url": "https://drive.google.com/open?id=11_sR8X13lmPcvlT3POfMW3044f3wZdra", "title": "– Pronouns" } ] **Update 1:** If `jq` doesn't have that feature, then i am also fine that the command is applied on `rg`. I mean, can i run `unescape_html` on `$2` on the line: rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r '{"url": "$1", "title": "$2"}' Any other bash approach to solve this problem is also fine. The point is, i need to run `unescape_html` on `title`, so that i get the expected output. **Update 2:** The following command: curl -Lfs "https://motivatedsisters.com/2019/07/08/arabic-review-sr-rahat-basit/" | rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r '{"url": "$1", "title": "$2"}' | jq -s '.' | jq 'map(.title |= @sh "unescape_html \(.)")' gives: [ { "url": "https://drive.google.com/file/d/1tO-qVknlH0PLK9CblQsyd568ZiptdKff/view?usp=share_link", "title": "unescape_html '&#8211; Flexibility'" }, { "url": "https://drive.google.com/open?id=11_sR8X13lmPcvlT3POfMW3044f3wZdra", "title": "unescape_html '&#8211; Pronouns'" } ] Just not evaluating the commands. The following command works: curl -Lfs "https://motivatedsisters.com/2019/07/08/arabic-review-sr-rahat-basit/" | rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r '{"url": "$1", "title": "$2"}' | jq -s '.' | jq 'map(.title |= sub("&#8211;"; "–"))' But it only works for `&#8211;`. It will not work for other reserved characters. **Update 3:** The following command: curl -Lfs "https://motivatedsisters.com/2019/07/08/arabic-review-sr-rahat-basit/" | rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r '{"url": "$1", "title": "$2"}' | jq -s '.' | jq -r '.[] | "unescape_html \(.title | @sh)"' | bash is giving: – Flexibility – Pronouns So, it is applying the bash function. Now I need to format is so that the urls are come with the title in json format.
Solved the problem "app -> _layout.tsx" ``` import '../i18n.config'; ``` I added it to the root directory -> i18n.config.ts ``` import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import { getLocales } from 'expo-localization'; import en from "./language/en.json"; import tr from "./language/tr.json"; const resources = { en: { translation: en, fullName: 'English' }, tr: { translation: tr, fullName: 'Türkçe' } }; const deviceLanguage = getLocales()[0].languageCode; i18n.use(initReactI18next).init({ compatibilityJSON: 'v3', resources, lng: deviceLanguage, fallbackLng: "en", interpolation: { escapeValue: false, // not needed }, }); export default i18n; ``` I added it where I will use it ``` import { useTranslation } from "react-i18next"; const { t } = useTranslation(); <Text>{t("hello")}</Text> ``` worked that way for me.
I want to see my GUI interface immediately and initialize the application on an asynchronous thread. For this aim I am using `QFuture`. My code: ``` // main.cpp int main(int argc, char *argv[]) { // create config and credentials QApplication app(argc, argv); LoginForm loginForm(config, credentials); int result = app.exec(); return result; } ``` Then in the login form I am using `QFuture`: ``` void initLauncher(const Aws::Client::ClientConfiguration &config, const Aws::Auth::AWSCredentials &credentials) { // slow function } LoginForm::LoginForm(const Aws::Client::ClientConfiguration &config, const Aws::Auth::AWSCredentials &credentials, QWidget *parent) : QWidget(parent), awsConfig(config), awsCredentials(credentials) { ... QFuture<void> future = QtConcurrent::run([this, &config, &credentials]() { initLauncher(config, credentials); }); QFutureWatcher<void> *watcher = new QFutureWatcher<void>(this); connect(watcher, SIGNAL(finished()), this, SLOT(initializationFinished())); // delete the watcher when finished too connect(watcher, SIGNAL(finished()), watcher, SLOT(deleteLater())); watcher->setFuture(future); // creating buttons show(); ``` Where `LoginForm` is the `QWidget` class. **Problem** -- I see the GUI interface only after the `initLauncher()` function is done. How can I show the GUI interface before `initLauncher()`?
Why is QFuture not working asynchronously?
In UWP app, when you define a string resource in your resource file, the `Name` property of this string can be either "Name" or "Name.Property". In xaml code, we use `Uid` attribute to associate controls to resource, but when we use resource in xaml code, we must add the specified property to the resource's name, in case the control don't know what property should be applied to the string resource. This is the same in the code behind, you get the resource using <!-- language: c# --> var loader = new ResourceLoader(); var resourceString = loader.GetString("txt_ok"); but you still need to set this `resourceString` to the `Text` property of a `TextBlock` for example: <!-- language: c# --> txt.Text = resourceString; So if you want to use the string resource directly in xaml code, you will need to edit your resource file like this: [![enter image description here][1]][1] And you can now associate your `TextBlock` to your resource like this: <!-- language: xaml --> <TextBlock x:Uid="txt_cancel" /> Or like this (not 100% correct, it depends on the location of your resource file): <!-- language: xaml --> <TextBlock x:Uid="/Resources/txt_settings" /> ## Addition: Accessing `Name.Property` from code If you still want to access those resources in code, just replace the `.`s with `/`s: <!-- language: c# --> loader.GetString("txt_ok/Text"); ## Addition: Properties besides text You can also define other property in your resource file for example like this: [![enter image description here][2]][2] And when you apply this resource for a `TextBlock`: <!-- language: c# --> <TextBlock x:Uid="MyApp" /> You will see: [![enter image description here][3]][3] [1]: http://i.stack.imgur.com/khJRN.png [2]: http://i.stack.imgur.com/pOgzP.png [3]: http://i.stack.imgur.com/tQEbz.png
Remove duplicated rows within and between data frames stored in a list
|r|list|duplicates|lapply|
I get the following errors when republishing the image I took with ros2 run ffmpeg.; `ros2 run image_transport republish ffmpeg in/ffmpeg:=image_raw/ffmpeg raw out:=image_raw/uncompressed --ros-args -p "ffmpeg_image_transport.map.hevc_rkmpp:=hevc"` `terminate called after throwing an instance of 'image_transport::TransportLoadException' what(): Unable to load plugin for transport 'image_transport/ffmpeg_sub', error string: According to the loaded plugin descriptions the class image_transport/ffmpeg_sub with base class type image_transport::SubscriberPlugin does not exist. Declared types are image_transport/compressedDepth_sub image_transport/compressed_sub image_transport/raw_sub image_transport/theora_sub [ros2run]: Aborted ` I don't want to replace the parameters specified in the errors. I want to do this with ffmpeg. how can i fix this After running ros2, I want to list the topics, echo them and view them with rviz2 and image uncompressed.Afterwards, I want to use and show this uncompressed image in my Python detection project.
I get an error when republishing the image I shot with ros2 run ffmpeg
|ffmpeg|decode|ros2|
null
I'm trying to build binutils-2.7 and gcc with Cygwin while following https://wiki.osdev.org/GCC_Cross-Compiler. Everytime I run: ../binutils-2.7/configure --target=i386-elf --prefix="/home/jacki" --with-sysroot --disable-nls --disable-werror I get this error: Config.guess failed to determine the host type. You need to specify one. I do not no much about building gcc or binutils. I'm just trying to start developing my os.
"Config.guess failed to determine the host type" when trying build binutils-2.7 with Cygwin
|gcc|build|cygwin|osdev|binutils|
I need the bot to understand that they left a reaction in the post and display in the console what type of reaction they gave, for example, heart, like, dislike, and I need this to work through the telebot library in python, please help, I don’t understand at all how this can be done. I tried to read data from a message, something like "message.reaction", but I got an error saying that there is no "reaction". import telebot bot = telebot.TeleBot('token') @bot.message_handler(func=lambda message: True) def handle_reaction(message): print(message.reaction) bot.polling() AttributeError: 'Message' object has no attribute 'reaction'. Did you mean: 'caption'?
|python|python-3.x|bots|telegram-bot|telebot|
try this ``` import * as spine from "@esotericsoftware/spine-phaser" plugins: { scene: [ { key: "spine.SpinePlugin", plugin: spine.SpinePlugin, mapping: "spine" } ] } ```
after changing the port number issue got resolved
The error message ``` Message [akka.cluster.ddata.Replicator$Internal$DeltaPropagation] wrapped in [akka.actor.ActorSelectionMessage] from Actor[akka://my-app/system/clusterReceptionist/replicator#-189849616] to Actor[akka://my-app@10.180.102.333:2550/] was dropped. Discarding oversized payload sent to Some(Actor[akka://my-app@10.180.102.333:2550/]): max allowed size 262144 bytes. ``` DeltaPropagation definition in Akka code ``` final case class DeltaPropagation(_fromNode: UniqueAddress, reply: Boolean, deltas: Map[KeyId, Delta]) ``` Thoughts and questions: Looks like the number of deltas could be so large that it inflates the class size beyond the limit? Can this be confirmed some how? Or event estimated looking at my settings (most of them are default) How can I keep this list within the limits that is acceptable by akka? I looked up the Akka sharding documentation also read about the receptionist. I was not able to find the answers there.
akka.cluster.ddata.Replicator$Internal$DeltaPropagation message from clusterReceptionist replicator is dropped because it exceeds the size limit
|akka|reactive-programming|actor|sharding|distributed-system|
null
I just encountered this really strange phenomenon that I am putting a TextField at the bottom of my screen, everything is wrapped in a scaffold and when the textfield is clicked the whole content is being pushed up (note: I used a SingleChildScrollView for this). But now using a controller to make use of all the functionalities of a textfield, this automatic pushing upwards suddenly vanished and I have no idea how to make it stay and work simultaneously to the textfieldcontroller. It seems like I have to choose between the two. Does anyone has an idea why this happens and how to fix this?
Flutter: TextField controller prevents content from being pushed up
|flutter|user-interface|textfield|
Thank you so much it worked for me: in windows 11: go to Settings > Network & Internet > WI-FI > Hardware Properties > More Adapter Options > Click Edit. Look for IP4, click Properties > Make it "Use The Following DNS Server Address" Preferred DNS Server : 8.8.8.8 Alternative DNS Server : 8.8.4.4 that worked for me. Thank you A J
{"OriginalQuestionIds":[20461165],"Voters":[{"Id":16343464,"DisplayName":"mozway","BindingReason":{"GoldTagBadge":"pandas"}}]}
"root element" is not really a thing here. The browser will see the component deeply embedded in the layout and page. You can make your own root: ```html <div class="root"> <div class="foo"> <div>Hello</div> <div>World</div> </div> <span class="foo2"> Second root element </span> </div> ``` and then apply a style to the 'root level' elements with ```css * > .root { margin: 1em; ... } ```
This only list key which are enabled credential = AzureCliCredential() secret_client = SecretClient(vault_url=f"https://{keyvault}.vault.azure.net", credential=credential) return secret_client.list_properties_of_secrets()
in my case, i have to Click on my Target->Build Settings-> search for "Other Linker Flags" and added "-fprofile-instr-generate".
Is there a way to create a column from a single string value that is inherently and by default already a string column and not an object column? An object column uses too much memory, and I don't want to spend any time casting an object column back to a string column. ```python df = pd.DataFrame(dict(a=range(10))) df["new"] = "my string" df.info() <class 'pandas.core.frame.DataFrame'> RangeIndex: 10 entries, 0 to 9 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 a 10 non-null int64 1 new 10 non-null object dtypes: int64(1), object(1) memory usage: 288.0+ bytes ``` Even if I initialize an empty string column first, it still returns an object column. ```python df = pd.DataFrame(dict(a=range(10))) df["new"] = pd.Series(dtype="string") df.info() <class 'pandas.core.frame.DataFrame'> RangeIndex: 10 entries, 0 to 9 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 a 10 non-null int64 1 new 0 non-null string dtypes: int64(1), string(1) memory usage: 288.0 bytes df["new"] = "my string" df.info() <class 'pandas.core.frame.DataFrame'> RangeIndex: 10 entries, 0 to 9 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 a 10 non-null int64 1 new 10 non-null object dtypes: int64(1), object(1) memory usage: 288.0+ bytes ``` This is the only way that I have found that works, but it seems like so much code & effort for accomplishing something that should be simple. ```python df = pd.DataFrame(dict(a=range(10))) df["new"] = pd.Series(["my string"] * len(df), dtype="string", index=df.index) df.info() <class 'pandas.core.frame.DataFrame'> RangeIndex: 10 entries, 0 to 9 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 a 10 non-null int64 1 new 10 non-null string dtypes: int64(1), string(1) memory usage: 288.0 bytes ```
We have a large number of databases running on a SQL Database Server in Azure. We're trying to automate some basic functions, in this case, setting the LTR policy on all new databases, so there's no chance of one slipping through the cracks and not getting set. Is there anyway to automatically assign LTR policies? I've found lots of ways to assign it (through the Portal, through Azure CLI, Powershell, etc.), but they all require doing it either en masse or to a single databases, and all require manual execution. Is there anyway to tell Azure to apply a default to new databases automatically, so we don't have to do anything manually?
How to automatically assign Long Term Retention (LTR) policy to new databases