Feeds

Abhijeet Pal: Starting A Django Project

Planet Python - Tue, 2019-03-19 08:11

Django is one of the most popular open source full-stack web development Framework written in Python. Django is a framework for perfectionists with deadlines, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel.

To know more about Django read: Django – Web Framework For Perfectionists

In this article, we will go over the steps for creating and running a Django Project.

Creating A Django Project

A project is a collection of settings for an instance of Django including database configuration, Django-specific options, and application-specific settings.

Before creating a Django project make sure you have Python and Django installed in your machine if not go through How To Install Django

It is recommended to create projects in virtual environments though it’s optional using them will save you from a lot of headaches in the future. Read the following article to know why virtual environments are so important: How To A Create Virtual Environment for Python

Note that, I am assuming that you have activated your virtual environment where your Django installation exists. Next, run the below command.

django-admin startproject mysite

This command will invoke the django-admin.py script, which will set up a new Django project called mysite. A Django project name can be composed of numbers, letters, or underscores. A project name cannot start with a number, it can only start with a letter or underscore in addition special characters and spaces aren’t allowed anywhere in a project name.

You’ll now notice within your workspace there is a directory set to the name of your new project, mysite. Inside the directory, there is another directory with the same name as the project and a python script named manage.py

Inside the second level project directory, there are another 4 Python scripts. So the default Django project can be illustrated as follows.

mysite/ manage.py mysite/ __init__.py settings.py urls.py wsgi.py

__init__.py –  a blank Python script whose presence indicates to the Python interpreter that the directory is a Python package. This file allows Python packages to be imported from the directories they are present.

settings.py – Contains the configuration settings for the Django project.

urls.py – Contains URL patterns for the Django project.

wsgi.py – Contains WSGI configuration properties for the Django project. Basically, Python script used to help run your development server and deploy your project to a production environment.

manage.py –  a command-line utility that lets you interact with your Django project in many ways. This script is responsible for all project specific tasks.

Note that, there are two directories with the project name, this might seem confusing at first however you can always change the name of the outer directory which occasionally referred to as the Base Directory. The second level project directory is hardcoded in some of the Django specific files so better not mess with it.

Running A Django Project

Now that we have created a Django project we can see it in action in the browser. Django comes with a built-in web server for development. Navigate to the Base directory where manage.py is, and run the below command.

python manage.py runserver

Ignore all the migration errors for the moment, Now open your preferred browser and go to http://127.0.0.1:8000/ If everything went right you should see the default the page of Django.

To stop the server press ctrl + c in the terminal window. Running the application on a different port is also possible you just need to pass the port number along with the command.

# Run the development server on the local address and port 4345 (http://127.0.0.1:4345/) python manage.py runserver 4345 # Run the dev server on the 96.126.104.88 address and port 80 (http://96.126.104.88/) python manage.py runserver 96.126.104.88:80

The post Starting A Django Project appeared first on Django Central.

Categories: FLOSS Project Planets

James Duncan

Planet Apache - Tue, 2019-03-19 07:20

Props to Emma Haruka and her work with the Google Cloud Platform Developer Advocacy team to calculate 31.4 trillion digits of π.

They don’t say how much it would cost to do this yourself, but Corey Quinn estimates it’s about a quarter of a million dollars. Now that it’s been generated, however, you can just grab the data by accessing the delivery.pi API:

$ curl "https://api.pi.delivery/v1/pi?numberOfDigits=10" {"content":"3.14159265"}

Or, you can clone off your own copy of their cloud disk image. The dataset is big enough, however, that it’ll cost you $40 a day.

Categories: FLOSS Project Planets

Agiledrop.com Blog: The Story of Agiledrop: A Company Culture That Benefits Both Employees and Clients

Planet Drupal - Tue, 2019-03-19 05:56

We've started a series of blog posts that tell the story of what makes our developers successful when working with other Drupal teams. The fourth and final chapter ties things together by presenting our company culture which strikes the perfect balance between the needs and wants of both our employees and our clients.

READ MORE
Categories: FLOSS Project Planets

Axelerant Blog: The Axelerant Retreat 2019 in Pictures

Planet Drupal - Tue, 2019-03-19 04:50

Team Axelerant went to beautiful Goa, India for a few days this February for our annual company retreat. It was a fantastic gathering, full of warmth, energy and incredible vibes.
Categories: FLOSS Project Planets

Steinar H. Gunderson: When your profiler fools you

Planet Debian - Tue, 2019-03-19 03:42

If you've been following my blog, you'll know about Nageru, my live video mixer, and Futatabi, my instant replay program with slow motion. Nageru and Futatabi both work on the principle that the GPU should be responsible for all the pixel pushing—it's just so much better suited than the CPU—but to do that, the GPU first needs to get at the data.

Thus, in Nageru, pushing the data from the video card to the GPU is one of the main CPU drivers. (The CPU also runs the UI, does audio processing, runs an embedded copy of Chromium if needed—we don't have full GPU acceleration there yet—and not the least encodes the finished video with x264 if you don't want to use Quick Sync for that.) It's a simple task; take two pre-generated OpenGL textures (luma and chroma) with an associated PBO, take the frame that the video capture card has DMAed into system RAM, and copy it while splitting luma from chroma. It goes about as fast as memory bandwidth will allow.

