hr

Code injection, error throwing

In a blog, Opera Software Developer Relations team member Tiffany B. Brown looks at code injection, error throwing and handling and mobile debugging. She notes Opera Dragonfly and its remote debug features provide a way to debug mobile sites from their desktop. Brown mentions WebKit’s recently added remote debugging capabilities, folded into Google Chrome developer Read the rest...




hr

Vert.x ramblings: Asynchronous network, your time has come

With the debut of Vert.x, the asynchronous framework is reaching an inflection point, suggests Andrew Cholakian. With Vert.x, the software is packaged together in such a way as to be extremely practical, he states. For some JVM zealots, Vert.x may meet needs recently and apparently addressed by node.js. Vert.x is an asynchronous application server – Read the rest...





hr

The Three Levels of Emotional Design

To design positive emotional experiences you must understand human emotion. The subject of emotions is complex largely because everything we do is either influenced by, or directly caused by, emotion. Factor in the range and capacity different individuals have for emotion, add in the fact most emotions occur subconsciously, and round this out with the […]

The post The Three Levels of Emotional Design appeared first on Psychology of Web Design | 3.7 Blog.




hr

Monochrome beach

From Ølberg Strand. Taken with iPhone 11 Pro wide-angle and given some Lightroom fixes for sky effect.




hr

Christmas




hr

Three Principles to Remember for Successful Recovery

When it comes to TBI and PTSD, everyone's recovery is different. But Adam shares three key principles that can be crucial for everyone.




hr

Every Day A Post of WordPress Tips and Tricks until Christmas!

The time has come and our loyal reader know already our traditional Advents Calendar. For the people who don’t know, […]




hr

Intuition, Creative Freedom & Doing What You Love with Chris Ballew

Today’s episode is going to rock your world … pun fully intended because today’s guest is an actual rock star. You may remember a band called Presidents of the United States of America. They took the world by storm in 1995 with their self titled album, Presidents of the United States of America playing songs like Lump and Peaches. Yes, that’s right. My guest today is frontman Chris Ballew. Chris and I have been friends for years, including collaborating on a music video together and at least one live performance (gotta listen to find out ;). Of course we get into his musical journey, a meteoric rise to success, and then realizing something was missing. We take some deep dives into Chris’ creative process, including his method for capturing his small bits and later using those to write new works, including his new project Casper Babypants. In this episode: Consider what kind of artist you are and how you relate to other artists. For years Chris played in bands, but what he learned about himself is his work is actually solo. Don’t censor yourself while you’re creating. Get it out, no matter how crazy or ridiculous or unusual and then […]

The post Intuition, Creative Freedom & Doing What You Love with Chris Ballew appeared first on Chase Jarvis Photography.




hr

Adaptation, Self-Awareness and Art of the Side Hustle with Chris Guillebeau

Chris Guillebeau has traveled to 193 countries. And just to be clear, that is all of the countries recognized on the planet. He is the first person to do it before the age of 35. More importantly, he has built online businesses, side hustles, and mastered the art of a non-conforming lifestyle since he was 19 years old. There’s almost nobody better person equipped to talk about starting lots of businesses. He has a daily podcast called Side Hustle School where he’s featured more than 850 different side hustle businesses + featured many in his new book called 100 Side Hustles. Chris also started half a dozen or more himself, started one of my favorite conferences, The World Domination Summit, and is a New York Times bestselling author of books like the $100 Start Up and The Art of Non-Conformity and many others. This guy is a beast and he’s so savvy, so humble. In this episode: We go into details about some of Chris’ favorite side hustle businesses he’s come across in his podcast & writing this book – what are some of the most common traits and failures. Chris shares his experience with depression, how he’s faced it, […]

The post Adaptation, Self-Awareness and Art of the Side Hustle with Chris Guillebeau appeared first on Chase Jarvis Photography.




hr

Chris Burkard: Say Yes to What You Want

Today’s guest is one many of you have been asking for oh-so-long. He’s one of the top travel, outdoor, and landscape photographers in the world, bringing us to some of the most untamed and powerful landscapes in the pursuit of powerful stories, hidden surf, and a good adventure. Of course in this episode we get into his new book, At Glacier’s End, but we also get into some meaty topics such as: the power of exploring personal projects and how it can shape new opportunities the sacrifice that comes as pursing your passions personal growth and how it evolves over time and so much more Enjoy! FOLLOW CHRIS: instagram | twitter | website Listen to the Podcast Subscribe   Watch the Episode  This podcast is brought to you by CreativeLive. CreativeLive is the world’s largest hub for online creative education in photo/video, art/design, music/audio, craft/maker, money/life and the ability to make a living in any of those disciplines. They are high quality, highly curated classes taught by the world’s top experts — Pulitzer, Oscar, Grammy Award winners, New York Times best selling authors and the best entrepreneurs of our times.

The post Chris Burkard: Say Yes to What You Want appeared first on Chase Jarvis Photography.




hr

Surviving + Thriving with Jasmine Star

If you missed my conversation with my dear friend photographer + entrepreneur Jasmine Star, we were LIVE on CreativeLive TV. CreativeLiveTV is a brand-new, free, 24/7 variety show, live-streamed from the very casual living rooms, studios, and kitchen tables of our worldwide community of legendary creators.  Worth checking out over at http://creativelive.com/tv. In this episode, we’re coming to you from our living rooms to chat about not just survive in these strange times, but to thrive. In particular, finding, participating, and growing your online community. Enjoy! FOLLOW JASMINE: instagram | twitter | website Listen to the Podcast Subscribe   Watch the Episode This podcast is brought to you by CreativeLive. CreativeLive is the world’s largest hub for online creative education in photo/video, art/design, music/audio, craft/maker, money/life and the ability to make a living in any of those disciplines. They are high quality, highly curated classes taught by the world’s top experts — Pulitzer, Oscar, Grammy Award winners, New York Times best selling authors and the best entrepreneurs of our times.

