Gitbase: Exploring git repos with SQL

Git has become the de-facto standard for code versioning, but its popularity didn’t remove the complexity of performing deep analyses of the history and contents of source code repositories.

SQL, on the other hand, is a battle-tested language to query large codebases as its adoption by projects like Spark and BigQuery shows.

So it is just logical that at source we chose these two technologies to create gitbase: the code-as-data solution for large-scale analysis of git repositories with SQL.

Gitbase is a fully open source project that stands on the shoulders of a series of giants which made its development possible, this article aims to point out the main ones.

The gitbase playground provides a visual way to use gitbase.

Parsing SQL with Vitess

Gitbase’s user interface is SQL. This means we need to be able to parse and understand the SQL requests that arrive through the network following the MySQL protocol. Fortunately for us, this was already implemented by our friends at YouTube and their Vitess project. Vitess is a database clustering system for horizontal scaling of MySQL.

We simply grabbed the pieces of code that mattered to us and made it into an open source project that allows anyone to write a MySQL server in minutes (as I showed in my justforfunc episode CSVQL—serving CSV with SQL).

Reading git repositories with go-git

Once we’ve parsed a request we still need to find how to answer it by reading the git repositories in our dataset. For this, we integrated source’s most successful repository go-git. Go-git is a highly extensible Git implementation in pure Go.

This allowed us to easily analyze repositories stored on disk as siva files (again an open source project by source) or simply cloned with git clone.

Detecting languages with enry and parsing files with babelfish

Gitbase does not stop its analytic power at the git history. By integrating language detection with our (obviously) open source project enry and program parsing with babelfish. Babelfish is a self-hosted server for universal source code parsing, turning code files into Universal Abstract Syntax Trees (UASTs)

These two features are exposed in gitbase as the user functions LANGUAGE and UAST. Together they make requests like “find the name of the function that was most often modified during the last month” possible.

Making it go fast

Gitbase analyzes really large datasets—e.g. Public Git Archive, with 3TB of source code from GitHub (announcement) and in order to do so every CPU cycle counts.

This is why we integrated two more projects into the mix: Rubex and Pilosa.

Speeding up regular expressions with Rubex and Oniguruma

Rubex is a quasi-drop-in replacement for Go’s regexp standard library package. I say quasi because they do not implement the LiteralPrefix method on the regexp.Regexp type, but I also had never heard about that method until right now.

Rubex gets its performance from the highly optimized C library

Oniguruma

which it calls using

cgo

Speeding up queries with Pilosa indexes

Indexes are a well-known feature of basically every relational database, but Vitess does not implement them since it doesn’t really need to.

But again open source came to the rescue with Pilosa, a distributed bitmap index implemented in Go which made gitbase usable on massive datasets. Pilosa is an open source, distributed bitmap index that dramatically accelerates queries across multiple, massive datasets.

Conclusion

I’d like to use this blog post to personally thank the open source community that made it possible for us to create gitbase in such a shorter period that anyone would have expected. At source we are firm believers in open source and every single line of code under github.com/src-d (including our OKRs and investor board) is a testament to that.

Would you like to give gitbase a try? The fastest and easiest way is with source Engine. Download it from sourced.tech/engine and get gitbase running with a single command!

The article was originally published on Medium and is republished here with permission.

Source

Install Telegram on Linux | Linux Hint

At first glance it seems that Telegram requires a mobile phone and Android, but fear not. You can use your mobile phone to get started and your favourite Linux device to get on Telegram. SMS capability is required though, in what decade did the last mobile without SMS disappear? When you start Telegram from the beginning, the system requires that you identify yourself. This may make you believe that you have to start using Telegram on a mobile phone. In the case of Telegram you do not use a regular user name. Instead, you use your mobile phone to secure your access. This is why you do need a phone number though.

Pick a phone number for the activation.

The application will ask for confirmation before starting you off. When you have your mobile on and in range, start your installation. The first time you run the application, it will ask for your number and send you an SMS. This procedure is the same for every new install. If you use the same phone each time, the system will return the screen with the channels you have picked on other devices. It will also keep track of where you stopped reading.

Download the client. Apt option

With most distributions, you can find the Telegram Desktop client in your repositories. A search in the Ubuntu repositories will show both the desktop client and a few other packages. The other packages are for supporting voice over IP for your Telegram installation. There are also development libraries available. If you want to use this option, the install is a simple apt command.

A small warning is that the apt version lags behind the other options. Unless there is security issue, this is not a problem though.

Snap option

