Member

[email protected]

Total likes received: 98 | Pubby Cash: 932


Articles Liked by Me: 87

Effectively Using APIs

Categories: Tech | Pubby Cash Received:  0

There's a product you want really bad, but it's sold out. And every time it becomes available again, you're always too late. Sounds like you need to do some coding that will track that website and whenever that product becomes available, your code will email you, letting you know. But doing so isn't that straightforward, as popular websites know this and will block you from scraping their data. That's when you turn to their API (or application programming interface). Most popular websites provide you with an API key which you can use in your code to query their data. However, there is a catch. Websites do not like programs (like the one you're going to make) that repeatedly access their website. It gets annoying very fast because that website has to serve other people and programs, not only you. So when such occurs, the website will block you yet again, saying that you have gone over the limit. This is why it is important to continuously monitor and revise your code so there aren't any uncontrolled infinite loops, for example. APIs are hosted on web servers. When you type www.google.com in your browser’s address bar, your computer is asking the www.google.com server for a webpage, which it then returns to your browser. Now when you want to track the price of a product, of course, you're not going to do that! You would write a neat program that does all of the tiring work for you. This data is usually returned in JSON format, but it can come in other formats too. To get the data, you have to request a web server. The server then replies with our data. Let's say you want to track the price of a motherboard you want on Amazon. First, you would need to create an AWS account and activate your Marketplace subscription. Once you get your API keys from there, it's time to use them. We are going to do this using Python. Pop open your Terminal or Command Prompt and type 'pip install amightygirl.paapi5-python-sdk' or 'pip3 install amightygirl.paapi5-python-sdk' to install the API package. Then, use the following Python 3 code and fill in the appropriate blanks with your API keys. In this example, we are searching for products with the name "Harry Potter" on it. Click this link to view the code for this program on GitHub....  Read more

Building a PC: Choosing the Right Power Supply

Categories: Tech | Pubby Cash Received:  0

It's always a pain when settling on a power supply, especially when it's the first time building a PC. There is no correct way or path to take when it comes to buying a power supply, but these helpful tips could save you some cash or preventing another trip to your nearest Micro Center. Buy a power supply from a reputable manufacturer, and look for reviews of it before you buy it. Corsair, Seasonic, and Antec are three manufacturers with reputations for producing high-quality power supplies, though even they may offer a few duds among all the studs. You don't want your PC to malfunction just because of some crappy PSU you picked up for 40 bucks. It is also important to understand the wattage rating of your power supply. If the maximum power of your combined system’s parts is 300 watts, a 600-watt PSU would be a good fit. Now if you have higher-ended components in your PC, maybe a 1200-watt PSU would work better in this case. You can get by with lower-capacity units if you don't think you'll ever need to extend your framework, but if you can afford it, choosing a higher-capacity PSU is a better bet. Another consideration is cabling. Power supplies are available with hard-wired cabling, with partially modular cabling, or with fully modular cabling. In modular power supplies, you can add or remove cabling from the PSU as needed to avoid case clutter. Make sure that your power supply provides you with everything you need to power your PC. That includes sufficient PCIe cables, plenty of SATA connectors, maybe some MOLEX wires, and all of the other necessities. With a well-functioning and satisfactory power supply doing its job in the computer case, there's no need to stress about explosions or smoke in your office....  Read more

The Algorithm to Create a Crossword Game Using Python.

Categories: Tech | Pubby Cash Received:  0

Do you know the algorithm to make a crossword puzzle using Python? If you do not know how, then you should read this article because it will teach you how. We will make two arrays one of them has the correct answers while the other one has the letter O to replace the words. Here is the code. added_words_count = 0# make a variable equal to zero def add_word(word,arr): #this function adds the horizontal words to the cross word     global added_words_count#global that variable that was made     row=random.choice(lst)#take a random row to put the word in     lst.remove(row)# remove it so it does not repeat     col=random.randint(0,15-len(word))# choose a random column to put the word in     addhword = True#set this variable to true for adding horizontal words     count = 0#set count to zero     rand_num = random.randint(0,1)# randomly choosing 1 or 0 to decide if the word goes from right to left or left to right.     if rand_num == 0:if the random number is zero         word1 = word[::-1]# make it backwards     else: # if the random number is not zero         word1 = word# keep it the same     for i in range(0,len(word1)):# print i         arr[row,col+i]=lett2num[word1[i]]     added_words_count += 1 #add one to the added_words_count variable     print('added horizontal')# print added horizontal to know how many words you added were horizontal def add_word1(word,arr):# this function is for adding vertical words     global added_words_count# global the added_words_count variable     addvword = True# set adding vertical words to true     rand_num = random.randint(0,1)# randomly choosing 1 or 0 to decide if the word goes from right to left or left to right.     if rand_num == 0:if the random number is zero         word1 = word[::-1]# make it backwards     else: # if the random number is not zero         word1 = word# keep it the same     def adding_v_word():# make another function for adding         completely_empty = True# set the completely empty variable to true         col=random.choice(lst)# lst.remove(col)         row=random.randint(0,15-len(word))# choose a random row to put the word in         ready = False# set the variable ready to false         for i in range(0,len(word1)):print i             if arr[row+i,col] != 0:# if it is not equal to zero                 completely_empty = False# the completely empty variable is equal to false                 addvword = False# also, adding a vertical word would be false                 # if the letter in this square is the same as the one we're adding                 if arr[row+i,col] == lett2num[word1[i]]:# if it is equal                     addvword = True# adding vertical word is true                     ready = True# also ready is true                 else:if that is not true                     addvword = False # both are false                     ready = False                     break # use break method         return row, col, ready, completely_empty# return the variables     while True:# while that is true         row, col, ready, completely_empty = adding_v_word()# those variables equal adding_v_word()         if ready or completely_empty:# if ready or completely_true are true             for i in range(0,len(word1)):# print i                 arr[row+i,col]=lett2num[word1[i]]             print('just added another vertical') # print this so you know when you added a vertical word             added_words_count += 1             break def display_arr(arr):# this function is for displaying the array     for row in range(0,15):# for the row in the range of 0 to 15         line=""# set line to an empty string         for col in range(0,15):# for the column in the range of 0 to 15             line = line + num2lett[(arr[row,col])] + " "# set line to line plus the num2lett plus an empty string         print(line)# print line     print()# print...  Read more