The post Surviving + Thriving with Jasmine Star appeared first on Chase Jarvis Photography.




hr

Concurrency & Multithreading in iOS

Concurrency is the notion of multiple things happening at the same time. This is generally achieved either via time-slicing, or truly in parallel if multiple CPU cores are available to the host operating system. We've all experienced a lack of concurrency, most likely in the form of an app freezing up when running a heavy task. UI freezes don't necessarily occur due to the absence of concurrency — they could just be symptoms of buggy software — but software that doesn't take advantage of all the computational power at its disposal is going to create these freezes whenever it needs to do something resource-intensive. If you've profiled an app hanging in this way, you'll probably see a report that looks like this:

Anything related to file I/O, data processing, or networking usually warrants a background task (unless you have a very compelling excuse to halt the entire program). There aren't many reasons that these tasks should block your user from interacting with the rest of your application. Consider how much better the user experience of your app could be if instead, the profiler reported something like this:

Analyzing an image, processing a document or a piece of audio, or writing a sizeable chunk of data to disk are examples of tasks that could benefit greatly from being delegated to background threads. Let's dig into how we can enforce such behavior into our iOS applications.


A Brief History

In the olden days, the maximum amount of work per CPU cycle that a computer could perform was determined by the clock speed. As processor designs became more compact, heat and physical constraints started becoming limiting factors for higher clock speeds. Consequentially, chip manufacturers started adding additional processor cores on each chip in order to increase total performance. By increasing the number of cores, a single chip could execute more CPU instructions per cycle without increasing its speed, size, or thermal output. There's just one problem...

How can we take advantage of these extra cores? Multithreading.

Multithreading is an implementation handled by the host operating system to allow the creation and usage of n amount of threads. Its main purpose is to provide simultaneous execution of two or more parts of a program to utilize all available CPU time. Multithreading is a powerful technique to have in a programmer's toolbelt, but it comes with its own set of responsibilities. A common misconception is that multithreading requires a multi-core processor, but this isn't the case — single-core CPUs are perfectly capable of working on many threads, but we'll take a look in a bit as to why threading is a problem in the first place. Before we dive in, let's look at the nuances of what concurrency and parallelism mean using a simple diagram:

In the first situation presented above, we observe that tasks can run concurrently, but not in parallel. This is similar to having multiple conversations in a chatroom, and interleaving (context-switching) between them, but never truly conversing with two people at the same time. This is what we call concurrency. It is the illusion of multiple things happening at the same time when in reality, they're switching very quickly. Concurrency is about dealing with lots of things at the same time. Contrast this with the parallelism model, in which both tasks run simultaneously. Both execution models exhibit multithreading, which is the involvement of multiple threads working towards one common goal. Multithreading is a generalized technique for introducing a combination of concurrency and parallelism into your program.


The Burden of Threads

A modern multitasking operating system like iOS has hundreds of programs (or processes) running at any given moment. However, most of these programs are either system daemons or background processes that have very low memory footprint, so what is really needed is a way for individual applications to make use of the extra cores available. An application (process) can have many threads (sub-processes) operating on shared memory. Our goal is to be able to control these threads and use them to our advantage.

Historically, introducing concurrency to an app has required the creation of one or more threads. Threads are low-level constructs that need to be managed manually. A quick skim through Apple's Threaded Programming Guide is all it takes to see how much complexity threaded code adds to a codebase. In addition to building an app, the developer has to:

  • Responsibly create new threads, adjusting that number dynamically as system conditions change
  • Manage them carefully, deallocating them from memory once they have finished executing
  • Leverage synchronization mechanisms like mutexes, locks, and semaphores to orchestrate resource access between threads, adding even more overhead to application code
  • Mitigate risks associated with coding an application that assumes most of the costs associated with creating and maintaining any threads it uses, and not the host OS

This is unfortunate, as it adds enormous levels of complexity and risk without any guarantees of improved performance.


Grand Central Dispatch

iOS takes an asynchronous approach to solving the concurrency problem of managing threads. Asynchronous functions are common in most programming environments, and are often used to initiate tasks that might take a long time, like reading a file from the disk, or downloading a file from the web. When invoked, an asynchronous function executes some work behind the scenes to start a background task, but returns immediately, regardless of how long the original task might takes to actually complete.

A core technology that iOS provides for starting tasks asynchronously is Grand Central Dispatch (or GCD for short). GCD abstracts away thread management code and moves it down to the system level, exposing a light API to define tasks and execute them on an appropriate dispatch queue. GCD takes care of all thread management and scheduling, providing a holistic approach to task management and execution, while also providing better efficiency than traditional threads.

Let's take a look at the main components of GCD:

What've we got here? Let's start from the left:

  • DispatchQueue.main: The main thread, or the UI thread, is backed by a single serial queue. All tasks are executed in succession, so it is guaranteed that the order of execution is preserved. It is crucial that you ensure all UI updates are designated to this queue, and that you never run any blocking tasks on it. We want to ensure that the app's run loop (called CFRunLoop) is never blocked in order to maintain the highest framerate. Subsequently, the main queue has the highest priority, and any tasks pushed onto this queue will get executed immediately.
  • DispatchQueue.global: A set of global concurrent queues, each of which manage their own pool of threads. Depending on the priority of your task, you can specify which specific queue to execute your task on, although you should resort to using default most of the time. Because tasks on these queues are executed concurrently, it doesn't guarantee preservation of the order in which tasks were queued.

Notice how we're not dealing with individual threads anymore? We're dealing with queues which manage a pool of threads internally, and you will shortly see why queues are a much more sustainable approach to multhreading.