You can also use the snap option for installation. This package is usually updated quicker than other binary packages. If you search with the snap command, you can find the desktop application and a few other interesting options. This also follows the standard install procedure though you have a few options here. Most people will run the regular install with command snap.

$ sudo snap install telegram-desktop

You can also raise your bets and choose the development version by using the –edge switch. You can also accomplish after install by running the switch command.

$ sudo snap switch –edge
$ sudo snap refresh telegram-desktop

Since you are using a snap, you also have the option to choose a command line version. The snap is named telegram-cli.

Download tarball

Pick up the tarball from their own website, and unpack. The procedure is extremely simple and it only creates two files! You pick up the tarball from the web-page, where you can also find other platforms where you can use Telegram.

After you have the Telegram tarball available, just unpack it in a directory of your choice.

$ tar -xvf tsetup.x.x.x.tar.xz
$ cd Telegram

Finally, the two files that the install creates are the executable and the updater program, both are set executable so just run. If you have run the application before on this computer, then the settings are already in your home directory.

Add the chrome app

If you are using chrome most of the day, you can also install the application. You install the application like any other chrome app. To make sure you are using the same account for all installations, make sure you have your mobile handy when installing.

There are also command line choices

As mentioned earlier, there is a command line client available. After installing it with snap, you start it the same way you do an ordinary session. This client does not recognise your earlier clients on the machine you are running, so you will have to get a new code when you start it. The application asks for your phone number, type it in international format and off you go. The code will be sent to your phone or if you still have your graphical client running, you get the code to that client. The best way to start is by using channel list command and then the history command to see what is going on in your channels. All commands can be run when you call the executable, this makes it great for you scripting kids out there to use for projects.

Conclusion

As you can see its easy to get started with Telegram on a Linux, with a little extra effort.

Source

Download gtkmm-documentation Linux 3.22.1

gtkmm-documentation is an open source package that contains a gtkmm manual for GTK/GNOME developers. gtkmm is a C++ API for GTK+.

gtkmm is an open source software that features inheritance to derive custom widgets, type-safe signal handlers, in standard C++, polymorphism, use of standard C++ library, including containers, iterators, and strings, full internationalization with UTF-8, complete C++ memory management, object composition, and automatic deallocation of dynamically allocated widgets.

Moreover, gtkmm features full use of C++ namespaces, no macros, and it is cross-platform, supporting Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Windows (gcc, MSVC++ .Net 2003), Mac OS X (gcc), and other OSes

Source

Ubuntu Allow Port Through Firewall

The default firewall on Ubuntu operating system is called UFW. The full form of UFW is Uncomplicated Firewall. According to the official website of Ubuntu, “ufw is not intended to provide complete firewall functionality via its command interface, but instead provides an easy way to add or remove simple rules. It is currently mainly used for host-based firewalls.” So, UFW has a user friendly way of managing IPv4 and IPv6 simple firewall rules. You can’t replace iptables with UFW. But, you can setup basic firewalls with UFW very easily.

In this article, I will show you how to open and block ports through the Ubuntu’s default firewall, UFW. Let’s get started.

Source

Weekend Reading: Python | Linux Journal

Python is easy to use, powerful, versatile and a Linux Journal reader favorite. We’ve round up some of the most popular recent Python-related articles for your weekend reading.

  • Introducing PyInstaller by Reuven M. Lerner: Want to distribute Python programs to your Python-less clients? PyInstaller is the answer.
  • Bytes, Characters and Python 2 by Reuven M. Lerner: Moving from Python 2 to 3? Here’s what you need to know about strings and their role in in your upgrade.
  • Introducing Python 3.7’s Dataclasses by Reuven M. Lerner: Python 3.7’s dataclasses reduce repetition in your class definitions.
  • Examining Data Using Pandas by Reuven M. Lerner: You don’t need to be a data scientist to use Pandas for some basic analysis.
  • Multiprocessing in Python by Reuven M. Lerner: Python’s “multiprocessing” module feels like threads, but actually launches processes.
  • Launching External Processes in Python by Reuven M. Lerner: Think it’s complex to connect your Python program to the UNIX shell? Think again!
  • Thinking Concurrently: How Modern Network Applications Handle Multiple Connections by Reuven M. Lerner: exploring different types of multiprocessing and looks at the advantages and disadvantages of each.
  • Threading in Python by Reuven M. Lerner: threads can provide concurrency, even if they’re not truly parallel.
  • Using Python for Science by Joey Bernard: introducing Anaconda, a Python distribution for scientific research.
  • Visualizing Molecules with Python by Joey Bernard: introducing PyMOL, a Python package for studying chemical structures.
  • Novelty and Outlier Detection by Reuven M. Lerner: we look at a number of ways you can try to identify outliers using the tools and libraries that Python provides for working with data: NumPy, Pandas and scikit-learn.
  • Learning Data Science by Reuven M. Lerner: I’ve written a lot about data science and machine learning. In case my enthusiasm wasn’t obvious from my writing, let me say it plainly: it has been a long time since I last encountered a technology that was so poised to revolutionize the world in which we live.
  • Classifying Text by Reuven M. Lerner: I want to bring your attention to a surprisingly simple—but powerful and widespread—use of machine learning, namely document classification.
  • Pythonic Science in the Browser by Joey Bernard: the web browser interface has become the de facto way of doing scientific programming with Python. It has become so popular in fact, it has spun off as its own project, named Jupyter. In this article, I take a look at how to get the latest version up and running, and I discuss the kinds of things you can do with it once it is set up.

