Articles of the Week

Pubbies of the Week

Lists, Tuples, and Sets—When to Use Which?

Categories: Tech | Pubby Cash Received:  0

A data structure that stores an ordered collection of items in Python is called a list. In other words, a list holds a sequence of items. A list can have any number of elements and different data types. Moreover, a list can have another list as an element. Such a list is known as a nested list. Use lists whenever there is data that will change. Since lists are mutable, it is easy to replace an existing value or insert a new value into a list. Tuples, on the other hand, are the same as lists with the only difference being their inability to be modified. A tuple is stored exactly as it is. If you want to change a value in a tuple, you would have to create a new one. Tuples are used in scenarios where it is certain that the set of values belonging to some statement or a user-defined function will not change. Finally, a set is an unordered collection of simple objects in Python. In addition to being iterable and mutable, a set has no duplicate elements. Any set defined in Python is an instance of the set class. Compared to a list, a set is advantageous by having a highly optimized method for checking whether some element is contained in the set or not. Want more practice but don't know where to go? Amazon has this great book that allows you to problem solve with algorithms and data structures using Python. You should check it out! ...  Read more

The Magic Keyboard

Categories: Tech | Pubby Cash Received:  0

The magic keyboard is a keyboard that can do many things that other keyboards can not do. This keyboard is made by Apple and is wireless. Instead of using a nanochip, it uses Bluetooth to connect to your computer. It is white and has a very sleek design. Furthermore, it has extremely long battery life. Finally, it is small and easy to carry. That is the magic keyboard, by Apple. ...  Read more

WebMail client

Categories: Tech | Pubby Cash Received:  0

It is weird that nearly all WebMail applications such as RoundCube, Horde, Squirrel Mail, etc. are written in PHP. I've been looking for an application written in Python, and am only able to find one - MailPile. Unfortunately, MailPile is only available on Linux system so far. The packages for MacOS and Windows are still under development. I'm wondering why people in the Python community lack interests of developing a WebMail application? It is not difficult to do so after using SMTPLIB and IMAPLIB modules. It should be appealing to people who are running a flask or Django website written in Python. You can simply write one by yourself to realize the sending emails and checking emails functions!...  Read more

Incorporation of javascript, python, SQL, and HTML in website coding

Categories: Tech | Pubby Cash Received:  0

A client sends a request to the server for information via port 80. The server renders HTML codes that will be parsed and displayed at the client end by a browser. That's how the web browsing works. Instead of rendering static HTML codes, dynamic web server is able to do the calculations based on the requests sent from the clients and returns the HTML codes with those calculation results. Compared to static websites, dynamic websites are more advanced, more informative, and more appealing to users. In order to make a website dynamic, a database has to be used with a querying language SQL. The database that python uses is 'SQLite', and there is a module 'SQLAlchemy' that streamlines the coding process for python programmers. Its syntax is different from the conventional SQL syntax, but is more intuitive and easy to use. After client sends a request, a server receives the request, queries the database, obtains the result, and sends back to the client. For the dynamic part (i.e. variables) of HTML that is sent out from the server, it is the coded inside double curly braces {{ }} within HTML, so that when the client browser sees it, it will automatically be interpreted and the stored value will be retrieved. However, this may not work if you would like to pass a variable into a javascript. Javascript can achieve a lot of fancy effects and are indispensable for modern web pages. To do that, the correct syntax should be {{ variable|tojson }}. ...  Read more

This Website Designing Tip Can Be Extremely Beneficial

Categories: Tech | Pubby Cash Received:  0

The overall feeling of a website is much more than just a logo design. While graphics and logos are necessary, the entire website should feel like one big entity. This occurs through matching typography and icons, but also through the choice of colors. All websites start out as a blank canvas capable of possessing many decorating and styling elements. It’s worth examining what other sites have done and how their color scheme matches with the logo and overall site content. Even if you’ve settled on a particular shade of burgundy, you might look into darker shades of red and maroon for other areas. Providing the right balance of colors on your website can lure more viewers and can make the overall content on your website more appealing....  Read more

1 ... 29 30 31 32

Daily Deals


MECHANICSBURG WEATHER