Serial Queues: The Main Thread

As an exercise, let's look at a snippet of code below, which gets fired when the user presses a button in the app. The expensive compute function can be anything. Let's pretend it is post-processing an image stored on the device.

import UIKit

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        compute()
    }

    private func compute() -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

At first glance, this may look harmless, but if you run this inside of a real app, the UI will freeze completely until the loop is terminated, which will take... a while. We can prove it by profiling this task in Instruments. You can fire up the Time Profiler module of Instruments by going to Xcode > Open Developer Tool > Instruments in Xcode's menu options. Let's look at the Threads module of the profiler and see where the CPU usage is highest.

We can see that the Main Thread is clearly at 100% capacity for almost 5 seconds. That's a non-trivial amount of time to block the UI. Looking at the call tree below the chart, we can see that the Main Thread is at 99.9% capacity for 4.43 seconds! Given that a serial queue works in a FIFO manner, tasks will always complete in the order in which they were inserted. Clearly the compute() method is the culprit here. Can you imagine clicking a button just to have the UI freeze up on you for that long?

Background Threads

How can we make this better? DispatchQueue.global() to the rescue! This is where background threads come in. Referring to the GCD architecture diagram above, we can see that anything that is not the Main Thread is a background thread in iOS. They can run alongside the Main Thread, leaving it fully unoccupied and ready to handle other UI events like scrolling, responding to user events, animating etc. Let's make a small change to our button click handler above:

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
            self.compute()
        }
    }

    private func compute() -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

Unless specified, a snippet of code will usually default to execute on the Main Queue, so in order to force it to execute on a different thread, we'll wrap our compute call inside of an asynchronous closure that gets submitted to the DispatchQueue.global queue. Keep in mind that we aren't really managing threads here. We're submitting tasks (in the form of closures or blocks) to the desired queue with the assumption that it is guaranteed to execute at some point in time. The queue decides which thread to allocate the task to, and it does all the hard work of assessing system requirements and managing the actual threads. This is the magic of Grand Central Dispatch. As the old adage goes, you can't improve what you can't measure. So we measured our truly terrible button click handler, and now that we've improved it, we'll measure it once again to get some concrete data with regards to performance.

Looking at the profiler again, it's quite clear to us that this is a huge improvement. The task takes an identical amount of time, but this time, it's happening in the background without locking up the UI. Even though our app is doing the same amount of work, the perceived performance is much better because the user will be free to do other things while the app is processing.

You may have noticed that we accessed a global queue of .userInitiated priority. This is an attribute we can use to give our tasks a sense of urgency. If we run the same task on a global queue of and pass it a qos attribute of background , iOS will think it's a utility task, and thus allocate fewer resources to execute it. So, while we don't have control over when our tasks get executed, we do have control over their priority.

A Note on Main Thread vs. Main Queue

You might be wondering why the Profiler shows "Main Thread" and why we're referring to it as the "Main Queue". If you refer back to the GCD architecture we described above, the Main Queue is solely responsible for managing the Main Thread. The Dispatch Queues section in the Concurrency Programming Guide says that "the main dispatch queue is a globally available serial queue that executes tasks on the application’s main thread. Because it runs on your application’s main thread, the main queue is often used as a key synchronization point for an application."

The terms "execute on the Main Thread" and "execute on the Main Queue" can be used interchangeably.


Concurrent Queues

So far, our tasks have been executed exclusively in a serial manner. DispatchQueue.main is by default a serial queue, and DispatchQueue.global gives you four concurrent dispatch queues depending on the priority parameter you pass in.

Let's say we want to take five images, and have our app process them all in parallel on background threads. How would we go about doing that? We can spin up a custom concurrent queue with an identifier of our choosing, and allocate those tasks there. All that's required is the .concurrent attribute during the construction of the queue.

class ViewController: UIViewController {
    let queue = DispatchQueue(label: "com.app.concurrentQueue", attributes: .concurrent)
    let images: [UIImage] = [UIImage].init(repeating: UIImage(), count: 5)

    @IBAction func handleTap(_ sender: Any) {
        for img in images {
            queue.async { [unowned self] in
                self.compute(img)
            }
        }
    }

    private func compute(_ img: UIImage) -> Void {
        // Pretending to post-process a large image.
        var counter = 0
        for _ in 0..<9999999 {
            counter += 1
        }
    }
}

Running that through the profiler, we can see that the app is now spinning up 5 discrete threads to parallelize a for-loop.

Parallelization of N Tasks

So far, we've looked at pushing computationally expensive task(s) onto background threads without clogging up the UI thread. But what about executing parallel tasks with some restrictions? How can Spotify download multiple songs in parallel, while limiting the maximum number up to 3? We can go about this in a few ways, but this is a good time to explore another important construct in multithreaded programming: semaphores.

Semaphores are signaling mechanisms. They are commonly used to control access to a shared resource. Imagine a scenario where a thread can lock access to a certain section of the code while it executes it, and unlocks after it's done to let other threads execute the said section of the code. You would see this type of behavior in database writes and reads, for example. What if you want only one thread writing to a database and preventing any reads during that time? This is a common concern in thread-safety called Readers-writer lock. Semaphores can be used to control concurrency in our app by allowing us to lock n number of threads.

let kMaxConcurrent = 3 // Or 1 if you want strictly ordered downloads!
let semaphore = DispatchSemaphore(value: kMaxConcurrent)
let downloadQueue = DispatchQueue(label: "com.app.downloadQueue", attributes: .concurrent)