However, when you also want to run Futatabi, it runs on a different machine and also needs to get at the video somehow. Nageru solves this by asking Quick Sync (through VA-API) to encode it to JPEG, and then sending it over the network. Assuming your main GPU is an NVIDIA one (which gives oodles of more headroom for complicated things than the embedded Intel GPU), this means you now need an extra copy, and that's when things started to get hairy for me.

To simplify a long and confusing search, what I found was that with five inputs (three 1080p, two 720p), Nageru would be around two cores (200% CPU in top), and with six (an aditional 1080p), it would go to 300%. (This is on a six-core machine.) This made no sense, so I pulled up “perf record”, which said… nothing. The same routines and instructions were hot (mostly the memcpy into the NVIDIA GPU's buffers); there was no indication of anything new taking time. How could it be?

Eventually I looked at top instead of perf, and saw that some of the existing threads went from 10% to 30% CPU. In other words, everything just became uniformly slower. I had a hunch, and tried “perf stat -ddd“ instead. One value stood out:

3 587 503 LLC-load-misses # 94,72% of all LL-cache hits (71,91%)

Aha! It was somehow falling off a cliff in L3 cache usage. It's a bit like going out of RAM and starting to swap, just more subtle.

So, what was using so much extra cache? I'm sure someone extremely well-versed in perf or Intel VTune would figure out a way to look at all the memory traffic with PEBS or something, but I'm not a perf expert, so I went for the simpler choice: Remove things. E.g., if you change a memcpy to a memset(dst, 0, len), the GPU will be still be encoding a frame, and you'll still be writing things to memory, but you won't be reading anymore. I noticed a really confusing thing: Occasionally, when I did less work, CPU usage would be going up. E.g., have a system at 2.4 cores used, remove some stuff, go up to 3.1 cores! Even worse, occasionally after start, it would be at e.g. 2.0 cores, then ten seconds later, it would be at 3.0. I suspected overheating, but even stopping and waiting ten minutes would not be enough to get it reliably down to 2.0 again.

It eventually turned out (again through perf stat) that power saving was getting the better of me. I hadn't expected it to kick in, but seemingly it did, and top doesn't compensate in any way. Change from the default powersave governor to performance (I have electric heating anyway, and it's still winter up here), and tada... My original case was now down from 3.0 to 2.6 cores.

However, this still wasn't good enough, so I had to do some real (if simple) optimization. Some rearchitecting saved a copy; instead of the capture card receiver thread memcpy-ing into a buffer and the MJPEG encoder thread memcpy-ing it from there to the GPU's memory-mapped buffers, I let the capture card receiver memcpy it directly over instead. (This wasn't done originally due to some complications around locking and such; it took a while to find a reasonable architecture. Of course, when you look at the resulting patch, it doesn't look hard at all.)

This took me down from 3.0 to 2.1 cores for the six-camera case. Success! But still too much; the cliff was still there. It was pretty obvious that it was stalling on something in the six-camera case:

8 552 429 486 cycle_activity.stalls_mem_any # 5 inputs 17 082 914 261 cycle_activity.stalls_mem_any # 6 inputs

I didn't get a whole lot of more L3 misses, though; they seemed to just get much slower (occasionally as much as 1200 cycles on average, which is about four times as much as normal). Unfortunately, you have zero insight in what the Intel GPU is doing to your memory bus, so it's not easy to know if it's messing up your memory or what. Turning off the actual encoding didn't help much, though; it was really the memcpy into them that hurt. And since it was into uncached (write-combined) memory, doing things like non-temporal writes didn't help at all. Neither did combining the two copies into one loop (read once, write twice). Or really anything else I could think of.

Eventually someone on ##intel-media came up with a solution; instead of copying directly into the memory-mapped buffers (vaDeriveImage), copy into a VAImage in system RAM, and then let the GPU do the copy. For whatever reason, this helped a lot; down from 2.1 to 1.4 cores! And 0.6 of those cores were non-VA-API related things. So more patch and happiness all around.

At this point, I wanted to see how far I could go, so I borrowed more capture inputs and set up my not-so-trusty SDI matrix to create an eight-headed capture monster:

Seemingly after a little more tuning of freelist sizes and such, it could sustain eight 1080p59.94 MJPEG inputs, or 480 frames per second if you wanted to—at around three cores again. Now the profile was starting to look pretty different, too, so there were more optimization opportunities, resulting in this pull request (helping ~15% of a core). Also, setting up the command buffers for the GPU copy seemingly takes ~10% of a core now, but I couldn't find a good way of improving it. Most of the time now is spent in the original memcpy to NVIDIA buffers, and I don't think I can do much better than that without getting the capture card to peer-to-peer DMA directly into the GPU buffers (which is a premium feature you'll need to buy Quadro cards for, it seems). In any case, my original six-camera case now is a walk in the park (leaving CPU for a high-quality x264 encode), which was the goal of the exercise to begin with.

So, lesson learned: Sometimes, you need to look at the absolutes, because the relative times (which is what you usually want) can fool you.

Categories: FLOSS Project Planets

Shyama Sankar Vellore: Python Tuples: Cheat Sheet

Planet Python - Tue, 2019-03-19 02:56
A cheat sheet for tuples in Python. What are tuples? How are they used in Python?
Categories: FLOSS Project Planets

leftmouseclickin: Plotting the average directional movement index rating line with python

Planet Python - Tue, 2019-03-19 00:12
Our Own Score

In this chapter, we will create the plot adxr method in the ongoing Forex and Stock application project to plot the average directional movement index rating line. The Average Directional Movement Index Rating (ADXR) measures the strength of the Average Directional Movement Index (ADX). It’s calculated by taking the average of the current ADX and the ADX from one time period before (time periods can vary, but the most typical period used is 14 days).

Below is the modified version of the program. We have included a new plot adxr method as well as the plot adxr button which will be used to call the plot adxr method.

import json from tkinter import * import tkinter.ttk as tk from alpha_vantage.foreignexchange import ForeignExchange from alpha_vantage.techindicators import TechIndicators from alpha_vantage.timeseries import TimeSeries import matplotlib.pyplot as plt from alpha_vantage.sectorperformance import SectorPerformances win = Tk() # Create tk instance win.title("Real Forex n Stock") # Add a title win.resizable(0, 0) # Disable resizing the GUI win.configure(background='white') # change window background color selectorFrame = Frame(win, background="white") # create the top frame to hold base and quote currency combobox selectorFrame.pack(anchor = "nw", pady = 2, padx=10) currency_label = Label(selectorFrame, text = "Select base currency / quote currency :", background="white") currency_label.pack(anchor="w") # the currency pair label selector1Frame = Frame(win, background="white") # create the middle frame to hold base and quote currency combobox selector1Frame.pack(anchor = "nw", pady = 2, padx=10) stock_label = Label(selector1Frame, text = "Select Stock / Time Interval / Series type / Moving average type / Fast Period / Slow Period :", background="white") stock_label.pack(anchor="w") # the stock label curr1 = tuple() # the tuple which will be populated by base and quote currency currency_list = ['AUD', 'BCH', 'BNB', 'BND', 'BTC', 'CAD', 'CHF', 'CNY', 'EOS', 'EUR', 'ETH', 'GBP', 'HKD', 'JPY', 'LTC', 'NZD', 'MYR', 'TRX', 'USD', 'USDT', 'XLM', 'XRP'] # major world currency pairs # populate the combo box for both the base and quote currency for key in currency_list: curr1 += (key, ) # populate the stock symbol tuple f = open("stock.txt", "r") curr2 = tuple() for line in f.readlines(): curr2 += (line.replace('\n', ''),) f.close() # Create a combo box for base currency base_currency = StringVar() # create a string variable based = tk.Combobox(selectorFrame, textvariable=base_currency) based['values'] = curr1 based.pack(side = LEFT, padx=3) # Create a combo box for quote currency quote_currency = StringVar() # create a string variable quote = tk.Combobox(selectorFrame, textvariable=quote_currency) quote['values'] = curr1 quote.pack(side = LEFT, padx=3) # Create a combo box for stock items stock_symbol = StringVar() # create a string variable stock = tk.Combobox(selector1Frame, textvariable=stock_symbol) stock['values'] = curr2 stock.current(0) stock.pack(side = LEFT, padx=3) interval = tk.Combobox(selector1Frame) interval['values'] = ('1min', '5min', '15min', '30min', '60min', 'daily', 'weekly', 'monthly') interval.current(0) interval.pack(side = LEFT, padx=3) price_type = tk.Combobox(selector1Frame) price_type['values'] = ('close', 'open', 'high', 'low') price_type.current(0) price_type.pack(side =LEFT, padx=3) matype_type = tk.Combobox(selector1Frame, width=37) matype_type['values'] = ('Simple Moving Average (SMA)', 'Exponential Moving Average (EMA)', 'Weighted Moving Average (WMA)', 'Double Exponential Moving Average (DEMA', 'Triple Exponential Moving Average (TEMA)', 'Triangular Moving Average (TRIMA', 'T3 Moving Average', 'Kaufman Adaptive Moving Average (KAMA)', ' MESA Adaptive Moving Average (MAMA)') matype_type.current(0) matype_type.pack(side =LEFT, padx=3) mattype_list = ['Simple Moving Average (SMA)', 'Exponential Moving Average (EMA)', 'Weighted Moving Average (WMA)', 'Double Exponential Moving Average (DEMA', 'Triple Exponential Moving Average (TEMA)', 'Triangular Moving Average (TRIMA', 'T3 Moving Average', 'Kaufman Adaptive Moving Average (KAMA)', ' MESA Adaptive Moving Average (MAMA)'] # fill up the fast period and slow period combo boxes with integer ranging from 2 to 10,000 fa = tuple() for i in range(2, 10001): fa += (i, ) fast_pe = tk.Combobox(selector1Frame) fast_pe['values'] = fa fast_pe.current(0) fast_pe.pack(side=LEFT, padx=3) slow_pe = tk.Combobox(selector1Frame) slow_pe['values'] = fa slow_pe.current(0) slow_pe.pack(side=LEFT, padx=3) # create text widget area s = StringVar() # create string variable which will be used to fill up the Forex or stock data # create currency frame and text widget to display the incoming forex data currencyFrame = Frame(win) currencyFrame.pack(side=TOP, fill=X) currency = Label(currencyFrame) currency.pack(fill=X) text_widget = Text(currency, fg='white', background='black') text_widget.pack(fill=X) s.set("Click the find button to find out the currency exchange rate") text_widget.insert(END, s.get()) buttonFrame = Frame(win) # create a bottom frame to hold the find button buttonFrame.pack(side = BOTTOM, fill=X, pady = 6, padx=10) # first get the api key and secret from the file f = open("alpha.txt", "r") api_key = f.readline() f.close() api_key = api_key.replace('\n', '') def get_exchange_rate(): # this method will display the incoming forex data after the api called try: cc = ForeignExchange(key= api_key) from_ = based.get() to_ = quote.get() countVar = StringVar() # use to hold the character count text_widget.tag_remove("search", "1.0", "end") # cleared the hightlighted currency pair if(from_ != '' and to_ != '' and from_ != to_): data, _ = cc.get_currency_exchange_rate(from_currency=from_, to_currency=to_) exchange_rate = dict(json.loads(json.dumps(data))) count = 1 sell_buy = str(count) + ".) Pair : " + exchange_rate['1. From_Currency Code'] + "(" + exchange_rate['2. From_Currency Name'] + ")" + " / " + exchange_rate['3. To_Currency Code']+"(" + exchange_rate['4. To_Currency Name'] + ") : " + str(exchange_rate['5. Exchange Rate']) + '\n' text_widget.delete('1.0', END) # clear all those previous text first s.set(sell_buy) text_widget.insert(INSERT, s.get()) # display forex rate in text widget pos = text_widget.search(from_, "1.0", stopindex="end", count=countVar) text_widget.tag_configure("search", background="green") end_pos = float(pos) + float(0.7) text_widget.tag_add("search", pos, str(end_pos)) # highlight the background of the searched currency pair pos = float(pos) + 2.0 text_widget.see(str(pos)) except: print("An exception occurred") def plot_stock_echange(): try: stock_symbol_text = stock.get() # get the selected symbol if(stock_symbol_text!= ''): ts = TimeSeries(key=api_key, output_format='pandas') data, meta_data = ts.get_intraday(symbol=stock_symbol_text, interval='1min', outputsize='full') data['4. close'].plot() stock_title = 'Intraday Times Series for the ' + stock_symbol_text + ' stock (1 min)' plt.title(stock_title) plt.show() except: print("An exception occurred") def plot_stock_technical(): try: stock_symbol_text = stock.get() # get the selected stock symbol if(stock_symbol_text!= ''): ti = TechIndicators(key=api_key, output_format='pandas') data, meta_data = ti.get_bbands(symbol=stock_symbol_text, interval=interval.get(), series_type=price_type.get(), matype=mattype_list.index(matype_type.get()), time_period=int(interval.get().replace('min', ''))) data.plot() stock_title = 'BBbands indicator for ' + stock_symbol_text + ' ' + interval.get() plt.title(stock_title) plt.show() except: print("An exception occurred") def plot_op(): # plot the Absolute price oscillator (APO) try: stock_symbol_text = stock.get() # get the selected stock symbol if(stock_symbol_text!= ''): ti = TechIndicators(key=api_key, output_format='pandas') data, meta_data = ti.get_apo(symbol=stock_symbol_text, interval=interval.get(), series_type=price_type.get(), matype=mattype_list.index(matype_type.get()), fastperiod = fast_pe.get(), slowperiod= slow_pe.get()) data.plot() stock_title = 'Absolute Price Oscillator (APO) for ' + stock_symbol_text + ' ' + interval.get() plt.title(stock_title) plt.show() except ValueError: print("An exception occurred") def plot_adxr(): # plot the average directional movement index rating try: stock_symbol_text = stock.get() # get the selected stock symbol if(stock_symbol_text!= ''): ti = TechIndicators(key=api_key, output_format='pandas') data, meta_data = ti.get_adxr(symbol=stock_symbol_text, interval=interval.get(), time_period=int(interval.get().replace('min', ''))) data.plot() stock_title = 'Average directional movement index rating for ' + stock_symbol_text + ' at ' + interval.get() plt.title(stock_title) plt.show() except ValueError: print("An exception occurred") def plot_sector_performance(): sp = SectorPerformances(key=api_key, output_format='pandas') data, meta_data = sp.get_sector() data['Rank A: Real-Time Performance'].plot(kind='bar') plt.title('Real Time Performance (%) per Sector') plt.tight_layout() plt.grid() plt.show() def plot_ad(): try: stock_symbol_text = stock.get() # get the selected stock symbol if (stock_symbol_text != ''): ti = TechIndicators(key=api_key, output_format='pandas') data, meta_data = ti.get_ad(symbol=stock_symbol_text, interval=interval.get()) data.plot() stock_title = 'Chaikin A/D line values for ' + stock_symbol_text + ' ' + interval.get() plt.title(stock_title) plt.show() except: print("An exception occurred") action_vid = tk.Button(buttonFrame, text="Calculate Exchange Rate", command=get_exchange_rate) # button used to find out the exchange rate of currency pair action_vid.pack(side=LEFT, padx=2) action_stock_plot = tk.Button(buttonFrame, text="Plot Stock", command=plot_stock_echange) # button used to plot the intra-minute stock value action_stock_plot.pack(side=LEFT, padx=2) action_technical_plot = tk.Button(buttonFrame, text="Plot Technical", command=plot_stock_technical) # button used to plot the 60 minutes stock technical value action_technical_plot.pack(side=LEFT, padx=2) action_sector_plot = tk.Button(buttonFrame, text="Plot Sector Performance", command=plot_sector_performance) # button used to plot the sector performance graph action_sector_plot.pack(side=LEFT, padx=2) action_ad_plot = tk.Button(buttonFrame, text="Plot AD Line", command=plot_ad) # button used to plot the A/D line graph action_ad_plot.pack(side=LEFT, padx=2) action_ad_op = tk.Button(buttonFrame, text="Plot APO Line", command=plot_op) # button used to plot the APO line graph action_ad_op.pack(side=LEFT, padx=3) action_adxr = tk.Button(buttonFrame, text="Plot ADXR Line", command=plot_adxr) # button used to plot the average directional movement index rating action_adxr.pack(side=LEFT, padx=3) win.iconbitmap(r'ico.ico') win.mainloop()

As usual run the program and then click on the plot adxr button we will see this outcome.

Plotting the #stock Average Directional Movement Index Rating on the graph with #python pic.twitter.com/Er5NR8BuYe

— TechLikin (@ChooWhei) March 19, 2019
Categories: FLOSS Project Planets

Jonathan Carter: Running for DPL

Planet Debian - Mon, 2019-03-18 23:30

I am running for Debian Project Leader, my official platform is published on the Debian website (currently looks a bit weird, but a fix is pending publication), with a more readable version available on my website as well as a plain-text version.

Shortly after I finished writing the first version of my platform page, I discovered an old talk from Ian Murdock at Microsoft Research where he said something that resonated well with me, and I think also my platform. Paraphrasing him:

You don’t want design by committee, but you want to tap in to the wisdom of the crowd. Lay out a vision for solving the problem, but be flexible enough to understand that you don’t have all the answers yourself, that other people are equally if not more intelligent than you are, and collectively, the crowd is the most intelligent of all.

– paraphrasing of Ian Murdock during a talk at Microsoft Research.

I’m feeling oddly calm about all of this and I like it. It has been a good exercise taking the time to read what everyone has said across all the mediums and trying to piece together all the pertinent parts and form a workable set of ideas.

I’m also glad that we have multiple candidates, I hope that it will inspire some thought, ideas and actions around the topics that occupy our collective head space.

The campaign period remains open until 2019-04-06. During this period, you can can ask me or any of the other candidates about how they envision their term as DPL.

There are 5 candidates in total, here’s the full list of candidates (in order of self-nomination with links to platforms as available):

Categories: FLOSS Project Planets

codingdirectional: Get only the latest live match from NBA with python

Planet Python - Mon, 2019-03-18 23:23

Hello and welcome back, in this chapter we will continue to develop the previous sports score application by showing all the latest live matches from the NBA on the text widget area. The sports.py module does not have a method to only return the live NBA matches but instead that API call will return basically all the live basketball matches from all the basketball leagues around the world. Therefore we will need to filter out all those none NBA results before showing the data on the text widget. Below is the modified version of the program which will do just that. We will perform the filtering process under the get matches method.

import sports import json from tkinter import * import tkinter.ttk as tk import datetime win = Tk() # Create tk instance win.title("NBA") # Add a title win.resizable(0, 0) # Disable resizing the GUI win.configure(background='white') # change window background color selectorFrame = Frame(win, background="white") # create top frame to hold team 1 vs team 2 combobox selectorFrame.pack(anchor = "nw", pady = 2, padx=10) match_label = Label(selectorFrame, text = "Select Team 1 vs Team 2 :", background="white") match_label.pack(anchor="w") # the team label # Create a combo box for team 1 team1 = tk.Combobox(selectorFrame) team1.pack(side = LEFT, padx=3) # Create a combo box for team 2 team2 = tk.Combobox(selectorFrame) team2.pack(side = LEFT, padx=3) s = StringVar() # create string variable # create match frame and text widget to display the incoming match data matchFrame = Frame(win) matchFrame.pack(side=TOP) match = Label(matchFrame) match.pack() text_widget = Text(match, fg='white', background='black') text_widget.pack() s.set("Click below buttons to find out the match result") text_widget.insert(END, s.get()) buttonFrame = Frame(win) # create a bottom frame to hold the find button buttonFrame.pack(side = BOTTOM, fill=X, pady = 6) # fill up the combo boxes with the team name data from the text file team_tuple = tuple() f = open("TextFile1.txt", "r") nba_list = [] # will be used to filter out the unwanted team from the other league for line in f.readlines(): line = line.replace('\n', '') nba_list.append(line) team_tuple += (line, ) f.close() team1["values"] = team_tuple team1.current(1) team2["values"] = team_tuple team2.current(0) def get_matches(): # show all the NBA team matches match_str = ' Live NBA Matches ' + str(datetime.datetime.now()) + '\n' try: matches = sports.get_sport(sports.BASKETBALL) for item in matches: match_all = str(item) for nba_team in nba_list: if(nba_team in match_all): match_str += (match_all) + '\n' break text_widget.delete('1.0', END) # clear all those previous text first s.set(match_str) text_widget.insert(INSERT, s.get()) # display teams match data in text widget except: print("An exception occurred") def get_match(): # return the recent match of team 1 vs team 2 try: match = sports.get_match(sports.BASKETBALL, team1.get(), team2.get()) text_widget.delete('1.0', END) # clear all those previous text first s.set(match) text_widget.insert(INSERT, s.get()) # display team match data in text widget except: print("An exception occurred") action_vid = tk.Button(buttonFrame, text="Latest Match", command=get_match) # button used to find out the team match data action_vid.pack(side=LEFT, padx=2) action_vid1 = tk.Button(buttonFrame, text="All Matches", command=get_matches) # button used to find out the teams match data action_vid1.pack(side=LEFT, padx=2) win.mainloop()

If you start the software and click on the All Matches button you will see all the live matches from NBA in the text widget area. Like, share or follow me on Twitter.

Shows the #live #NBA match with this #python application @ThePSF https://t.co/ohXBZV2hWi pic.twitter.com/2CVQMJC4kY

— TechLikin (@ChooWhei) March 19, 2019

Download mine latest Free Firefox Extension on Firefox Store to show your love for my project.

Due to the tight daily schedule, this site will switch to twice a week updating starting from today onward.

Categories: FLOSS Project Planets

Promet Source: “More Like a Drupal Community Celebration than a Tech Industry Trade Show”

Planet Drupal - Mon, 2019-03-18 18:24
In preparation for his fourth DrupalCon, Chris O’Donnell, Digital Strategist, for Promet Source shared his views on the vibe of this annual conference, as well as Drupal’s current standing within the ecosystem of enterprise-level CMS platforms.     What are you looking forward to at Drupalcon this year?
Categories: FLOSS Project Planets

FSF Blogs: Your guide to LibrePlanet 2019, March 23-24!

GNU Planet! - Mon, 2019-03-18 16:36

Are you planning on joining us for LibrePlanet 2019, coming up this weekend, March 23-24, at the Stata Center, Massachusetts Institute of Technology (MIT)? If you haven't registered yet, there's still time -- registration is open through Tuesday, March 19 at 10:00 EDT, and we also welcome walk-ins (space permitting)! Remember, students and Free Software Foundation (FSF) associate members get in gratis.

We also hope you'll join us for the Friday night open house at the FSF office, here in Boston -- you can pick up your badge early to skip the line Saturday morning (more details below).

Here's your guide to maximum enjoyment of LibrePlanet:

  • If you haven't seen it yet, the full conference program is now available.

  • Badge pickup, registration, and coffee begin at 09:00 on Saturday at the conference site, the Stata Center at the Massachusetts Institute of Technology (MIT), 32 Vassar Street, Cambridge, MA 02139.

Social events

You're invited to social and community events happening before the conference and during the conference weekend. All ages are welcome at all social events, and we strongly recommend using public transportation.

  • On Friday evening, the FSF is hosting an open house at the FSF office, 51 Franklin Street, 5th Floor, Boston, MA 02110 from 17:00 to 19:30. The FSF office is a short walk from the Downtown Crossing, State, and Park Street MBTA stops. The FSF office is an accessible space. We will provide beverages and light refreshments.

  • After the open house, all women, genderqueer, non-binary, and gender non-conforming people interested in free software are invited to the Welcome Dinner. This is a gratis meal with some great people in free software -- keep an eye on the social activities page for the details.

  • We'll celebrate on Saturday, March 23rd, after the Free Software Awards, from 19:00 to 22:00, at Scholars Bistro, 25 School Street, Boston, MA 02108, near the FSF office. All ages are welcome until 21:00. Gratis snacks will be provided, and your first drink is on the FSF. A full dinner menu is also available for purchase. The venue is accessible.

  • Prefer a quieter social space? The FSF office will be open late for hacking and hanging out on Saturday from 19:00 to 21:30. Snacks, beverages, and power are provided. This is an alcohol-free event.

  • On Sunday afternoon, during the lunch break from 12:35-13:35, we'll be holding an FSF members meeting at the LibrePlanet site (room TBA), where you can join other associate members to discuss successes from the past year and what you'd like to see in the future of the FSF. Pizza and salad will be provided. Please RSVP at https://libreplanet.org/wiki/LibrePlanet:Conference/2019/sunday_members_lunch.

  • On Sunday night, starting at 21:00, join us at Grendel's Den, a Cambridge pub that is popular with local free software and free culture folks, located at 89 Winthrop Street in Harvard Square. This afterparty is not an official conference event, but is a standing tradition of many years. There is elevator access upon request. Call 617-491-1160 to have someone from Grendel's assist you.

  • Want to plan a group dinner or other social gathering during LibrePlanet? Use the wiki to plan an event or join someone else's event.

More at LibrePlanet
  • We're continuing our popular five-minute lightning talks by conference attendees about their free software passions. Sign up to give one!

  • We're hosting an exhibit hall for a select group of projects and businesses in the free software world. Come by from 09:00 until 18:00 on both days of the conference to check out tables from 3NWeb, CivicActions, FreedomBox Foundation, GNOME, MIT Libraries' Program on Information Science, Private Internet Access, Purism, Technoethical, ThinkPenguin, and the Tor Project.

  • You can use the #libreplanet IRC channel on freenode (irc.freenode.org) to participate in the online discussion before, during, and after the conference. You can also use Mumble voice chat on the mumble server at mumble.fsf.org. We provide these resources, along with video streaming, so that free software supporters who are unable to travel to the US for economic and/or political reasons are still able to participate.

  • You can pre-order your LibrePlanet 2019 T-shirt until Wednesday, March 20, at midnight EDT -- or, just wait and buy yours at the GNU Press table at the conference!

Resources
  • Logistics info, including transportation, accommodations, and restaurants, is available to make it easy for you to figure out travel and choose lodging near the conference.

  • The libreplanet-discuss mailing list is great for planning ride-shares or social events during the conference weekend, and also for participating in the year-round conversation about free software events and issues.

  • Are there two LibrePlanet sessions you want to see, and they're at the same time? Fear not, recordings will be available after the conference at https://media.libreplanet.org.

Win a raffle prize!

This year LibrePlanet will be having another awesome raffle. Buy tickets to support free software while also getting a chance to win:

All attendees get a gratis raffle ticket, FSF associate members get a second gratis ticket, and everyone can buy more chances to win at the GNU Press table during LibrePlanet, as well as at the Friday open house and Saturday evening social events! Buy one ticket for $2, 3 tickets for $5, one arm's length for $20, cash or credit. FSF staff and board members are not eligible to participate in the raffle.

Weather

Keep an eye on the weather and dress accordingly.

Thank you to our sponsors!

LibrePlanet 2019 is supported by several generous sponsors. Big thanks to Red Hat and Private Internet Access!

Categories: FLOSS Project Planets

Your guide to LibrePlanet 2019, March 23-24!

FSF Blogs - Mon, 2019-03-18 16:36

Are you planning on joining us for LibrePlanet 2019, coming up this weekend, March 23-24, at the Stata Center, Massachusetts Institute of Technology (MIT)? If you haven't registered yet, there's still time -- registration is open through Tuesday, March 19 at 10:00 EDT, and we also welcome walk-ins (space permitting)! Remember, students and Free Software Foundation (FSF) associate members get in gratis.

We also hope you'll join us for the Friday night open house at the FSF office, here in Boston -- you can pick up your badge early to skip the line Saturday morning (more details below).

Here's your guide to maximum enjoyment of LibrePlanet:

  • If you haven't seen it yet, the full conference program is now available.

  • Badge pickup, registration, and coffee begin at 09:00 on Saturday at the conference site, the Stata Center at the Massachusetts Institute of Technology (MIT), 32 Vassar Street, Cambridge, MA 02139.

Social events

You're invited to social and community events happening before the conference and during the conference weekend. All ages are welcome at all social events, and we strongly recommend using public transportation.

  • On Friday evening, the FSF is hosting an open house at the FSF office, 51 Franklin Street, 5th Floor, Boston, MA 02110 from 17:00 to 19:30. The FSF office is a short walk from the Downtown Crossing, State, and Park Street MBTA stops. The FSF office is an accessible space. We will provide beverages and light refreshments.

  • After the open house, all women, genderqueer, non-binary, and gender non-conforming people interested in free software are invited to the Welcome Dinner. This is a gratis meal with some great people in free software -- keep an eye on the social activities page for the details.

  • We'll celebrate on Saturday, March 23rd, after the Free Software Awards, from 19:00 to 22:00, at Scholars Bistro, 25 School Street, Boston, MA 02108, near the FSF office. All ages are welcome until 21:00. Gratis snacks will be provided, and your first drink is on the FSF. A full dinner menu is also available for purchase. The venue is accessible.

  • Prefer a quieter social space? The FSF office will be open late for hacking and hanging out on Saturday from 19:00 to 21:30. Snacks, beverages, and power are provided. This is an alcohol-free event.

  • On Sunday afternoon, during the lunch break from 12:35-13:35, we'll be holding an FSF members meeting at the LibrePlanet site (room TBA), where you can join other associate members to discuss successes from the past year and what you'd like to see in the future of the FSF. Pizza and salad will be provided. Please RSVP at https://libreplanet.org/wiki/LibrePlanet:Conference/2019/sunday_members_lunch.

  • On Sunday night, starting at 21:00, join us at Grendel's Den, a Cambridge pub that is popular with local free software and free culture folks, located at 89 Winthrop Street in Harvard Square. This afterparty is not an official conference event, but is a standing tradition of many years. There is elevator access upon request. Call 617-491-1160 to have someone from Grendel's assist you.

  • Want to plan a group dinner or other social gathering during LibrePlanet? Use the wiki to plan an event or join someone else's event.

More at LibrePlanet
  • We're continuing our popular five-minute lightning talks by conference attendees about their free software passions. Sign up to give one!

  • We're hosting an exhibit hall for a select group of projects and businesses in the free software world. Come by from 09:00 until 18:00 on both days of the conference to check out tables from 3NWeb, CivicActions, FreedomBox Foundation, GNOME, MIT Libraries' Program on Information Science, Private Internet Access, Purism, Technoethical, ThinkPenguin, and the Tor Project.

  • You can use the #libreplanet IRC channel on freenode (irc.freenode.org) to participate in the online discussion before, during, and after the conference. You can also use Mumble voice chat on the mumble server at mumble.fsf.org. We provide these resources, along with video streaming, so that free software supporters who are unable to travel to the US for economic and/or political reasons are still able to participate.

  • You can pre-order your LibrePlanet 2019 T-shirt until Wednesday, March 20, at midnight EDT -- or, just wait and buy yours at the GNU Press table at the conference!

Resources
  • Logistics info, including transportation, accommodations, and restaurants, is available to make it easy for you to figure out travel and choose lodging near the conference.

  • The libreplanet-discuss mailing list is great for planning ride-shares or social events during the conference weekend, and also for participating in the year-round conversation about free software events and issues.

  • Are there two LibrePlanet sessions you want to see, and they're at the same time? Fear not, recordings will be available after the conference at https://media.libreplanet.org.

Win a raffle prize!

This year LibrePlanet will be having another awesome raffle. Buy tickets to support free software while also getting a chance to win:

All attendees get a gratis raffle ticket, FSF associate members get a second gratis ticket, and everyone can buy more chances to win at the GNU Press table during LibrePlanet, as well as at the Friday open house and Saturday evening social events! Buy one ticket for $2, 3 tickets for $5, one arm's length for $20, cash or credit. FSF staff and board members are not eligible to participate in the raffle.

Weather

Keep an eye on the weather and dress accordingly.

Thank you to our sponsors!

LibrePlanet 2019 is supported by several generous sponsors. Big thanks to Red Hat and Private Internet Access!

Categories: FLOSS Project Planets

Laura Arjona Reina: A weekend for the Debian website and friends

Planet Debian - Mon, 2019-03-18 16:05

Last weekend (15-17 March 2019) some members of the Debian web team have met at my place in Madrid to advance work together in what we call a Debian Sprint. A report will be published in the following days, but I want to say thank you to everybody that made possible this meeting happen.

We have shared 2-3 very nice days, we have agreed in many topics and started to design an new homepage focused in newcomers (since a Debianite usually just go to the subpage they need) and showing that Debian the operating system is made by a community of people. We are committed to simplify the content of and the structure of www.debian.org, we have fixed some bugs already, and talked about many other aspects. We shared some time to know each other, and I think all of us became motivated to continue working on the website (because there is still a lot of work to do!) and make easy for new contributors to get involved too.

For me, a person who rarely finds the way to attend Debian events, it was amazing to meet in person with people who I have shared work and mails and IRC chats since years in some cases, and to offer my place for the meeting. I have enjoyed a lot preparing all the logistics and I’m very happy that it went very well. Now I walk through my neighbourhood for my daily commute and every place is full of small memories of these days. Thanks, friends!

Categories: FLOSS Project Planets

FeatherCast: CHAOSSCon EU 2019, Why it’s Important for Open Source Metrics to Tell a Story, Brian Proffitt

Planet Apache - Mon, 2019-03-18 14:20

CHAOSS stands for Community Health Analytics Open Source Software and recently at CHAOSSCon EU in Brussels, we spoke briefly to Brian Proffitt, one of the CHAOSS Board members and also Senior Principal Community Architect for Open Source and Standards team at Red Hat. He tells us why it’s important for metrics to tell a story, why previous metrics may not have been as impartial as people would want, and why increased mailing list traffic could indicate a potential community crisis!

https://feathercastapache.files.wordpress.com/2019/03/chaoss-brian-profitt.mp3
Categories: FLOSS Project Planets

Jacob Rockowitz: Webform module now supports importing submissions

Planet Drupal - Mon, 2019-03-18 13:18
Problem

The answer is Drupal's Migrate API, which is incredibly powerful but can feel overwhelming. When I migrated MSKCC.org from Drupal 6 to Drupal 8, the Migrate API was just being introduced into Drupal 8 core, and I felt more comfortable writing a custom migration script instead of using code that was still under development. Migrate API is now stable and if you are an experienced Drupal developer, you should use it.

The level of expertise required to build and maintain a Drupal 8 website has changed from Drupal 7, mainly because we are creating more ambitious digital experiences. The Drupal community struggles to simplify our flexible and sometimes complex product. My approach is to make the Webform module as flexible and robust as possible, while not forgetting that people need a simple way to start building a form. This is exactly why I include an introduction video on the Webform module's main page. Besides making the Webform module an awesome tool for experienced Drupal site builders, the Webform module needs to be welcoming to new users and make it easy for them to move their existing forms to Drupal.

Either an organization is starting from scratch and building a new Drupal site, or more commonly an organization has decided they need to provide a more ambitious digital experience and they have chosen to switch to Drupal. In both situations, we need to make it easy for someone to switch from other form builders to Webform.

The problem that needs to be addressed is…

Solution

The simplest way to migrate to the Webform module is to rebuild an external form and then import the existing data. Building a webform is fun and easy, forms are a critical aspect to most websites; it is worth taking the time needed...Read More

Categories: FLOSS Project Planets

James Duncan

Planet Apache - Mon, 2019-03-18 12:45

Somewhere in Kruezberg

Categories: FLOSS Project Planets

Python Insider: Python 3.4.10 is now available

Planet Python - Mon, 2019-03-18 12:37
Python 3.4.10 is now available.  You can download it here.

Python 3.4.10 is the final release in the Python 3.4 series.  As of this release, the 3.4 branch has been retired, no further changes to 3.4 will be accepted, and no new releases will be made.  This is standard Python policy; Python releases get five years of support and are then retired.

If you're still using Python 3.4, you should consider upgrading to the current version--3.7.2 as of this writing.  Newer versions of Python have many new features, performance improvements, and bug fixes, which should all serve to enhance your Python programming experience.

We in the Python core development community thank you for your interest in 3.4, and we wish you all the best!
Categories: FLOSS Project Planets

Phase2: Multi-Design Systems with Component Libraries Module

Planet Drupal - Mon, 2019-03-18 12:02
The Rundown

At Phase2 we’re always looking to pinpoint the real problem and solve it. Let’s say we have a new project to implement a design system for The First Order. We’ve done work for their parent organization in the past and already have a design system in place for The Empire. The site architecture calls for creating a multi-site and multi-design implementation to make use of The Empire’s assets for The First Order.

Categories: FLOSS Project Planets

Jonathan Dowland: WadC 3.0

Planet Debian - Mon, 2019-03-18 11:12

blockmap.wl being reloaded (click for animation)

A couple of weeks ago I release version 3.0 of Wad Compiler, a lazy functional programming language and IDE for the construction of Doom maps.

3.0 introduces more flexible randomness with rand; two new test maps (blockmap and bsp) that demonstrate approaches to random dungeon generation; some useful data structures in the library; better Hexen support and a bunch of other improvements.

Check the release notes for the full details.

Version 3.0 of WadC is dedicated to Lu (1972-2019). RIP.

Categories: FLOSS Project Planets

Pages