How to Make Diagonal Words and Making them Backwards Using Python

Categories: Tech | Pubby Cash Received:  0

Do you know the algorithm to make a crossword puzzle using Python? If you do not know how, then you should read this article because it will teach you how. We will make two arrays one of them has the correct answers while the other one has the letter O to replace the words. Here is the code. added_words_count = 0# make a variable equal to zero def add_word(word,arr): #this function adds the horizontal words to the cross word     global added_words_count#global that variable that was made     row=random.choice(lst)#take a random row to put the word in     lst.remove(row)# remove it so it does not repeat     col=random.randint(0,15-len(word))# choose a random column to put the word in     addhword = True#set this variable to true for adding horizontal words     count = 0#set count to zero     rand_num = random.randint(0,1)# randomly choosing 1 or 0 to decide if the word goes from right to left or left to right.     if rand_num == 0:if the random number is zero         word1 = word[::-1]# make it backwards     else: # if the random number is not zero         word1 = word# keep it the same     for i in range(0,len(word1)):# print i         arr[row,col+i]=lett2num[word1[i]]     added_words_count += 1 #add one to the added_words_count variable     print('added horizontal')# print added horizontal to know how many words you added were horizontal def add_word1(word,arr):# this function is for adding vertical words     global added_words_count# global the added_words_count variable     addvword = True# set adding vertical words to true     rand_num = random.randint(0,1)# randomly choosing 1 or 0 to decide if the word goes from right to left or left to right.     if rand_num == 0:if the random number is zero         word1 = word[::-1]# make it backwards     else: # if the random number is not zero         word1 = word# keep it the same     def adding_v_word():# make another function for adding         completely_empty = True# set the completely empty variable to true         col=random.choice(lst)# lst.remove(col)         row=random.randint(0,15-len(word))# choose a random row to put the word in         ready = False# set the variable ready to false         for i in range(0,len(word1)):print i             if arr[row+i,col] != 0:# if it is not equal to zero                 completely_empty = False# the completely empty variable is equal to false                 addvword = False# also, adding a vertical word would be false                 # if the letter in this square is the same as the one we're adding                 if arr[row+i,col] == lett2num[word1[i]]:# if it is equal                     addvword = True# adding vertical word is true                     ready = True# also ready is true                 else:if that is not true                     addvword = False # both are false                     ready = False                     break # use break method         return row, col, ready, completely_empty# return the variables     while True:# while that is true         row, col, ready, completely_empty = adding_v_word()# those variables equal adding_v_word()         if ready or completely_empty:# if ready or completely_true are true             for i in range(0,len(word1)):# print i                 arr[row+i,col]=lett2num[word1[i]]             print('just added another vertical') # print this so you know when you added a vertical word             added_words_count += 1             break def display_arr(arr):# this function is for displaying the array     for row in range(0,15):# for the row in the range of 0 to 15         line=""# set line to an empty string         for col in range(0,15):# for the column in the range of 0 to 15             line = line + num2lett[(arr[row,col])] + " "# set line to line plus the num2lett plus an empty string         print(line)# print line     print()# print...  Read more

So many MSI boards

Categories: Tech | Pubby Cash Received:  0

When buying a motherboard, it is important to choose the right brand and size that will suit your needs, as you may already know. MSI makes great, durable, and sleek boards. Upon searching popular motherboards on the web, three main types. Those are the MEG, MPG, and MAG. First, with the MEG models, the motherboards are designed mainly for enthusiasts, and you can remember that with the "E" meaning "excellent". These boards are top-notch and are MSI's flag-shipped products. Next, the MPG series is built for performance, with the "P" standing for "performance". These boards will have mainstream gaming features, along with aesthetic combined. Lastly, the MAG boards are their arsenal series. These focus on functionality so they are often cheaper. Now with all of the series clarified, it is obvious that the MEG is the way to go for serious people like me. Let's say you decide to buy the MEG Z490 modal, which is a good choice, but even that modal has smaller sub-modals. We'll compare the Godlike to the Unify. Both are MEG Z490 models, but their prices undergo a huge change (former being $750+ and latter being $270+). Why? There are many reasons. The Godlike features more high-speed ports (with two Thunderbolt 3 ports) while the Unify has none. Moreover, the Godlike has more memory support along with a speaker. Additional diagnostics include 2-Digit Debug LED, BIOS Selection, Clear CMOS, Power, Reset, ReTry, Safe Boot, and Slow Mode. I think the $750+ motherboard is overkill considering my usage. The Godlike is for extreme gamers or professional video editors. There is also a $400 modal which is also a MEG Z490 called the ACE. It boasts of 2.5G LAN and Gigabit LAN and has most of the Godlike's statistics. It lies in between the Unify and the Godlike. So which one is the best? It depends on your interests and budget. For me, I think the middle class would work for me. A $400 ACE should be capable of handling all of my processes and tasks....  Read more

1 ... 4 5 6 ... 18

Daily Deals


MECHANICSBURG WEATHER