class ViewController: UIViewController {
    @IBAction func handleTap(_ sender: Any) {
        for i in 0..<15 {
            downloadQueue.async { [unowned self] in
                // Lock shared resource access
                semaphore.wait()

                // Expensive task
                self.download(i + 1)

                // Update the UI on the main thread, always!
                DispatchQueue.main.async {
                    tableView.reloadData()

                    // Release the lock
                    semaphore.signal()
                }
            }
        }
    }

    func download(_ songId: Int) -> Void {
        var counter = 0

        // Simulate semi-random download times.
        for _ in 0..<Int.random(in: 999999...10000000) {
            counter += songId
        }
    }
}

Notice how we've effectively restricted our download system to limit itself to k number of downloads. The moment one download finishes (or thread is done executing), it decrements the semaphore, allowing the managing queue to spawn another thread and start downloading another song. You can apply a similar pattern to database transactions when dealing with concurrent reads and writes.

Semaphores usually aren't necessary for code like the one in our example, but they become more powerful when you need to enforce synchronous behavior whille consuming an asynchronous API. The above could would work just as well with a custom NSOperationQueue with a maxConcurrentOperationCount, but it's a worthwhile tangent regardless.


Finer Control with OperationQueue

GCD is great when you want to dispatch one-off tasks or closures into a queue in a 'set-it-and-forget-it' fashion, and it provides a very lightweight way of doing so. But what if we want to create a repeatable, structured, long-running task that produces associated state or data? And what if we want to model this chain of operations such that they can be cancelled, suspended and tracked, while still working with a closure-friendly API? Imagine an operation like this:

This would be quite cumbersome to achieve with GCD. We want a more modular way of defining a group of tasks while maintaining readability and also exposing a greater amount of control. In this case, we can use Operation objects and queue them onto an OperationQueue, which is a high-level wrapper around DispatchQueue. Let's look at some of the benefits of using these abstractions and what they offer in comparison to the lower-level GCI API:

  • You may want to create dependencies between tasks, and while you could do this via GCD, you're better off defining them concretely as Operation objects, or units of work, and pushing them onto your own queue. This would allow for maximum reusability since you may use the same pattern elsewhere in an application.
  • The Operation and OperationQueue classes have a number of properties that can be observed, using KVO (Key Value Observing). This is another important benefit if you want to monitor the state of an operation or operation queue.
  • Operations can be paused, resumed, and cancelled. Once you dispatch a task using Grand Central Dispatch, you no longer have control or insight into the execution of that task. The Operation API is more flexible in that respect, giving the developer control over the operation's life cycle.
  • OperationQueue allows you to specify the maximum number of queued operations that can run simultaneously, giving you a finer degree of control over the concurrency aspects.

The usage of Operation and OperationQueue could fill an entire blog post, but let's look at a quick example of what modeling dependencies looks like. (GCD can also create dependencies, but you're better off dividing up large tasks into a series of composable sub-tasks.) In order to create a chain of operations that depend on one another, we could do something like this:

class ViewController: UIViewController {
    var queue = OperationQueue()
    var rawImage = UIImage? = nil
    let imageUrl = URL(string: "https://example.com/portrait.jpg")!
    @IBOutlet weak var imageView: UIImageView!

    let downloadOperation = BlockOperation {
        let image = Downloader.downloadImageWithURL(url: imageUrl)
        OperationQueue.main.async {
            self.rawImage = image
        }
    }

    let filterOperation = BlockOperation {
        let filteredImage = ImgProcessor.addGaussianBlur(self.rawImage)
        OperationQueue.main.async {
            self.imageView = filteredImage
        }
    }

    filterOperation.addDependency(downloadOperation)

    [downloadOperation, filterOperation].forEach {
        queue.addOperation($0)
     }
}

So why not opt for a higher level abstraction and avoid using GCD entirely? While GCD is ideal for inline asynchronous processing, Operation provides a more comprehensive, object-oriented model of computation for encapsulating all of the data around structured, repeatable tasks in an application. Developers should use the highest level of abstraction possible for any given problem, and for scheduling consistent, repeated work, that abstraction is Operation. Other times, it makes more sense to sprinkle in some GCD for one-off tasks or closures that we want to fire. We can mix both OperationQueue and GCD to get the best of both worlds.


The Cost of Concurrency

DispatchQueue and friends are meant to make it easier for the application developer to execute code concurrently. However, these technologies do not guarantee improvements to the efficiency or responsiveness in an application. It is up to you to use queues in a manner that is both effective and does not impose an undue burden on other resources. For example, it's totally viable to create 10,000 tasks and submit them to a queue, but doing so would allocate a nontrivial amount of memory and introduce a lot of overhead for the allocation and deallocation of operation blocks. This is the opposite of what you want! It's best to profile your app thoroughly to ensure that concurrency is enhancing your app's performance and not degrading it.

We've talked about how concurrency comes at a cost in terms of complexity and allocation of system resources, but introducing concurrency also brings a host of other risks like:

  • Deadlock: A situation where a thread locks a critical portion of the code and can halt the application's run loop entirely. In the context of GCD, you should be very careful when using the dispatchQueue.sync { } calls as you could easily get yourself in situations where two synchronous operations can get stuck waiting for each other.
  • Priority Inversion: A condition where a lower priority task blocks a high priority task from executing, which effectively inverts their priorities. GCD allows for different levels of priority on its background queues, so this is quite easily a possibility.
  • Producer-Consumer Problem: A race condition where one thread is creating a data resource while another thread is accessing it. This is a synchronization problem, and can be solved using locks, semaphores, serial queues, or a barrier dispatch if you're using concurrent queues in GCD.
  • ...and many other sorts of locking and data-race conditions that are hard to debug! Thread safety is of the utmost concern when dealing with concurrency.

Parting Thoughts + Further Reading

