Tracfone generator codes airtime

Good Use of OOP in Python? Is this overcomplicated?

2024.05.19 09:39 Stack50 Good Use of OOP in Python? Is this overcomplicated?

Hello programmers,
I have been rewriting my Tetris game from a while ago that was very messy (one big old file). I am trying to go for MAXIMUM code quality with SOLID. This section of code is from the piece queue system, which originally was just hard coded in the game logic along with everything else. What do you think of this design? Is it way overcomplicate (how do I simplify)? Is it "pythonic"?
from typing import TypeVar, Generic, Iterable from abc import ABC, abstractmethod import random _T = TypeVar("_T") """ Alternate designs: - Take in Generator function and use next(self.generator) - Create strategy class and take that in """ class RefillingQueue(ABC, Generic[_T]): def __init__(self, refill_items: Iterable[_T], visible_size: int = 1) -> None: self.refill_items = list(refill_items) self.visible_size = visible_size self.queue = [] self.fill_queue() def insert_at_start(self, items: list[_T]) -> None: self.queue = items + self.queue def pop(self) -> _T: value = self.queue.pop(0) self.fill_queue() return value def view(self) -> list[_T]: return self.queue[self.visible_size:] def fill_queue(self): while len(self) < self.visible_size: self.queue.extend(self.generate()) u/abstractmethod def generate() -> list[_T]: pass class FullRandomQueue(RefillingQueue[_T]): def generate(self) -> list[_T]: return [random.choice(self.refill_items)] class ShuffledBagQueue(RefillingQueue[_T]): def generate(self) -> list[_T]: items = self.refill_items.copy() random.shuffle(items) return items class LessRepeatRandomQueue(RefillingQueue[_T]): def __init__(self, refill_items: Iterable[_T], visible_size: int = 1) -> None: super().__init__(refill_items, visible_size) self.last_item = random.choice(self.refill_items) def generate(self) -> list[_T]: roll_num = random.randrange(-1, len(self.refill_items)) if roll_num == -1 or self.refill_items[roll_num] == self.last_item: roll_num = random.randrange(0, len(self.refill_items)) self.last_item = self.refill_items[roll_num] return [self.last_item] 
What I am going for:
  1. Single Responsibility Principle (SRP)
  2. Open/Closed Principle
  3. Liskov’s Substitution Principle (LSP)
  4. Interface Segregation Principle (ISP)
  5. Dependency Inversion Principle (DIP)
From: https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/
I am open to all suggestions, even if they are of the goal itself. THANK YOU FOR YOUR TIME!
submitted by Stack50 to learnprogramming [link] [comments]


2024.05.19 09:30 CloudysYe Chaos (fault) testing method for etcd and MongoDB

Chaos (fault) testing method for etcd and MongoDB
https://preview.redd.it/wqrh8ahk5c1d1.png?width=824&format=png&auto=webp&s=5eee98a84c0072df8c688597c1b1acbbd113a104
Recently, I have been doing chaos (fault) tests on the robustness of some self-built database driveclient base libraries to verify and understand the fault handling mechanism and recovery time of the business. It mainly involves the two basic components MongoDB and etcd. This article will introduce the relevant test methods.

Fault test in MongoDB

MongoDB is a popular document database in the world, supporting ACID transactions, distributed and other features.
Most of the articles on chaos (fault) testing of MongoDB in the community are simulated by processing monogd or mongos. For example, if you want MongoDB to trigger copy set switching, you can use a shell script like this:
# suspended the primary node kill -s STOP  # After the service is damaged, MongoDB should stepDown ReplicaSet in a few seconds to ten seconds. # After the stepDown is complete, the service can automatically switch the connection to the new working primary node, without manual intervention, the service will return to normal. # The reliability of the Mongo Client Driver is generally verified here. 
The above-mentioned means are generally system-level, if we just want to simulate a MongoDB command command encountered network problems, how to do further want to conduct more fine-grained testing. In fact, MongoDB in 4.x version above has implemented a set of controllable fault point simulation mechanism -> failCommand.
When deploying a MongoDB replica set in a test environment, you can generally enable this feature in the following ways:
mongod --setParameter enableTestCommands=1 
Then we can open the fault point for a specific command through the mongo shell, for example, for a find operation to make it return error code 2:
db.adminCommand({ configureFailPoint: "failCommand", mode: { "times": 1, }, data: {errorCode: 2, failCommands: ["find"]} }); 
These fault point simulations are controllable, and the cost is relatively low compared to the direct destruction on the machine, and it is also suitable for integrating into continuous integration automation processes. The MongoDB built-in fault point mechanism also supports many features, such as allowing a certain fault probability to occur, returning any MongoDB supported error code type, etc. Through this mechanism, we can easily verify the reliability of our own implementation of the MongoDB Client Driver in unit tests and integration tests.
If you want to know which fault points the MongoDB supports, you can check the specification provided by the MongoDB in detail, which mentions which fault points the driver can use for testing for each feature of the MongoDB.
MongoDB, there are many examples in the dirver code repository of the official go implementation that can be: https://github.com/mongodb/mongo-go-driveblob/345ea9574e28732ca4f9d7d3bb9c103c897a65b8/mongo/with\_transactions\_test.go#L122.