Source

Download Vala Linux 0.42.3

Vala is an open source, free and modern programming language and software project designed from the offset to bring new programming features to GNOME developers. It is a compiler for the GObject type system, allowing GNOME developers to create astonishing apps.

Features at a glance

Key features include interfaces, properties, signals, foreach, lambda expressions, type inference for local variables, generics, non-null types, assisted memory management, exception handling, as well as type modules a.k.a. plugins.

Effortlessly write complex object-oriented code

With the Vala compiler you, as a developer, will be able to effortlessly write complex object-oriented code while keeping the memory requirements low, and maintaining a standard C ABI and API.

Allows access to existing C libraries

The project has been designed in such a way that it allows access to existing C libraries, especially GObject-based libraries, without the need for runtime bindings.

It’s perfect for GTK+ and GNOME

Vala is a command-line compiler and programming languages. Developers who work with GTK+ and GNOME will be able to use Vala to write the code and compile it.

It’s influenced by C++, C, C#,Python, D and Java

The Vala programming language has been influenced by the well known and widely used C, C++, D, Python, C# and Java programming languages. It is a cross-platform software that can be easily ported on other operating systems.

It is supported by a wide range of IDE programs

Another interesting feature is the compatibility with various IDE (Integrated Development Environment) programs, including Anjuta, Valencia, Geany, Emacs, MonoDevelop, NetBeans, Val(a)IDE, Sublime Text, Vim, Vala Toys for Gedit, Euclide, RedCar, TextMate and Valama.

Availability and supported architectures

Vala is distributed only as a source archive. This means that the user must configure and compile the code prior to installation. Of course, it can also be easily installed on any GNU/Linux distribution from the default software repositories. Both 32-bit and 64-bit architectures are supported at this time.

Source

2018 Mac Mini blocks Linux, here are alternative small form factor PCs

Apple’s long-awaited refresh of the Mac Mini includes a component called the “T2 Security Chip” which Apple touts as having “a Secure Enclave coprocessor, which provides the foundation for APFS encrypted storage, secure boot, and Touch ID on Mac,” as well as integrating “the system management controller, image signal processor, audio controller, and SSD controller,” which were separate components in previous Mac systems. Because of the extent to which T2 is involved with the boot sequence of this new hardware, Apple controls what operating systems can be loaded onto their hardware.

While Apple provides a way to unlock parts of this process using Boot Camp Assistant to enable installation of Windows, Apple’s documentation (PDF link) indicates that “there is currently no trust provided for the the Microsoft Corporation UEFI CA 2011, which would allow verification of code signed by Microsoft partners. This UEFI CA is commonly used to verify the authenticity of bootloaders for other operating systems such as Linux variants.”

SEE: Comparison chart: NAS devices (Tech Pro Research)

Because of this restriction, the Mac Mini is not suitable for users looking for a small form factor (SFF) PC to install Linux on. Though it may seem counterintuitive to purchase a Mac to not run OS X, Apple’s diminutive SFF PCs remain popular options with Linux users since they were introduced in 2005. Since that time, other manufacturers have introduced compelling miniature PCs with robust support for Windows and Linux, with easier access to internals for component upgrades.

Intel “Hades Canyon” NUC series

nuc8i7hvk.jpg

The Hades Canyon series includes a front-facing HDMI port for connecting a VR headset.

Image: Intel