If you've made it this far, I applaud you. Hopefully this article gives you a lay of the land when it comes to multithreading techniques on iOS, and how you can use some of them in your app. We didn't get to cover many of the lower-level constructs like locks, mutexes and how they help us achieve synchronization, nor did we get to dive into concrete examples of how concurrency can hurt your app. We'll save those for another day, but you can dig into some additional reading and videos if you're eager to dive deeper.




hr

Differentiating through Log-Log Convex Programs. (arXiv:2004.12553v2 [math.OC] UPDATED)

We show how to efficiently compute the derivative (when it exists) of the solution map of log-log convex programs (LLCPs). These are nonconvex, nonsmooth optimization problems with positive variables that become convex when the variables, objective functions, and constraint functions are replaced with their logs. We focus specifically on LLCPs generated by disciplined geometric programming, a grammar consisting of a set of atomic functions with known log-log curvature and a composition rule for combining them. We represent a parametrized LLCP as the composition of a smooth transformation of parameters, a convex optimization problem, and an exponential transformation of the convex optimization problem's solution. The derivative of this composition can be computed efficiently, using recently developed methods for differentiating through convex optimization problems. We implement our method in CVXPY, a Python-embedded modeling language and rewriting system for convex optimization. In just a few lines of code, a user can specify a parametrized LLCP, solve it, and evaluate the derivative or its adjoint at a vector. This makes it possible to conduct sensitivity analyses of solutions, given perturbations to the parameters, and to compute the gradient of a function of the solution with respect to the parameters. We use the adjoint of the derivative to implement differentiable log-log convex optimization layers in PyTorch and TensorFlow. Finally, we present applications to designing queuing systems and fitting structured prediction models.




hr

Three-point Functions in $mathcal{N}=4$ SYM at Finite $N_c$ and Background Independence. (arXiv:2002.07216v2 [hep-th] UPDATED)

We compute non-extremal three-point functions of scalar operators in $mathcal{N}=4$ super Yang-Mills at tree-level in $g_{YM}$ and at finite $N_c$, using the operator basis of the restricted Schur characters. We make use of the diagrammatic methods called quiver calculus to simplify the three-point functions. The results involve an invariant product of the generalized Racah-Wigner tensors ($6j$ symbols). Assuming that the invariant product is written by the Littlewood-Richardson coefficients, we show that the non-extremal three-point functions satisfy the large $N_c$ background independence; correspondence between the string excitations on $AdS_5 imes S^5$ and those in the LLM geometry.




hr

A stochastic approach to the synchronization of coupled oscillators. (arXiv:2002.04472v2 [nlin.AO] UPDATED)

This paper deals with an optimal control problem associated to the Kuramoto model describing the dynamical behavior of a network of coupled oscillators. Our aim is to design a suitable control function allowing us to steer the system to a synchronized configuration in which all the oscillators are aligned on the same phase. This control is computed via the minimization of a given cost functional associated with the dynamics considered. For this minimization, we propose a novel approach based on the combination of a standard Gradient Descent (GD) methodology with the recently-developed Random Batch Method (RBM) for the efficient numerical approximation of collective dynamics. Our simulations show that the employment of RBM improves the performances of the GD algorithm, reducing the computational complexity of the minimization process and allowing for a more efficient control calculation.




hr

Monochromatic Equilateral Triangles in the Unit Distance Graph. (arXiv:1909.09856v2 [math.CO] UPDATED)

Let $chi_{Delta}(mathbb{R}^{n})$ denote the minimum number of colors needed to color $mathbb{R}^{n}$ so that there will not be a monochromatic equilateral triangle with side length $1$. Using the slice rank method, we reprove a result of Frankl and Rodl, and show that $chi_{Delta}left(mathbb{R}^{n} ight)$ grows exponentially with $n$. This technique substantially improves upon the best known quantitative lower bounds for $chi_{Delta}left(mathbb{R}^{n} ight)$, and we obtain [ chi_{Delta}left(mathbb{R}^{n} ight)>(1.01446+o(1))^{n}. ]




hr

Lorentz estimates for quasi-linear elliptic double obstacle problems involving a Schr"odinger term. (arXiv:2005.03281v1 [math.AP])

Our goal in this article is to study the global Lorentz estimates for gradient of weak solutions to $p$-Laplace double obstacle problems involving the Schr"odinger term: $-Delta_p u + mathbb{V}|u|^{p-2}u$ with bound constraints $psi_1 le u le psi_2$ in non-smooth domains. This problem has its own interest in mathematics, engineering, physics and other branches of science. Our approach makes a novel connection between the study of Calder'on-Zygmund theory for nonlinear Schr"odinger type equations and variational inequalities for double obstacle problems.




hr

On the Gorenstein property of the Ehrhart ring of the stable set polytope of an h-perfect graph. (arXiv:2005.03259v1 [math.CO])

In this paper, we give a criterion of the Gorenstein property of the Ehrhart ring of the stable set polytope of an h-perfect graph: the Ehrhart ring of the stable set polytope of an h-perfect graph $G$ is Gorenstein if and only if (1) sizes of maximal cliques are constant (say $n$) and (2) (a) $n=1$, (b) $n=2$ and there is no odd cycle without chord and length at least 7 or (c) $ngeq 3$ and there is no odd cycle without chord and length at least 5.




hr

Quasi-Sure Stochastic Analysis through Aggregation and SLE$_kappa$ Theory. (arXiv:2005.03152v1 [math.PR])

We study SLE$_{kappa}$ theory with elements of Quasi-Sure Stochastic Analysis through Aggregation. Specifically, we show how the latter can be used to construct the SLE$_{kappa}$ traces quasi-surely (i.e. simultaneously for a family of probability measures with certain properties) for $kappa in mathcal{K}cap mathbb{R}_+ setminus ([0, epsilon) cup {8})$, for any $epsilon>0$ with $mathcal{K} subset mathbb{R}_{+}$ a nontrivial compact interval, i.e. for all $kappa$ that are not in a neighborhood of zero and are different from $8$. As a by-product of the analysis, we show in this language a version of the continuity in $kappa$ of the SLE$_{kappa}$ traces for all $kappa$ in compact intervals as above.