Fault test in etcd

etcd is an open source and highly available distributed key-value storage system, which is mainly used for shared configuration and service discovery.
We mentioned earlier that MongoDB has a built-in controllable fault point injection mechanism to facilitate us to do fault point testing, so does etcd also provide it?
Yes, etcd officials also provide a built-in controllable fault injection method to facilitate us to do fault simulation tests around etcd. However, the official binary distribution available for deployment does not use the fault injection feature by default, which is different from the switch provided by MongoDB. etcd requires us to manually compile the binary containing the fault injection feature from the source code for deployment.
etcd has officially implemented a Go package gofail to do "controllable" fault point testing, which can control the probability and number of specific faults. gofail can be used in any Go implementation program.
In principle, comments are used in the source code to bury some fault injection points in places where problems may occur through comments (// gofail:), which is biased towards testing and verification, for example:
 if t.backend.hooks != nil { // gofail: var commitBeforePreCommitHook struct{} t.backend.hooks.OnPreCommitUnsafe(t) // gofail: var commitAfterPreCommitHook struct{} } 
Before using go build to build the binary, use the command line tool gofail enable provided by gofail to cancel the comments of these fault injection related codes and generate the code related to the fault point, so that the compiled binary can be used for fine-grained testing of fault scenarios. Use gofail disable to remove the generated fault point related codes, the binary compiled with go build can be used in the production environment.
When executing final binary, you can wake up the fault point through the environment variable GOFAIL_FAILPOINTS. if your binary program is a service that never stops, you can start an HTTP endpoint to wake up the buried fault point to the external test tool by GOFAIL_HTTP the environment variable at the same time as the program starts.
The specific principle implementation can be seen in the design document of gofail-> design.
It is worth mentioning that pingcap have rebuilt a wheel based on gofail and made many optimizations: failpoint related code should not have any additional overhead; Can not affect the normal function logic, can not have any intrusion on the function code; failpoint code must be easy to read, easy to write and can introduce compiler detection; In the generated code, the line number of the functional logic code cannot be changed (easy to debug);
Next, let's look at how to enable these fault burial points in etcd.

Compile etcd for fault testing

corresponding commands have been built into the Makefile of the official etcd github repository to help us quickly compile the binary etcd server containing fault points. the compilation steps are roughly as follows:
git clone git@github.com:etcd-io/etcd.git cd etcd # generate failpoint relative code make gofail-enable # compile etcd bin file make build # Restore code make gofail-disable 
After the above steps, the compiled binary files can be directly seen in the bin directory. Let's start etcd to have a look:
# enable http endpoint to control the failpoint GOFAIL_HTTP="127.0.0.1:22381" ./bin/etcd 
Use curl to see which failure points can be used:
curl afterCommit= afterStartDBTxn= afterWritebackBuf= applyBeforeOpenSnapshot= beforeApplyOneConfChange= beforeApplyOneEntryNormal= beforeCommit= beforeLookupWhenForwardLeaseTimeToLive= beforeLookupWhenLeaseTimeToLive= beforeSendWatchResponse= beforeStartDBTxn= beforeWritebackBuf= commitAfterPreCommitHook= commitBeforePreCommitHook= compactAfterCommitBatch= compactAfterCommitScheduledCompact= compactAfterSetFinishedCompact= compactBeforeCommitBatch= compactBeforeCommitScheduledCompact= compactBeforeSetFinishedCompact= defragBeforeCopy= defragBeforeRename= raftAfterApplySnap= raftAfterSave= raftAfterSaveSnap= raftAfterWALRelease= raftBeforeAdvance= raftBeforeApplySnap= raftBeforeFollowerSend= raftBeforeLeaderSend= raftBeforeSave= raftBeforeSaveSnap= walAfterSync= walBeforeSync=http://127.0.0.1:22381 
Knowing these fault points, you can set the fault type for the specified fault, as follows:
# In beforeLookupWhenForwardLeaseTimeToLive failoint sleep 10 seconds curl -XPUT -d'sleep(10000)' # peek failpoint status curl sleep(1000)http://127.0.0.1:22381/beforeLookupWhenForwardLeaseTimeToLivehttp://127.0.0.1:22381/beforeLookupWhenForwardLeaseTimeToLive 
For the description syntax of the failure point, see: https://github.com/etcd-io/gofail/blob/mastedoc/design.md#syntax
so far, we have been able to do some fault simulation tests by using the fault points built in etcd. how to use these fault points can refer to the official integration test implementation of etcd-> etcd Robustness Testing. you can search for relevant codes by the name of the fault point.
In addition to the above-mentioned built-in failure points of etcd, the official warehouse of etcd also provides a system-level integration test example-> etcd local-tester, which simulates the node downtime test in etcd cluster mode.
Well, the sharing of this article is over for the time being ღ( ´・ᴗ・` )~
Commercial break: I recently maintenance can maintain multiple etcd server, etcdctl etcductl version of the tools vfox-etcd), You can also use it to install multiple versions of etcd containing failpoint on the machine for chaos (failure simulation) tests!
submitted by CloudysYe to ChaosEngineering [link] [comments]


2024.05.19 09:03 linha_keio [Rank AI generated answers by preference!][Put your link in the comments I will answer back to yours!][NO AI KNOWLEDGE NEEDED][15mn Survey + SurveySwap Code]

submitted by linha_keio to takemysurvey [link] [comments]


2024.05.19 08:09 00_Reyna_00 MetaQuest 1 headset fitting failure with Meta account

Hello, I have a MetaQuest 1 headset with me and I cannot link it to my account using the mobile app. I am actually connected to my account on the app, I follow the steps but when I have to enter the 5-digit code that the headset is supposed to generate, that's where it gets stuck.
In fact, when I want to generate a code to pair the headset with my account, I press the button to generate a code, it loads barely a moment before displaying "error occurred, please try again". I've tried to find out where the problem could come from but I can't find it and I really wouldn't want to lose everything I have on my account. I think I tried again for +/_ 30 min with the headset at 95% and nothing works.
Does anyone have any ideas to help me?
submitted by 00_Reyna_00 to MetaQuestVR [link] [comments]


2024.05.19 07:58 Paintedandpunk DD93/IPPSA Issue

DD93/IPPSA Issue
I’m trying to sign my DD93 in IPPSA. I log in with my CAC through EAMS. I can edit and validate my form, but after I validate it, this window pops up. When I try to sign it the prompt window pops up briefly and then disappears. I’ve cleared cookies and certificates added the websites to safe lists. I’ve done everything I can think of and I still get this. It’s the same issue on my personal computer and government computers. Any ideas?
submitted by Paintedandpunk to army [link] [comments]


2024.05.19 07:55 Porygon-Bot Scarlet and Violet Daily Casual Trade Thread for 19 May 2024

Welcome to the /pokemontrades Scarlet and Violet Daily Casual Trade Thread!

This thread is for competitive/casual trades, and tradebacks, in Scarlet and Violet.
Do not trade, or tradeback, shiny or event Pokémon or event serial codes in this thread.
- - -

Subreddit trading rules do apply!

No trading of hacked, cloned, illegal, or otherwise illegitimate Pokémon will be tolerated under any circumstances. Definitions of these terms are available in the Legitimacy Policy.

Please keep in mind:

- - -

- - -
Stay alert, and happy trading!
submitted by Porygon-Bot to pokemontrades [link] [comments]


2024.05.19 07:35 OCEANOFANYTHING Create Stunning AI QR Code Art In 2 Minutes! [Discussion]

Create Stunning AI QR Code Art In 2 Minutes! [Discussion] submitted by OCEANOFANYTHING to MachineLearning [link] [comments]


2024.05.19 07:32 OCEANOFANYTHING Create Stunning AI QR Code Art In 2 Minutes!

Create Stunning AI QR Code Art In 2 Minutes! submitted by OCEANOFANYTHING to learnmachinelearning [link] [comments]


2024.05.19 07:31 Blockchain-TEMU Intermediary Physics - Perfumery to Plastics - n=butylation at the foundry defines plastic solids

  1. A transistor rubber plastic has differentiable affinity and does not contain hydrogen, but does contain gold 1.1 These affinity are for the phasic differentiable of the silicon transistor plastic 1.1.1 Simple N-Butylation buffers the transistor in a chassis almost the weight of the transistor of simple N-Butylation of the individual transistor 1.1.2 Complex Metal butylation exists at either end of the full transistor 1.1.3 The transistor for a typical PC as maybe used by hillary clinton in 1994 has 4 transistor phasic lock components at the largest slowest process clock the timing clock or this also resolves to One Iris graphic Core and 3 typical Pentium 4 PC core 1.1.4 Transistors are highly regular in their formation output in a phasiotemporal scale and each core at the micro oscillation level of one quarter clock speed has a differentiable hyperspectral 100MHZ EM FCC Band 1.1.5 Over 1200-1400 different process exist which a process is a physical machine of the user that they access with their Core 1 GPU Access and share the other 3 Pentium 4 core individually as Pentium 4 to user 1.1.6 There is a intrinsic section of the code which writes the display at an FCC Allocated band making the display only able to be seen by nonlocal users when streaming, or Via reconstruction of the users content via shared metrics, like Keylog or Keybind can provide a text document of the user 1.1.7 An FCC Band Allocates a running of a DXD Process at about a Megahertz or 10 Megahertz for DSD and these DXD process are what mediate the users viewing of a screen is the running of Keybind or simple Crafting table at a DXD or DSD Rate with jit access, then the DXD Frontier Game yields the phasiotemporal solution for harmonics in E for the phasioresonator 1.1.8 A frontier game is a solution for N+1 in N or the Mandelbrot set, but is not an indifferentiable solution but a phasic told superconducting system 1.1.9 Example phase 1234 given resolves to frontier 1234 - frontier takes the 1234 and adds a Inc at every half phase for a circle, or does another operation, and this 1234 can come from the users processor modification of the FCC Request, 4-Screen Mode? 1.2.1 Classic frontier usage, frontier is used with a file instead of the users input 1.2.2 Frontier requires a 2GB or less wav file or mp3 file to function in this capacity 1.2.3 Advanced, the users processor sends 2GB stream across actual megahertz 6-component cable to provide each scan line of the user from intrinsic connection 1.2.4 Nominally the user will use a system of procedural generation to use less than a scoreboard of a display Perfumery to Plastics
submitted by Blockchain-TEMU to u/Blockchain-TEMU [link] [comments]


2024.05.19 07:28 OCEANOFANYTHING Create Stunning AI QR Code Art In 2 Minutes!

Create Stunning AI QR Code Art In 2 Minutes! submitted by OCEANOFANYTHING to civ [link] [comments]


2024.05.19 07:27 OCEANOFANYTHING Create Stunning AI QR Code Art In 2 Minutes!

submitted by OCEANOFANYTHING to programming [link] [comments]


2024.05.19 07:26 tuomount Open Realm of Stars 0.26.0 released

Open Realm of Stars 0.26.0 released
​There is a new version available for Open Realm of Stars. Basic things has been redesign for this version. Space race, governments are completely redone, they have traits which define how they function. These traits are scored and now each space race and governments have equal amount of score. Of course space race and governments resemble the old one, but there are some changes. Alonians have been removed from the game only special thing they had was their starting.
In this version each realm can choose/randomize starting scenario. One can start from certain type of planet, including Earth, or without starting planet or from utopia planet which has lot's of buildings done, but have no ships. Last choice is starting planet that is doomed to have some kind of bad event(s). Idea is to react and just move population to other planet.
https://preview.redd.it/zjzs06cbjb1d1.png?width=1920&format=png&auto=webp&s=048539c35cd191063b4924ac42735135f2aca9d7
For one realm there are 15 space races, 22 governments, 17 starting scenarios and toggle setting for elder race. So there are 11220 different kind of starting for one single realm. Maximum number of realms is 16 so there is quite many ways to generate starting galaxy.
https://preview.redd.it/3mg7cyqcjb1d1.png?width=1920&format=png&auto=webp&s=62f34c6e5f386514716281a4efacf183f95242b0
Game is now using JSON files to load speeches, space race, governments, buildings. So these are no longer made with purely in Java code. Good side is at least in theory it is possible to mod the game. In the future it is also possibility to add editor for creating custom space race and/or government.
Second big change is the planets. Earlier planets were quite similar between each others. They had radiation, size, and amount of metal. Planet type was almost purely for cosmetics. In this version planet has temperature, radiation, size, gravity and water level. Based on these world type is selected. When starmap is being created, sun type determines what kind of planet is more likely to be created. Hotter sun have hotter and more radiated planets. Temperature affects how much water planet has. Planet size affects directly on gravity planet has.
Due these changes space races now have abilities which may give bonus or mallus depending on planet and space race. For example there space race which are more used to function in low gravity. If that colonizes normal or high gravity planet they get mallus for mining and production. On other hand if space race used for high gravity gets bonus on low gravity or normal gravity bonus. This same goes also with temperature. There are space race which are more tolerant for cold and some are more tolerant for hotter planets. Water level on planet directly tells how much food planet produces naturally without any changes.
https://preview.redd.it/yuo1p2rdjb1d1.png?width=1920&format=png&auto=webp&s=24a023ef9879b5e10606b18848253c4eab3de9a2
There are also statuses with planets, that are triggered to activate after certain amount of star years. For example precious gems are no longer discovered immediately after colonization, but just after few star years. Planet can have multiple of these statuses.
Although it might sounds these changes were small, but there has been quite a lot of code rewritten to implement all this. For this it is good to continue to have new features.
Open Realm of Stars is available in Github and Itchio
submitted by tuomount to 4Xgaming [link] [comments]


2024.05.19 07:24 OCEANOFANYTHING Create Stunning AI QR Code Art In 2 Minutes!

Create Stunning AI QR Code Art In 2 Minutes! submitted by OCEANOFANYTHING to huggingface [link] [comments]


2024.05.19 07:00 EchoJobs 🐬 May 19 - 54 new Mid Level Software Engineer Jobs

Job Position Salary Locations
Data Scientist USD 130k - 135k
Backend Engineer USD 175k - 210k New York, NY
Software Engineer USD 125k - 200k Palo Alto, CA, Remote Hybrid
Data Analyst - LinkNYC USD 100k - 150k New York, NY
Site Reliability Engineer III USD 122k - 183k Seattle, WA, US, Remote Hybrid
Director, Data Engineering USD 205k - 294k US, Remote
9107 - Field Application Engineer USD 170k - 240k US
Data Scientist, Risk & Fraud USD 180k - 230k Phoenix, AZ, Seattle, WA, Denver, CO, Toronto, Ontario, Ontario, San Francisco, CA, Los Angeles, CA, New York, NY
Systems and Infrastructure Engineer III USD 90k - 216k US, Reston, VA
Systems and Infrastructure Engineer III USD 90k - 216k US, Reston, VA
Data Engineer III USD 117k - 234k US, Sunnyvale, CA
Software Engineer USD 177k - 245k San Francisco, CA, Remote
Linux Site Reliability Engineer USD 120k - 160k Bastrop, TX
Lead Operations Engineer Starbase Supply Chain USD 125k - 175k Starbase, TX
FPGA/ASIC Design Engineer Silicon Engineering USD 120k - 170k Redmond, WA
FPGA/ASIC Design Engineer Silicon Engineering USD 120k - 170k Irvine, CA
Build Engineer USD 95k - 130k Hawthorne, CA
Software Engineer USD 152k - 228k Mountain View, CA
Executive Assistant to the CTO and CPrO USD 100k - 120k New York, NY, Remote Hybrid
Lead Engineer USD 148k - 175k Ireland, US, Remote, Kansas City, MO
Director of UI Engineering USD 174k - 261k San Francisco, CA
Data Scientist USD 86k - 267k Boston, MA, Remote
Data Scientist USD 99k - 300k New York, NY, Remote
AI Engineer USD 118k - 300k Remote, New York, NY
AI Engineer USD 102k - 287k Boston, MA, Remote
AI Systems Performance Engineer USD 126k - 210k US, San Jose, CA
Software Engineer USD 160k - 225k San Francisco, CA, New York, NY
Software Engineer USD 177k - 252k San Francisco, CA
Software Engineer I USD 70k - 157k US, Remote
Distributed Systems Engineer L4 USD 170k - 720k Los Gatos, CA
Data Engineer L5 USD 170k - 720k Los Angeles, CA
Technical Support Engineer USD 111k - 135k New York, NY, Remote, US, San Francisco, CA
Product Quality Engineer USD 115k - 130k San Francisco, CA
Hardware Product Strategy USD 161k - 314k Redmond, WA, US, Austin, TX, Raleigh, NC, Sunnyvale, CA
Software Engineer II USD 94k - 198k US, Redmond, WA
Azure Customer Engineer USD 81k - 174k Atlanta, GA, US
Software Engineer II USD 98k - 208k US, Redmond, WA
Data Processing Unit Build USD 117k - 250k US, Santa Clara, CA
Data Analyst II USD 66k - 128k Vancouver, British Columbia, Canada, British Columbia
Director, New Technology Engineering- Storage Platforms USD 133k - 282k US, Redmond, WA
Data Engineer II USD 98k - 208k US, Redmond, WA
Software Engineer II USD 98k - 208k US, Redmond, WA
Software Engineer II USD 98k - 208k US, Redmond, WA
Test Systems Design USD 85k - 116k US, El Segundo, CA
Mid-level Cloud Software Engineer USD 112k - 151k US, Remote Hybrid
Experienced Full Stack Software Developer USD 105k - 152k US, Seattle, WA, Berkeley, CA, Remote Hybrid, Mesa, AZ
Experienced Data Scientist USD 113k - 164k US, Seattle, WA, Remote Hybrid
Entry-Level Software Engineer USD 62k - 74k US, Berkeley, CA, Remote Hybrid
Composites Materials USD 102k - 169k US
Lead Static Timing Analysis STA Engineer USD 126k - 171k US, El Segundo, CA
Salesforce Developer USD 90k - 140k Sacramento, CA, Remote Hybrid
Lead Java Developer USD 120k - 180k Foster City, CA
Full Stack Engineer III USD 121k - 187k Remote
Applied ML Engineer USD 140k - 240k San Francisco, CA
submitted by EchoJobs to CodingJobs [link] [comments]


2024.05.19 06:58 tfosnip CS50W - Proj4 Network - Django doesnt recognize my JS code at all

I've double checked the following:
I've put down several triggers inside this JavaScript code yet none of them run.
Newlikes.js:
console.log("newlikes.js is loaded"); document.addEventListener('DOMContentLoaded', function() { console.log("DOM fully loaded and parsed"); document.querySelectorAll('button[id^="like_button_"]').forEach(button => { button.addEventListener('click', function() { console.log("clicked!") let postId = this.id.split('_')[2]; let userId = this.dataset.userId; let likeCountElement = document.querySelector("#like_count_" + postId); let likeButton = this; fetch('/like/' + postId + '/', { method: 'POST', body: JSON.stringify({ 'user_id': userId }), headers: { 'Content-Type': 'application/json', 'X-CSRFToken': document.querySelector('input[name=csrfmiddlewaretoken]').value } }) .then(response => response.json()) .then(data => { if (data.like_status) { likeButton.style.backgroundColor = 'grey'; likeCountElement.textContent = parseInt(likeCountElement.textContent) + 1; } else { likeButton.style.backgroundColor = 'red'; likeCountElement.textContent = parseInt(likeCountElement.textContent) - 1; } }); }); }); }); 
my index.html code:
{% extends "network/layout.html" %} {% load static %} {% block body %} 
{% if user.is_authenticated %}

Create New Post

{% csrf_token %}
Image Link Url:

{% endif %}
{% comment %} list of posts for people that users follow {% endcomment %}
{% if user.is_authenticated %} {% for post in page_obj %}
    {{post.user}}

    {{post.new_post_content}}
    Posted on: {{post.created_time}}
    {% csrf_token %} {{post.liked_by.count}}

{% endfor %} {% endif %}
{% endblock %} {% block script %} {% endblock %}
and my settings.py:
""" Django settings for project4 project. Generated by 'django-admin startproject' using Django 3.0.2. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '13kl@xtukpwe&xj2xoysxe9_6=tf@f8ewxer5n&ifnd46+6$%8' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'network', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'project4.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'project4.wsgi.application' # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } AUTH_USER_MODEL = "network.User" # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), '/network/project4/network/static', ] 
my folder structure looks like this:
https://preview.redd.it/00fdiiqidb1d1.png?width=256&format=png&auto=webp&s=48028d2103a8f7d3ec2a181da3193518a45aabf4
I've been stuck on this project for half a week now because I thought my JS code was bugged, and only until today I added more triggers and realized it wasn't run at all...... (I have 2 more earlier versions of js code in the same folder but none of them are quoted anywhere so I assume this isn't a problem)
I truly really appreciate anyone's help to get out of this brain prison!! I used 120% of my brain and I am still 100% clueless rn :P
submitted by tfosnip to cs50 [link] [comments]


2024.05.19 06:43 pbjclimbing Rytr Coupon: Get 30% Off Your Monthly Subscription

Rytr Coupon: https://rytr.me/?via=pbjclimber and enter coupon STARTRYTING
Rytr is an AI writing assistant that can help you create high-quality content quickly and effortlessly. Whether you're a blogger, marketer, or content creator, Rytr can assist you in generating ideas, drafting articles, and polishing your writing.
By using the Rytr coupon code STARTRYTING, you can get a 30% discount on a monthly Rytr subscription. This is an excellent opportunity to try out Rytr's powerful features and see how it can streamline your content creation process. The Rytr coupon allows you to access the app's full suite of tools, including the AI-powered blog post generator, tone and style customization, and a wide range of templates.
With the Rytr coupon, you can experience the seamless product experience and high-quality output that Rytr is known for. The app's intuitive interface and user-friendly features make it easy to create compelling content in a fraction of the time it would take to do it manually. Whether you're writing blog posts, social media captions, or marketing copy, the Rytr coupon can help you save time and money while producing exceptional results.
Don't miss out on this opportunity to get 30% off a Rytr subscription with the coupon code STARTRYTING. Try Rytr today and see how it can transform your content creation workflow.
submitted by pbjclimbing to ReferralsDeals [link] [comments]


2024.05.19 06:37 Arderio Some people are out of their mind

Some people are out of their mind
https://preview.redd.it/xp0snmpoab1d1.jpg?width=1920&format=pjpg&auto=webp&s=aa90110bfe7c478835d8ada1213efcbf4eb0b913
We start a siege mission and one of us drop on a the first generator, he kill himself and go for the second one, result? Failed mission. After that he open his mic saying "you can't report me, you can only report for chat things" and then he leaves. I'm speechless
submitted by Arderio to Helldivers [link] [comments]


2024.05.19 06:31 regnartson VHS patch I made

Line Selector
Vibrato
Drive Echo
Bit Crush
BendCho
You can also apply the code via this link: f05200612840210000020000000032000000000000000000000010000050040c1001000000000000000000000000000102004c012c00003250400600000000000000000102000010001801000000401100100000400000002100000e010408000b5040070001000000000000210002000c032c002300006020050000000800000040190f56004853202020202000202000f7
Basically tweaked a Generation Loss patch and added the bending chorus. Sounds especially bizarre with fuzz. Have fun!
submitted by regnartson to zoommultistomp [link] [comments]


2024.05.19 06:08 muzso User manual as a PDF

This is my first shot at this. My original goal was to just create a local copy that can be used in a browser even if your offline, but u/olegccc's comment in https://www.reddit.com/ex30/comments/1cv3v2t/pdf_user_manual/ gave me the idea to generate a PDF from it.
It's already pretty usable, but still more like a proof-of-concept, than a polished end result.
The PDF was created with the following steps:
  1. Download a copy (local mirror) of the online manual. I used wget for now, but it's far from perfect (the mirroring process is quite error prone).
  2. Process/modify the downloaded copy so it doesn't reference www.volvocars.com. I.e. make the copy self-contained, so it works even if offline.
  3. Remove all JavaScript. This was easier than to solve the issues with burned-in hostnames and/or absolute URLs. For a PDF the JS code is not needed anyway.
  4. Test in browsers via a local HTTP server (actually I just used Python's built-in HTTP server).
  5. Generate a new "index-single-page.html" by using the start (mostly the ) from index.html, then adding the contents of the tags from all pages (index.html, software-release-notes, article/*).
  6. Add CSS page breaks between all pages, this makes the PDF more readable.
  7. Close the HTML (i.e. add a "").
  8. Open the new "index-single-page.html" page in a browser and save as PDF.
I've created two versions of the PDF from the same HTML source. One with Firefox and one with Chrome.
Both are based on a snapshot of the UK user manual, saved on 2024-04-29.
Known issues:
  1. I've inserted page breaks before every manual page, but Firefox doesn't honor the first one (i.e. the one between the ToC and the "Software updates" pages). Chrome has no such issue.
  2. There're a number of mp4 movie files in the manual, which the PDF rendering simply left empty (blank space). Later I'll take snapshots of these mp4 files and replace the video elements with them.
  3. A couple of images are missing. I used wget to create a local mirror of the manual and there were some issues, it's not very robust, especially when volvocars.com starts to throttle the download (i.e. starts to send HTTP 4xx responses after a couple of hundred requests). Wget is not great at continuing an aborted mirroring session either. I'll try to look for a better tool for mirroring/saving the online manual.
Let me know what you think, what other issues/bugs you find, etc.
submitted by muzso to ex30 [link] [comments]


2024.05.19 06:01 SelectionOptimal7348 🌴 Create Your Own Bitcoin Paradise with Our Bitcoin QR Code Generator API! 🌴

🌴 Create Your Own Bitcoin Paradise with Our Bitcoin QR Code Generator API! 🌴
bitcoinqrcodemaker.com
Welcome to the golden age of digital finance! If you've ever dreamt of creating your own Bitcoin paradise, you're in the right place. In this article, we're going to take you on a thrilling journey through the wonders of our Bitcoin QR code generator API. By the end, you'll be ready to revolutionize your crypto transactions and bring your Bitcoin dreams to life. So, buckle up and let's dive in! 🚀

The Magic of Bitcoin QR Code Generator API

Imagine this: you're lounging on a tropical beach, sipping a piña colada, and seamlessly managing your Bitcoin transactions. Sounds like a dream, right? Well, with our Bitcoin QR code generator API, this dream is closer to reality than you think. Our QR code generator API makes it ridiculously easy to create and share Bitcoin QR codes, making your transactions smooth, fast, and hassle-free.

Why QR Codes and Bitcoin Are a Match Made in Heaven

Bitcoin, the king of cryptocurrencies, has always been about decentralization and ease of use. But let’s face it, sometimes the process can be a bit clunky. Enter QR codes – those little black and white squares that are about to become your new best friends. Here's why:
  1. Speedy Transactions: With our Bitcoin QR code generator API, you can generate QR codes that allow for instant transactions. No more waiting around for confirmations or copying long addresses.
  2. Enhanced Security: QR codes reduce the risk of human error. When you use a QR code, you’re less likely to make a mistake compared to typing out a long Bitcoin address.
  3. User-Friendly: Even your grandma can use a QR code! They’re incredibly easy to generate and use, making Bitcoin accessible to everyone.

How to Get Started with Our Bitcoin QR Code Generator API

Getting started with our QR code generator API is easier than you might think. Follow these simple steps, and you'll be on your way to creating your Bitcoin paradise:
  1. Sign Up: Head over to BitcoinQRCodeMaker.com and sign up for an account. Trust us, it’s quicker than finding a seashell on the beach.
  2. Generate API Key: Once you’re in, generate your API key. This key is your gateway to the endless possibilities of our Bitcoin QR code generator API.
  3. Integrate the API: Use our easy-to-follow documentation to integrate the API into your website or app. If you can handle a beachball, you can handle this.
  4. Create QR Codes: Start generating QR codes for your Bitcoin transactions. Whether you’re sending, receiving, or just showing off to your friends, our QR code generator API has got you covered.

Creating Your Bitcoin Paradise: Use Cases and Ideas

Now that you’re equipped with the ultimate tool, let’s explore some fun and creative ways to use our Bitcoin QR code generator API to create your own Bitcoin paradise:

1. Bitcoin Beach Bar

Imagine a beach bar where all transactions are done using Bitcoin QR codes. No more fumbling with cash or cards – just scan and sip! 🏖️🍹

2. Crypto Concerts

Organize concerts where attendees can buy tickets, merchandise, and snacks using Bitcoin QR codes. Keep the vibes going without the hassle of traditional payments. 🎤🎸

3. Bitcoin Bazaar

Create a marketplace where vendors accept Bitcoin through QR codes. From handmade crafts to exotic foods, make transactions as smooth as the ocean breeze. 🛍️🌊

4. Charity Events

Host charity events where donations are made via Bitcoin QR codes. Instant, transparent, and secure – giving back has never been easier. ❤️🌍

5. Personal Use

Even if you're not running a business, you can use our Bitcoin QR code generator API to make your personal transactions a breeze. Send and receive Bitcoin with friends and family effortlessly. 👫💸

Tips and Tricks for Using Our QR Code Generator API

To make the most of our Bitcoin QR code generator API, here are some pro tips:

Keep It Secure

Always ensure your API key is kept secure and not exposed to unauthorized users. Think of it as the key to your treasure chest.

Customize Your QR Codes

Our QR code generator API allows you to customize the look of your QR codes. Add a splash of color or a logo to make them uniquely yours. After all, every paradise needs a bit of personal flair.

Monitor Your Transactions

Use our API to keep track of all transactions made with your QR codes. This way, you can monitor your Bitcoin paradise and make sure everything is running smoothly.

Stay Updated

We’re constantly improving our Bitcoin QR code generator API with new features and updates. Make sure to stay tuned to our website and social media channels for the latest news.

Join the Bitcoin Revolution

Creating your own Bitcoin paradise is more than just a dream – it’s a reality with our Bitcoin QR code generator API. Whether you’re a business owner, an event organizer, or just a Bitcoin enthusiast, our QR code generator API will transform the way you handle Bitcoin transactions. So why wait? Dive into the world of seamless, secure, and speedy transactions today.

Spread the Word! 🌍🚀

We believe in the power of the Bitcoin community. If you love our Bitcoin QR code generator API, share the love! Use the hashtags #Bitcoin #Crypto #QRCode #APIs #BTC and let the world know about the awesome possibilities. Together, we can create a global Bitcoin paradise.

Conclusion

In the fast-paced world of cryptocurrencies, staying ahead of the curve is crucial. Our Bitcoin QR code generator API is your ticket to a smoother, more efficient Bitcoin experience. So, whether you're relaxing on a beach or running a bustling business, our QR code generator API has got your back.
Ready to create your Bitcoin paradise? Visit BitcoinQRCodeMaker.com and start your journey today. 🌴✨💸
Remember, the future is digital, and with our Bitcoin QR code generator API, you’re already ahead of the game. Happy scanning! 🌟🔗
submitted by SelectionOptimal7348 to BitcoinQR [link] [comments]


2024.05.19 05:01 techfl12 14700 65w TDP Build for CS grad

Posting for my daughter who recently graduated from university and she wants to build her first pc. Up until now she's been using mobile tablet/laptop device with 3060 GPU. She's not a big gamer but does enjoy Minecraft and mods and wants to move to a desktop. Her specific mods work best with Nvidia GPU so that is a core requirement.
Beyond gaming on this build she will be doing some coding/compiling, maybe some 3D modeling/rendering stuff, etc. Her preferences are quiet (doesn't need to be "Silent" but aiming for not noisy, and prefer not to hear fans ramping up/down all the time). I'd prefer it not to be a power hog, efficiency is a preference of mine nothing extreme but leaning on quiet vs noisy and willing to spend a little extra to that end. Water cooling is something I do NOT want to mess with at this time. We will probably pair the build with 2x 27" QHD 144Hz monitors but they do not need to be spec'd out here.
Budget is ~$16xx all core elements (CPU, MB, RAM, Storage, GPU, Case, PSU, etc). We don't need to budget the peripherals, OS License, nor monitors. I prefer no-rebates in the budget. Budget is flexible within reason. We live in USA but nowhere near a Microcenter (maybe one coming later this year but not an option otherwise).
I am agnostic on AMD vs Intel, I personally run AMD but she's been using Intel for a few years so my first pass I've gone that route. 14700 Build
---Why I made some choices---
CPU: Picked Intel 14700 since it's 65W TDP and 20cores for $399. I figure it'll be fine for all above and should run a little more efficiently than the 14700K but perhaps that's simply a bios option in the K series to make it run at 65W TDP instead of 125W (I need to research)?
Motherboard: Picked MSI because I've had good luck lately with them. I'm open to other options but definitely want latest chipset for DDR5 and 4 memory slots for expansion later if desired. Don't need tons of fancy stuff, don't need many PCIe slots. Having more than one NVME is desired. Wifi is preferred but we'll run 1Gb ethernet to her room for this project.
GPU: Went with 4070 for extra RAM and approx price point. Otherwise could be swayed to go +/- depending on folks input here. Again, AMD series GPU's are not an option for this build.
Case: I picked one with RGB / Glass Panel and an optional Optical Disc drive spot. She wants to fool around with some old games we have on CDROM and while I can connect a USB Drive I figure having the option for an internal one will make her happy. I like a case that's easy to work in/on, doesn't feel flimsy, and cools efficiently. Otherwise I'm flexible here.
Storage: Definitely an NVME Drive, 2TB preferred. I prefer one with DRAM/onboard cache. Prefer reputable brand and reliability, but recognize that changes so open to options here. Might add a second NVME down the road. I've had good luck with samsung and AData but recognize both have had some models with issues in the past.
PSU: Prefer 80+ Gold and Quality here. Name brands/reliability preferred over saving a few bucks. Don't imagine we'll be upgrading to an 80 or 90 series GPU so don't think we'll need more power now. I like the modular ones.
--- Thanks for any feedback!!! ---
PCPartPicker Part List
Type Item Price
CPU Intel Core i7-14700F 2.1 GHz 20-Core Processor $369.55 @ Newegg
CPU Cooler ID-COOLING SE-214-XT 68.2 CFM CPU Cooler $17.98 @ Amazon
Motherboard MSI PRO Z790-VC WIFI ATX LGA1700 Motherboard $159.99 @ MSI
Memory TEAMGROUP T-Force Vulcan 32 GB (2 x 16 GB) DDR5-6000 CL38 Memory $91.99 @ Amazon
Storage Samsung 980 Pro 2 TB M.2-2280 PCIe 4.0 X4 NVME Solid State Drive $169.99 @ Amazon
Video Card MSI VENTUS 2X OC GeForce RTX 4070 12 GB Video Card $549.99 @ B&H
Case Fractal Design Pop Air RGB ATX Mid Tower Case $89.99 @ B&H
Power Supply MSI MAG A850GL PCIE5 850 W 80+ Gold Certified Fully Modular ATX Power Supply $89.99 @ Newegg
Prices include shipping, taxes, rebates, and discounts
Total $1539.47
Generated by PCPartPicker 2024-05-18 23:03 EDT-0400
submitted by techfl12 to buildapc [link] [comments]


2024.05.19 04:52 Ashamed-Draw2585 NDVI imaging using python

Hi
I am trying to create code in python that takes an image from an multispectral camera, then does geometric, atmospheric correction and radiometric correction to then generate NDVI maps for use of crop analysis from pictures taken from a multispectral camera using a UAV. Would anyone have any tips on how I could do this.
Thanks
submitted by Ashamed-Draw2585 to learnpython [link] [comments]


http://activeproperty.pl/