Elder Moderator

[email protected]

Total likes received: 79 | Pubby Cash: 843


Evan is a person who does coding. He codes with Python and watches videos of bootstrap. That's it.

Articles Liked by Me: 53

Mapping IP addresses to Geographic Locations in Python

Categories: Tech | Pubby Cash Received:  0

An IP address - a list of four segments of 3 digits numbers between 0 and 255 and connected by dots can contain more information than you think. Underneath this article, you can see where this article is posted from. This gives you an example that an IP address can be transformed to the geographical location. I'm introducing one way to realize it in Python - use API from ipinfo.io. Their free version can give the geographic location, ISP provider's name, and even GPS coordinates of the location, which should be enough for most website owners. Their API include a token, which is good for querying 50,000 times a month. The following code can be used as an example. Remember to replace the ip and token with your ip and token. import requests, json link = f'https://ipinfo.io/{ip}?token={token}' r = requests.get(link) content = json.loads(r.content) print(content) ...  Read more

Methods of Converting a String of Numbers Separated by Commas to a List of Numbers in Python

Categories: Tech | Pubby Cash Received:  10

When coding in Python, free conversion of different data types is a skill that one must master. Today, let's talk about one scenario: here is a a string of numbers separated by commas: numb_str = '1,2,3,4,5' You need to convert it to a list like this: [1,2,3,4,5]. How would you do this? There are multiple ways: Method 1: numb_str = '1,2,3,4,5' numb_str_list = list(numb_str) # Destruct all elements print(numb_str_list) # Result: ['1', ',', '2', ',', '3', ',', '4', ',', '5'] numb_list = [] # Build an empty list for item in numb_str_list: # loop over the list     if item.isdigit(): # check if an item is a number         numb_list.append(int(item)) # if yes, convert it to an integer and then append to the list print(numb_list) # Result: [1, 2, 3, 4, 5] Method 2: numb_str = '1,2,3,4,5' numb_str_list = numb_str.split(',') # Extract the element from the string except the comma print(numb_str_list) # Result: ['1', '2', '3', '4', '5'] numb_list = [] # Build an empty list for item in numb_str_list: # loop over the list     numb_list.append(int(item)) # convert it to an integer and then append to the list print(numb_list) # Result: [1, 2, 3, 4, 5] Method 3: numb_str = '1,2,3,4,5' numb_str_list = numb_str.split(',') # Extract the element from the string except the comma print(numb_str_list) # Result: ['1', '2', '3', '4', '5'] numb_list = [int(item) for item in numb_str_list] # A concise way of doing method 2 print(numb_list) # Result: [1, 2, 3, 4, 5] Of the three methods, which one do you like best? ...  Read more

What's the difference between MySQL and SQLite?

Categories: General, Tech | Pubby Cash Received:  0

MySQL and SQLite are probably the most famous decisions for information the executives. SQLite is record based — the database comprises of a solitary document on the circle, which makes it amazingly versatile and solid. Although it may seem like a "straightforward" DB usage, SQL is utilized in SQLite. SQLite is intended to be incredible for both creating and testing and offers more than what is required for improvement. When To Use SQLite: - Embedded applications: SQLite is an extraordinary decision of database for applications that need transportability and doesn't require future development. Models incorporate single-client neighborhood applications and versatile applications or games. - Disk get to substitution: In situations where an application needs to peruse and compose records to plate legitimately, it very well may be gainful to utilize SQLite for the extra usefulness and straightforwardness that accompanies utilizing SQL. - Testing: For some applications, it tends to be needless excess to test their usefulness with a DBMS that utilizes an extra server process. SQLite has an in-memory mode that can be utilized to run tests rapidly without the overhead of genuine database tasks, settling on it a perfect decision for testing. Then again, MySQL is exceptionally simple to work with. For example, it tends to be effortlessly introduced, outsider devices make it a straightforward database to begin with, and it's improved with highlights. It bolsters a great deal of SQL usefulness that is normal from an RDBMS. MySQL is made sure about, which makes it exceptionally progressed, as well. It can even deal with a decent measure of information and subsequently can be utilized at-scale. Most definitely, MySQL works productively and adequately. When To Use MySQL: - Distributed tasks: MySQL's replication bolster settles on it an incredible decision for appropriated database arrangements like essential optional or essential structures. - Websites and web applications: MySQL powers numerous sites and applications over the web. This is because it is so natural to introduce and set up a MySQL database, just as its general speed and adaptability over the long haul. - Expected future development: MySQL's replication backing can help encourage flat scaling. Moreover, it's a moderately clear procedure to move up to a business MySQL item, as MySQL Cluster, which underpins programmed sharding, another level scaling process....  Read more

Machine Learning at the Intersection of Artificial Intelligence and Data Mining

Categories: Tech | Pubby Cash Received:  0

Artificial Intelligence (AI), Machine Learning (ML), and Data Mining (DM) are very fancy words nowadays in technology fields. But do you know the differences between these terms? They are all dedicated to the transformation of data to usable knowledge and support decisions. In other words, almost all disciplines will need them. AI is a broad term for using either data or knowledge to offer solutions to existing problems that require some search or reasoning. ML is a specific subarea of AI that offers procedures learning from data. DM, is the an interdisciplinary field to discover patterns in large data sets and subsumes both ML, statistical modeling, or visualization disciplines. The following figure gives you an idea about the relationship of the three terminologies, and the bracketed numbers in the figure denote the number of papers dealing with these technologies in the water and wastewater sectors, respectively, according to Hadjimichael et al. in a paper published in 2019. With regard to the specific methods within the water and wastewater fields, artificial neural network is the most popular method followed by clustering. There are huge potentials for further exploration, as the encapsulation of ML into functional decision support system is not fully investigated. This is because: (1) there is a lack of an association between the fields of water engineering and computer engineering; (2) most ML techniques were adopted by academics with limited practical experience; (3) ML techniques are inherently multi-disciplinary and combined with problems of great complexity facing water and wastewater systems; and (4) there is a lack of user-friendly interfaces and support after product delivery. With that said, I'm working on an integration of machine learning into my discipline of water and wastewater treatment. Sound promising?...  Read more

This is how you solve problems

Categories: General, Tech | Pubby Cash Received:  0

So I solved the buttons problem in the GoPubby app, well kind of. There is still a bug where the logout button does not work. Additionally, content for some longer posts is cut off from the top of the screen. So how exactly did I solve the buttons problem? First, let me tell you what the problem was. So 15 to 20 titles of recent posts from the GoPubby website were displayed as scrollable buttons. When I click on one of the posts, it should transition to a page with only that post and its content on it. However, when I did it, I gave me many errors, such as 'NoneType object does not have attribute text' or something like that. I knew the answer lied within object properties, so I queried many websites and watched many YouTube videos so I could get a better understanding. Tech with Tim was a great help. Using his code, I added to my object property and tried it. It worked. But why didn't it work for me? I think the answer lies in the type of class that I had defined. In my class, there was an 'init' function with the 'super()' constructor. When inheritance is involved, the Python 'super()' function allows us to refer the superclass implicitly. So, Python super makes our task easier and comfortable. While referring to the superclass from the subclass, we don’t need to write the name of the superclass explicitly. It's kind of like when you want to import a module, you could either use 'import' or you could use 'from this import that'. I don't understand why the 'init' function caused my object property to mess up, but by using someone else's code, I got a new perspective and the data successfully got passed into the app. I'm still toying around with what Kivy can do....  Read more

1 2 3 4 ... 11

Daily Deals


MECHANICSBURG WEATHER