hr

Provenance for the Description Logic ELHr. (arXiv:2001.07541v2 [cs.LO] UPDATED)

We address the problem of handling provenance information in ELHr ontologies. We consider a setting recently introduced for ontology-based data access, based on semirings and extending classical data provenance, in which ontology axioms are annotated with provenance tokens. A consequence inherits the provenance of the axioms involved in deriving it, yielding a provenance polynomial as an annotation. We analyse the semantics for the ELHr case and show that the presence of conjunctions poses various difficulties for handling provenance, some of which are mitigated by assuming multiplicative idempotency of the semiring. Under this assumption, we study three problems: ontology completion with provenance, computing the set of relevant axioms for a consequence, and query answering.




hr

QuickSync: A Quickly Synchronizing PoS-Based Blockchain Protocol. (arXiv:2005.03564v1 [cs.CR])

To implement a blockchain, we need a blockchain protocol for all the nodes to follow. To design a blockchain protocol, we need a block publisher selection mechanism and a chain selection rule. In Proof-of-Stake (PoS) based blockchain protocols, block publisher selection mechanism selects the node to publish the next block based on the relative stake held by the node. However, PoS protocols may face vulnerability to fully adaptive corruptions. In literature, researchers address this issue at the cost of performance.

In this paper, we propose a novel PoS-based blockchain protocol, QuickSync, to achieve security against fully adaptive corruptions without compromising on performance. We propose a metric called block power, a value defined for each block, derived from the output of the verifiable random function based on the digital signature of the block publisher. With this metric, we compute chain power, the sum of block powers of all the blocks comprising the chain, for all the valid chains. These metrics are a function of the block publisher's stake to enable the PoS aspect of the protocol. The chain selection rule selects the chain with the highest chain power as the one to extend. This chain selection rule hence determines the selected block publisher of the previous block. When we use metrics to define the chain selection rule, it may lead to vulnerabilities against Sybil attacks. QuickSync uses a Sybil attack resistant function implemented using histogram matching. We prove that QuickSync satisfies common prefix, chain growth, and chain quality properties and hence it is secure. We also show that it is resilient to different types of adversarial attack strategies. Our analysis demonstrates that QuickSync performs better than Bitcoin by an order of magnitude on both transactions per second and time to finality, and better than Ouroboros v1 by a factor of three on time to finality.




hr

An asynchronous distributed and scalable generalized Nash equilibrium seeking algorithm for strongly monotone games. (arXiv:2005.03507v1 [cs.GT])

In this paper, we present three distributed algorithms to solve a class of generalized Nash equilibrium (GNE) seeking problems in strongly monotone games. The first one (SD-GENO) is based on synchronous updates of the agents, while the second and the third (AD-GEED and AD-GENO) represent asynchronous solutions that are robust to communication delays. AD-GENO can be seen as a refinement of AD-GEED, since it only requires node auxiliary variables, enhancing the scalability of the algorithm. Our main contribution is to prove converge to a variational GNE of the game via an operator-theoretic approach. Finally, we apply the algorithms to network Cournot games and show how different activation sequences and delays affect convergence. We also compare the proposed algorithms to the only other in the literature (ADAGNES), and observe that AD-GENO outperforms the alternative.




hr

Detection and Feeder Identification of the High Impedance Fault at Distribution Networks Based on Synchronous Waveform Distortions. (arXiv:2005.03411v1 [eess.SY])

Diagnosis of high impedance fault (HIF) is a challenge for nowadays distribution network protections. The fault current of a HIF is much lower than that of a normal load, and fault feature is significantly affected by fault scenarios. A detection and feeder identification algorithm for HIFs is proposed in this paper, based on the high-resolution and synchronous waveform data. In the algorithm, an interval slope is defined to describe the waveform distortions, which guarantees a uniform feature description under various HIF nonlinearities and noise interferences. For three typical types of network neutrals, i.e.,isolated neutral, resonant neutral, and low-resistor-earthed neutral, differences of the distorted components between the zero-sequence currents of healthy and faulty feeders are mathematically deduced, respectively. As a result, the proposed criterion, which is based on the distortion relationships between zero-sequence currents of feeders and the zero-sequence voltage at the substation, is theoretically supported. 28 HIFs grounded to various materials are tested in a 10kV distribution networkwith three neutral types, and are utilized to verify the effectiveness of the proposed algorithm.




hr

Multi-view data capture using edge-synchronised mobiles. (arXiv:2005.03286v1 [cs.MM])

Multi-view data capture permits free-viewpoint video (FVV) content creation. To this end, several users must capture video streams, calibrated in both time and pose, framing the same object/scene, from different viewpoints. New-generation network architectures (e.g. 5G) promise lower latency and larger bandwidth connections supported by powerful edge computing, properties that seem ideal for reliable FVV capture. We have explored this possibility, aiming to remove the need for bespoke synchronisation hardware when capturing a scene from multiple viewpoints, making it possible through off-the-shelf mobiles. We propose a novel and scalable data capture architecture that exploits edge resources to synchronise and harvest frame captures. We have designed an edge computing unit that supervises the relaying of timing triggers to and from multiple mobiles, in addition to synchronising frame harvesting. We empirically show the benefits of our edge computing unit by analysing latencies and show the quality of 3D reconstruction outputs against an alternative and popular centralised solution based on Unity3D.




hr

Safe Reinforcement Learning through Meta-learned Instincts. (arXiv:2005.03233v1 [cs.LG])