Intel’s Next Unit of Computing (NUC) series, introduced in 2013, is perhaps the second most well-known brand of SFF PCs. Intel sells NUC systems as barebones kits, requiring the user to add their own memory and drive. Of these, the Kaby Lake-G, also known as “Hades Canyon” series are by far the most powerful, as they fuse Intel’s 8th generation Core CPUs with a custom AMD Radeon RX Vega M GPU on chip, providing a significant graphics performance benefit over the Intel UHD Graphics 630 found in the Mac Mini. The Hades Canyon NUCs have a wealth of ports, including two HDMI 2.0 and two ThunderBolt 3 USB-C ports, as well as five USB 3.0 Type-A, one USB 3.1 Gen 2 Type-C, and one USB 3.1 Gen 2 Type-A ports, and two Gigabit Ethernet ports.

The NUC8i7HVK has a quad core i7‑8809G, rated for 3.1 GHz base/4.2 GHz turbo, with 8MB L3 cache, with an AMD GPU with 24 computing and 1536 shading units, rated for 1063 MHz base/1190 MHz turbo, paired with 4GB of HBM2 memory. It can be equipped with up to 64 GB RAM and has two PCIe 2.0 x4 linked M.2 slots. Intel was asking $999 at launch, though was discounted almost immediately thereafter. (Amazon sells it for $849.)

The NUC8i7HNK offers the same ports, but has a modestly less powerful CPU and GPU, smaller cache, and the CPU is locked on this model, preventing overclocking. The average $100 cost savings on this model is not worth the performance penalty. The case is not as visually appealing as the Mac Mini, but the LED Skull on the case is software-controlled and can be easily disabled, making it invisible. The case is slightly more retangular than the Mac Mini, making it modestly longer, though not as deep at 8.7 x 5.5 x 1.5″ (221.0 x 139.7 x 38.1 mm).

Intel Coffee Lake NUC series

The Coffee Lake series of NUCs share the same case style. All three models include additional headroom to store a 2.5″ HDD or SSD, as pictured, though the Core i5 and i3 models have a shorter variant which use only an M.2 SSD.

Image: Intel

For those who do not need a discrete GPU, the Coffee Lake series NUCs are affordable alternatives. That said, the Iris Plus Graphics 655 featured in the Coffee Lake NUCs have 48 execution and 384 shading units, double that of the CPUs used in the 2018 Mac Mini. Iris Plus also features 128 MB eDRAM, while the UHD Graphics 630 has none. The Coffee Lake NUCs have four USB 3.1 Gen 2 Type-A ports, and one ThunderBolt 3 USB-C port, as well as one HDMI 2.0, and one Gigabit Ethernet port each. The Coffee Lake series can be equipped with up to 64 GB RAM.

  • The high-end NUC8i7BEH has a quad-core i7-8559U, rated for 2.7 GHz base/4.5 GHz turbo, and space for one 2.5″ and one M.2 drive, and retails for $469.
  • The mid-range NUC8i5BEH has a quad-core i5-8259U, rated for 2.3 GHz base 3.8 GHz turbo, and space for one 2.5″ and one M.2 drive. While the NUC8i5BEK has only space for one M.2 drive. Both retail for $360.
  • The low-end NUC8i3BEH has a dual-core i3-8109U, rated for 3.0 GHz base/3.6 GHz turbo, and space for one 2.5″ and one M.2 drive. While the NUC8i3BEK has only space for one M.2 drive. Both retail for $275.
  • The Coffee Lake NUCs are smaller than the Mac Mini, measuring in at 4.6 x 4.4 x 2.0″ (116.8 x 111.8 x 50.8 mm), with models lacking space for a 2.5″ drive decrease height to 1.4″ (35.6 mm).

Gigabyte Brix

Like Intel’s Coffee Lake NUCs, the Gigabyte Brix series of SFF PCs include space for a 2.5″ HDD or SSD, as pictured, though shorter variants which use only M.2 SSDs are also available.

Image: Gigabyte

Popular motherboard manufacturer Gigabyte also offers a variety of configurations in their Brix lineup of SFF PCs, from the high-end Intel Core i7 to low-power Celeron offerings.

For the current generation of Brix systems, the GB-BRI7H-8550 is powered by a quad-core i7-8550U, rated for 1.8 GHz base/4.0 GHz turbo, space for one 2.5″ and one M.2 drive, and retails for $499. It measures in at 4.7 x 4.43 x 1.84″ (119.4 x 112.6 x 46.8 mm) with the GB-BRi7-8550 removing space for the 2.5″ drive, decreasing height to 1.35″ (34.4 mm).

Source

WP2Social Auto Publish Powered By : XYZScripts.com