An important goal in reinforcement learning is to create agents that can quickly adapt to new goals while avoiding situations that might cause damage to themselves or their environments. One way agents learn is through exploration mechanisms, which are needed to discover new policies. However, in deep reinforcement learning, exploration is normally done by injecting noise in the action space. While performing well in many domains, this setup has the inherent risk that the noisy actions performed by the agent lead to unsafe states in the environment. Here we introduce a novel approach called Meta-Learned Instinctual Networks (MLIN) that allows agents to safely learn during their lifetime while avoiding potentially hazardous states. At the core of the approach is a plastic network trained through reinforcement learning and an evolved "instinctual" network, which does not change during the agent's lifetime but can modulate the noisy output of the plastic network. We test our idea on a simple 2D navigation task with no-go zones, in which the agent has to learn to approach new targets during deployment. MLIN outperforms standard meta-trained networks and allows agents to learn to navigate to new targets without colliding with any of the no-go zones. These results suggest that meta-learning augmented with an instinctual network is a promising new approach for safe AI, which may enable progress in this area on a variety of different domains.




hr

Constructing Accurate and Efficient Deep Spiking Neural Networks with Double-threshold and Augmented Schemes. (arXiv:2005.03231v1 [cs.NE])

Spiking neural networks (SNNs) are considered as a potential candidate to overcome current challenges such as the high-power consumption encountered by artificial neural networks (ANNs), however there is still a gap between them with respect to the recognition accuracy on practical tasks. A conversion strategy was thus introduced recently to bridge this gap by mapping a trained ANN to an SNN. However, it is still unclear that to what extent this obtained SNN can benefit both the accuracy advantage from ANN and high efficiency from the spike-based paradigm of computation. In this paper, we propose two new conversion methods, namely TerMapping and AugMapping. The TerMapping is a straightforward extension of a typical threshold-balancing method with a double-threshold scheme, while the AugMapping additionally incorporates a new scheme of augmented spike that employs a spike coefficient to carry the number of typical all-or-nothing spikes occurring at a time step. We examine the performance of our methods based on MNIST, Fashion-MNIST and CIFAR10 datasets. The results show that the proposed double-threshold scheme can effectively improve accuracies of the converted SNNs. More importantly, the proposed AugMapping is more advantageous for constructing accurate, fast and efficient deep SNNs as compared to other state-of-the-art approaches. Our study therefore provides new approaches for further integration of advanced techniques in ANNs to improve the performance of SNNs, which could be of great merit to applied developments with spike-based neuromorphic computing.




hr

Trains, Games, and Complexity: 0/1/2-Player Motion Planning through Input/Output Gadgets. (arXiv:2005.03192v1 [cs.CC])

We analyze the computational complexity of motion planning through local "input/output" gadgets with separate entrances and exits, and a subset of allowed traversals from entrances to exits, each of which changes the state of the gadget and thereby the allowed traversals. We study such gadgets in the 0-, 1-, and 2-player settings, in particular extending past motion-planning-through-gadgets work to 0-player games for the first time, by considering "branchless" connections between gadgets that route every gadget's exit to a unique gadget's entrance. Our complexity results include containment in L, NL, P, NP, and PSPACE; as well as hardness for NL, P, NP, and PSPACE. We apply these results to show PSPACE-completeness for certain mechanics in Factorio, [the Sequence], and a restricted version of Trainyard, improving prior results. This work strengthens prior results on switching graphs and reachability switching games.




hr

Evaluating text coherence based on the graph of the consistency of phrases to identify symptoms of schizophrenia. (arXiv:2005.03008v1 [cs.CL])

Different state-of-the-art methods of the detection of schizophrenia symptoms based on the estimation of text coherence have been analyzed. The analysis of a text at the level of phrases has been suggested. The method based on the graph of the consistency of phrases has been proposed to evaluate the semantic coherence and the cohesion of a text. The semantic coherence, cohesion, and other linguistic features (lexical diversity, lexical density) have been taken into account to form feature vectors for the training of a model-classifier. The training of the classifier has been performed on the set of English-language interviews. According to the retrieved results, the impact of each feature on the output of the model has been analyzed. The results obtained can indicate that the proposed method based on the graph of the consistency of phrases may be used in the different tasks of the detection of mental illness.




hr

Chronic Traumatic Encephalopathy (CTE) in Amateur Athletes

A new study suggests that vulnerability to CTE is not limited to professional athletes.




hr

A toker's musical guide through pop history

The Cannabis Issue People have been enjoying cannabis for recreational purposes for centuries, including in the United States since the early 1900s. That means weed was in America a good 50 years or so before the invention of rock 'n' roll.…




hr

From culinary arts to binge-watching, here are some weed-friendly activities to get you through your isolation

The Cannabis Issue It's been almost a month since the COVID-19 pandemic forced folks inside and made "social distancing" part of our daily lexicons.…




hr

The Innovia Foundation's former president has finally won his three-year battle to stop the organization from donating to a racist website

There's one thing the Innovia Foundation can never say: That it hadn't been told.…



  • News/Local News

hr

A father sees his son for the final time through a pane of glass at a Lewiston nursing home

Monty Spears didn't know it at the time, but the last time he'd see his father would be through the window at the Life Care Center of Lewiston.…



  • News/Local News

hr

The Fox Theater cancels all events, including Spokane Symphony concerts, through April 10

As the threat of the Coronavirus spreads throughout the country, public events everywhere are being canceled and postponed for public safety concerns. The Fox Theater is the latest venue to follow suit, closing its doors and canceling all events through April 10.…




hr

New music we love: Fiona Apple's thrilling Fetch the Bolt Cutters is a rush of lacerating lyrics and swirling sonics

You don't have to wander around the internet long before bumping into a rave review of Fiona Apple's new record Fetch the Bolt Cutters: It has inspired breathless acclaim, has already been labeled a masterwork and is notably the first new album in nearly a decade that Pitchfork has assigned a perfect 10/10 rating.…




hr

Meat gets rarer in the grocery aisle and the drive-thru

By David Yaffe-Bellany and Michael Corkery The New York Times Company Hundreds of Wendy’s restaurants have run out of hamburgers.…



  • Nation & World

hr

The Magic of Mushrooms

Loved, or loathed, depending on who you ask, mushrooms come in many forms, including those readily available in the grocery store, and others — like morels — that require more determined sourcing.…




hr

With a thriving collector's market and a rise in competitive leagues, pinball is cool again

Every serious pinball player remembers their first machine.…



  • Culture/Arts & Culture

hr

Taco Vado offers fresh and flavorful breakfast all day from its West Central Spokane drive-through stand

While its main goal is to introduce the humble breakfast taco to more Spokane eaters, owners of the new quick food stop Taco Vado say breakfast burritos have actually been its bestselling menu item since opening about a month ago.…



  • Food/Food News

hr

Chris Hemsworth stars as a mercenary in the empty, but exciting, action flick Extraction

Extraction was supposedly the most-watched new movie on Netflix last week, and yet it feels suspiciously like one you've already seen, possibly late at night on some obscure cable channel back in the '90s.…



  • Film/Film News

hr

Modeling of time-variant threshability due to interactions between a crop in a field and atmospheric and soil conditions for prediction of daily opportunity windows for harvest operations using field-level diagnosis and prediction of weather conditions an

A modeling framework for evaluating the impact of weather conditions on farming and harvest operations applies real-time, field-level weather data and forecasts of meteorological and climatological conditions together with user-provided and/or observed feedback of a present state of a harvest-related condition to agronomic models and to generate a plurality of harvest advisory outputs for precision agriculture. A harvest advisory model simulates and predicts the impacts of this weather information and user-provided and/or observed feedback in one or more physical, empirical, or artificial intelligence models of precision agriculture to analyze crops, plants, soils, and resulting agricultural commodities, and provides harvest advisory outputs to a diagnostic support tool for users to enhance farming and harvest decision-making, whether by providing pre-, post-, or in situ-harvest operations and crop analyzes.




hr

Process for producing biodiesel through lower molecular weight alcohol-targeted cavitation

A method for producing fatty acid alkyl esters from biolipids through transesterification and/or esterification reactions uses a flow-through cavitation device for generating cavitation bubbles in a fluidic reaction medium. The fluidic medium is passed through sequential compartments in the cavitation device having varying diameters and inner surface features to create localized reductions in fluid pressure thus vaporizing volatile alcohols and creating an increased surface area and optimized conditions for the reaction to occur at the gas-liquid interface around the bubbles.




hr

Method and composition for modulating erythropoiesis

The invention generally relates to compositions and methods of their use. More specifically, the invention relates to the use of a compound in modulating erythropoiesis in a subject by mediating the activity and/or quantity of a member present in the LPA3-mediated signaling pathway, such as lysophosphatidic acid receptor subtype 3 (LPA3).




hr

Formulations comprising isosorbide-modified unsaturated polyester resins and low profile additives which produce low shrinkage matrices

Formulations comprising an isosorbide-modified unsaturated polyester comprising maleic acid, fumaric acid, itaconic acid or maleic anhydride and isosorbide and one or more low profile additives. The formulations exhibit better shrink control in molding compound formulations with standard low profile additives than their non-isosorbide-modified analogues. These isosorbide-modified unsaturated polyester resins may be applied in molding compounds like sheet molding compounds or bulk molding compounds and may be components of fiber reinforced composites or other composite materials.




hr

Ion-conductive thermoplastic composition, electrochromic composite system and process for producing ion-conductive foil

An ion-conductive thermoplastic compositions contains a partially acetalated polyvinyl alcohol, at least one support electrolyte and at least one plasticizer. The partially acetalated polyvinyl alcohol contains two different acetal units. Electrochromic laminated glass systems produced using the ion-conductive compositions and a method for producing the systems are also provided.




hr

Additive process for production of dimensionally stable three dimensional objects

Generally, compositions and methods of producing dimensionally stable three dimensional objects using an additive build up process. Specifically, materials combinable in an additive build up process using a materials printer for the production of stable three dimensional molds useful in the production of molded or formed parts.




hr

False lock detection for physical layer frame synchronization

Systems, devices, processors, and methods are described which may be used for the reception of a wireless broadband signal at a user terminal from a gateway via a satellite. A wireless signal may include a series of physical layer frames, each frame including a physical layer header and payload. The received signal is digitized and processed using various novel physical layer headers and related techniques to synchronize the physical layer frames and recover data from physical layer headers for purposes of demodulation and decoding.




hr

Media file synchronization

The description generally relates to a system designed to synchronize the rendering of a media file between a master device and a sister device. The system is designed so that a media file is simultaneously rendered on a master device and a sister device beginning from identical temporal starting points.




hr

Reducing cross queue synchronization on systems with low memory latency across distributed processing nodes

A method for efficient dispatch/completion of a work element within a multi-node data processing system. The method comprises: selecting specific processing units from among the processing nodes to complete execution of a work element that has multiple individual work items that may be independently executed by different ones of the processing units; generating an allocated processor unit (APU) bit mask that identifies at least one of the processing units that has been selected; placing the work element in a first entry of a global command queue (GCQ); associating the APU mask with the work element in the GCQ; and responsive to receipt at the GCQ of work requests from each of the multiple processing nodes or the processing units, enabling only the selected specific ones of the processing nodes or the processing units to be able to retrieve work from the work element in the GCQ.