teleren/devto huggingface dataset:
Realtime Pathtracer Research
Tags: javascript, shader, pathtracing, 3d
Published: 2018-12-01 18:48:24

---
title: Realtime Pathtracer Research
published: true
description: Learning pathtracing
tags: javascript, shader, pathtracing, 3d
cover_image: https://thepracticaldev.s3.amazonaws.com/i/c6ig4f6xkuv2ojsclp6v.jpg
---

> "Path tracing is a computer graphics Monte Carlo method of rendering images of three-dimensional scenes such that the global illumination is faithful to reality."
_from wikipedia_

For a long time I've wanted to learn more about pathtracers. I finally got around to it a few months ago and the result of my investigation was a fork of [Evan Wallace's Pathtracer](http://madebyevan.com/webgl-path-tracing/) with a few new features and shapes - some of which I learned from [Erich Loftis’s Three.js PathTracing Renderer](https://github.com/erichlof/THREE.js-PathTracing-Renderer)


[Demo...](http://mtcanvas.com/hack/pathtracer/demo-3-512/index.html)
![shotz](https://thepracticaldev.s3.amazonaws.com/i/98epv7sq5p3sx2apggqf.jpg)

[Another Demo...](http://mtcanvas.com/hack/pathtracer/demo-1-512/index.html)
![shotz](https://thepracticaldev.s3.amazonaws.com/i/c6ig4f6xkuv2ojsclp6v.jpg)


Been wanting to get back to this and do optimizations and boolean shapes - but so far I haven't gotten around to it.

Here are a few more screenshots from various permutations and experiments...

![shotz](https://thepracticaldev.s3.amazonaws.com/i/644rmwck1gkh8fsozfrl.jpg)

![shotz](https://thepracticaldev.s3.amazonaws.com/i/1vgu3lpsbje3fyvdgtjj.jpg)

![shotz](https://thepracticaldev.s3.amazonaws.com/i/c72btwv7m3ipbzh4gvw1.jpg)


Working on this stuff brought back memories of waiting 15 hours for KPT Bryce to render 3D landscapes...

_still have a copy running on my 2018 macbook pro ;)_
![shotz](https://thepracticaldev.s3.amazonaws.com/i/e5mo2zft789345ek01wn.png)
How's the product you're working on architected?
Tags: architecture, showdown, discuss
Published: 2018-12-01 17:39:39

---
title: How's the product you're working on architected?
published: true
description: An architecture showdown that can show 
tags: #architecture, #showdown, #discuss
---

First of all I want to introduce myself to this community. I already have some nice articles to read later when I find some time and commented in a few posts here.

I'm from Portugal where I live since I was born and have 3 years of professional experience and almost 10 counting the academic years trying to fiddle with ASP (without the dot net). After failing that class, at the retry, PHP appeared with the AMP stack stayed with me until I started working and got to learn AngularJS (without touching the Java backend). 1 year later I switched companies and got to work properly with AngularJS integrated in Oracle infamous HTP. After another switch and a side project that is still in the making, I found myself making removing the JS in Angular and using a EAN stack with Postgres, with native mobile apps on the side accessing the API.

The intent of this post is to share the architecture of a product you're working with. This interaction would show how diverse and complex a product or a SaaS could be, and would help me and you see what stacks and integrations you're doing and see  and evaluate if there are improvements to make to our product's architecture and I think mine could be improved.

Thanks
TIL: How to Resolve Go Import Paths in Go
Tags: go
Published: 2018-12-01 17:33:03

---
title: TIL: How to Resolve Go Import Paths in Go
published: true
description: 
tags: Go
---

Go import path is corresponding to one directory in filesystem. For example, `import "fmt"` is resolved to `/usr/local/opt/go/libexec/src/fmt` (`opt` is a symlink to directory of the latest Go installation by Homebrew) in my environment.

I needed to resolve the import paths in Go.

At first, I tried `go/ast` and `go/types` packages. They both have `ast.Package`, `ast.ImportSpec` and `types.Package` structs. But none of them has the directory path of package. They only have its path (e.g. `"fmt"`).

- https://golang.org/pkg/go/ast/#Package
- https://golang.org/pkg/go/ast/#ImportSpec
- https://golang.org/pkg/go/types/#Package

But Go compiler resolves each import paths. To know how it does, I explored Go sources. Type checker needs to resolve import paths to know types of symbols from external package. So it must resolve import paths.

Actually resolving paths is done in `Importer` interface value in type checking. There are three types of importers provided by Go standard library; `gc`, `gccgo` and `source`, where `gc` is for a standard Go compiler, `gccgo` is for cgo, and `source` is for static analysis tools.
`source` seemed to match to my use case.

Implementation of `source` importer is in `go/internal` package.

- https://github.com/golang/go/blob/624e197c71b673f0b3ebc57f774536131b4f0f26/src/go/internal/srcimporter/srcimporter.go#L23

And I found how it resolves import paths.

> bp,  err := p.ctxt.Import(path,  srcDir,  0)

where `ctxt` is instance of `go/build.Context`. It utilizes `go/build.Context.Import` method.

- https://golang.org/pkg/go/build/#Context.Import

Let's see if it gives what I want:

```go
package main

import (
	"fmt"
	"go/build"
)

func main() {
	// Use default context
	ctx := build.Default

	for _, importPath := range []string{
		"fmt",
		"github.com/pkg/errors",
	} {
		pkg, err := ctx.Import(importPath, ".", build.FindOnly)
		if err != nil {
			panic(err)
		}
		fmt.Println(importPath, "->", pkg.Dir)
	}
}
```

Output:

```
fmt -> /usr/local/Cellar/go/1.11.2/libexec/src/fmt
github.com/pkg/errors -> /Users/rhysd/.go/src/github.com/pkg/errors
```

Yay! I finally could resolve import paths into directory paths.

Setting `build.FindOnly` flag is better to avoid cost to collect the entire package information.

Note: Go version is 1.11.2
Anyone still writing desktop applications?
Tags: discuss, career, devtips
Published: 2018-12-01 16:40:17

---
title: Anyone still writing desktop applications?
published: true
description: Anyone still writing desktop applications?
tags: discuss, career, devtips
---

I'm just curious to know...these days most of the applications being written are in the form SaaS, Web Application, and Mobile Application, now, I'm just wondering to those who are still currently and actively working on desktop application regarding their experience.

1.) What are you using to create desktop applications? 

2.) While most(if not all) desktop applications are being rewritten as web/mobile applications, do you guys see a benefit for those who are still learning to be a developer to invest in learning things like WPF, or desktop applications in general?

3.) Do you think web/mobile applications are really going to replace all desktop applications, or perhaps desktop applications might rise again or if I may so... be popular again?

I'm a Software Engineer and most of the projects(personal and work) I've been a part of or created personally are Web Applications, and recently I've been investing time on mobile app development.
Hey Newbies - What Do You Struggle With Most?
Tags: discuss, beginners, webdev
Published: 2018-12-01 14:59:55

---
title: Hey Newbies - What Do You Struggle With Most?
published: true
description: 
tags: discuss, beginners, web-dev
---

Hey 👋 guys,

Hope you're all well. Learning to code can be hard and it's inevitable we will come across challenges. 

- What do you/have you struggled with most? 
- What advice would you give others?



---

_Thanks for reading. To keep up with my coding journey come say hi 👋 on [twitter](https://twitter.com/lawyerscode) or on our #devNewbie [Discord](https://discordapp.com/invite/mBsMP2H) server where we have a friendly group of learners sharing their experiences._
Test Driven ... Everything
Tags: discuss, tdd, designpatterns
Published: 2018-12-01 13:56:40

---
title: Test Driven ... Everything
published: true
description: 
tags: #discuss , #TDD , #DesignPatterns ,
---

TDD , or test driven development , is one of the better ways to develop software. It leads to better design.

TDR , or test driven reading , is one of the better ways to understand programming concepts. (specially Design Pattern topics)

The more blogs and tutorials I read, the more I realise that every article starts with the design code and then the execution ( main() ) code .

I then thought, if I read the main/execution code first and then try to go back and see the design code , then everything starts making sense.

Tests / main() code also leads to a better understanding of programming concepts

Thoughts ???
Help me decide a language for Advent of Code
Tags: help
Published: 2018-12-01 12:51:20

I haven't given it much tought the past few days but I would like to try doing [Advent of Code](https://adventofcode.com/) this year.

I'm way past the middle of the day but there's still time to tackle the first problem.

I want to use a language I don't know at all.

These are the languages that popped in my mind:

* Rust
* Clojure
* Elixir

I've never used any of them and I don't want to use "marketability" as a benchmark to decide (although Rust might come in handy in the future). Just to learn something for the sake of learning.

I know the internet is full of "this vs that" but I would like to know the opinion of "devtoers" (we need an official name :D).

You can also suggest other languages (maybe with a reason why :D).

Thank you!
Programmers in Ugly Christmas Sweaters
Tags: discuss, offtopic
Published: 2018-12-01 11:23:23

---
title: Programmers in Ugly Christmas Sweaters
published: true
description: Programmers Assemble to Celebrate Christmas
tags: #discuss #offtopic
---

*An experiment in twitter (the empty pit of doom where nobody can hear you scream into the abyss) vs dev.to*

Join [@aerotwist](https://twitter.com/aerotwist) and me in welcoming the joyous Christmas Season! :D (or whatever else you want to celebrate)


{% twitter 1068803646152982528 %}

{% twitter 1068809288020357126 %}
Get Solutions To Laravel Errors Right In The Stack Traces.
Tags: packages, php, laravel, errors
Published: 2018-12-01 10:58:45

---
title: Get Solutions To Laravel Errors Right In The Stack Traces.
published: true
description: A Laravel package that gives developers(Especially beginners) superpowers to get solutions to Laravel errors right in the stack traces.
tags: Packages,PHP,Laravel,Errors 
---
![laravel-errorAndSolution](https://thepracticaldev.s3.amazonaws.com/i/89m4zopz2bkyxjblix48.PNG)

**Getting solutions to errors have been one of the major challenges that take much of my time as a learner with an art background.** This situation is probably applicable to many other developers around the globe, so I have taken it as my responsibility to help developers, especially beginners, find solutions to various errors with ease.

It is common to search solutions to errors randomly with the hope of finding one which -- sometimes -- takes a lot of developers' time and effort. That is obviously not a bad thing! But I believe developers' time would be conserved to some extent if the solution or links to solutions to a given error comes with such error.

That is why I built [a laravel package](https://github.com/codingnninja/lerrors) that gives developers(especially beginners) superpowers to get solutions to laravel errors right in the stack traces with ease. This package can only solve about five laravel errors currently. I am still curating errors, so it will be appreciated if you can help all along.

Above all, a need your view on how to make this project better.

Best regards,
Ayobami.
The Super Tiny Compiler!
Tags: compiler, chengefavor, tiny, short
Published: 2018-12-01 09:16:28

---
title: The Super Tiny Compiler!
published: true
description: 
tags: compiler, chenge-favor, tiny, short
---

![](https://cloud.githubusercontent.com/assets/952783/21579290/5755288a-cf75-11e6-90e0-029529a44a38.png)

Code is more clear than words. I like short code.

A 100 lines file to explain compiler.

From the code below, We can see compile is the whole process. Parser is a step. Metaprogramming is at transform stage I think. AST is kernel data structure.

Know more compile will help you understand all kinds of languages.

[link-->](https://github.com/jamiebuilds/the-super-tiny-compiler)

```c
/**
 * FINALLY! We'll create our `compiler` function. Here we will link together
 * every part of the pipeline.
 *
 *   1. input  => tokenizer   => tokens
 *   2. tokens => parser      => ast
 *   3. ast    => transformer => newAst
 *   4. newAst => generator   => output
 */

function compiler(input) {
  let tokens = tokenizer(input);
  let ast    = parser(tokens);
  let newAst = transformer(ast);
  let output = codeGenerator(newAst);

  // and simply return the output!
  return output;
}
```
Advent of Code is Live!
Tags: adventofcode, news
Published: 2018-12-01 06:20:04

---
title: Advent of Code is Live!
published: true
description: Tis the season for festive code challenges!
tags: adventofcode, news
cover_image: https://cl.ly/834f12d08b06/Image%202018-12-01%20at%209.59.27%20AM.png
---

It's that time of year again: [Advent of Code](https://adventofcode.com/2018).  The site went live at midnight Eastern U.S. time (which means, on the west coast, I got a nice little bit of coding in before bed)!

Advent of Code is one of my very favorite coding challenge sources.  The challenges are festive, fun, and interesting.  It's not just another round of "Roman Numerals" or "99 bottles of milk on the wall" either.  These are hand-crafted, artisanal, coding challenges that you won't see anywhere else.  And they come out two per day until Christmas!  It's pitched as a mission, that you need to complete all the challenges in the next 25 days to save Christmas.

It's really a great way to get some consistent, engaging practice in a new language.  This year, I've been trying to learn Rust, so I'll be doing my best to complete the challenges in Rust and share my progress [on this repo](https://github.com/rpalo/advent-of-code-2018) (SPOILERS PRESENT!).  I'd love for any Rust gurus who want to drop some knowledge to take a look at my code and help me get better.

And if you're doing your own learning in Python or Ruby and want me to take a look at *your* code, let me know.  I'm happy to help as best as I can.  😀

Anyways, for those who celebrate it, Merry Christmas!  Happy holidays!  And Happy Coding!

![A Christmas Binary Tree with a Heap of presents underneath - XKCD 835](https://imgs.xkcd.com/comics/tree.png)

*Credit: [XKCD #835](https://xkcd.com/835/)*
Do you know webpack?
Tags: webpack, help
Published: 2018-12-01 05:11:51

---
title: Do you know webpack?
published: true
description: Looking for someone with webpack experience
tags: webpack, help
---
Hi Gang,

I've been trying to learn Webpack for a while; the fact that I have been in forums for a while and asked for Webpack help and people always ask me if 'we can learn that together' is a testament that more people are struggling than those who know the topic.

I'd be really happy if someone could spend an hour this week with me to work through a couple setups that I imagine I'll use more than a few times. 

The setup is relatively simple:
1. Express/Node
2. Pug/scss
3. Webpack to do the magic build process

I intend to use some variation of this stack repeatedly so learning how to use Webpack with those tools and having it explained to me; the why this and how come that would allow me to really grow my knowledge, because let's be honest the hardest thing is getting that first cohesive effort together and then growing outwards from there.
Difference between let and var in Javascript
Tags: javascript, es6, react
Published: 2018-12-01 02:24:30

---
title: Difference between let and var in Javascript
published: true
description: Difference between let and var in Javascript
tags: #js #javascript #es6 #react
---


Post Link : <a href="https://www.skptricks.com/2018/11/difference-between-let-and-var-in-javascript.html" >Difference between let and var in Javascript </a>

This tutorial explains basic uses and difference between Let and Var in javascript. When any developer is working in JavaScript, often uses let, var keywords. Most of us use it randomly as there has been a lot of confusion regarding the use of let and var in JavaScript.

Let Scope :
The scope of a variable defined with var is function scope or declared outside any function, global.

Var Scope :
The scope of a variable defined with let is block scope.

<a href="https://www.skptricks.com/2018/11/difference-between-let-and-var-in-javascript.html" >Difference between let and var in Javascript </a>


<img src="https://4.bp.blogspot.com/-F3u3pqpjKAE/W_rhQJF0FhI/AAAAAAAACK8/mKrEKXdm2RoXQPBUna0C042hkPUv7xG1gCLcBGAs/s400/let.png" />
Finding Flow
Tags: productivity, freelance, work, lifestyle
Published: 2018-12-01 02:08:03

If you're anything like me, you have a hard time getting up in the morning when nothing is forcing you to do so. You might enjoy a few hours of walking around town, grabbing lunch with friends or finding other ways to enjoy yourself. Then later in the day, you open your laptop and decide it's time to get to work. Is that the most productive lifestyle? Unlikely, but it's not rare.

I never believed in the standard 9–5. It seemed to me there are different kinds of people; those who wake up early and find themselves to be productive in the earlier hours, and those who sleep in and work evenings. When I was (even) younger, I thought my productivity found me, magically, in the later hours of the day. I would feel demotivated and unproductive all day, but would start working at 9 PM, only to stop working when the sun was coming up; my 9–5 was certainly different from most. Going to bed at 5 AM, of course, led to waking up at 2 PM.
 
Maybe it's true that some people have an easier time waking up in the morning and some people thrive in the evening, but it's hard to deny the existence of _flow_, and our power over it. My routine of waking up late, slacking off all day and then finally getting to work created a positive feedback loop. I fell into the routine and maintained it by telling myself that was just how I functioned best. Blinded by feeling special, I never considered that I could simply be wrong. I was wrong. I was very wrong.

By waking up late, but always starting work around the same time, I had programmed myself to start feeling motivated and productive at that exact time. _Flow_ kicked in not long after, so I couldn't go to bed early. I realized this had become a problem but every attempt I made at changing it seemed to fail. Waking up early was hard, I wasn't productive in the mornings and I would need to take frequent naps, even if I had slept 8 hours that night. After a day or two, I'd give up by working until 5 AM and telling myself it wouldn't be healthy not to get 8 hours of sleep when my alarm rang 3 hours later.

The solution is simple, but not easy. Building a routine simply takes more than a few days. It might take weeks in fact, for you to be completely comfortable with your new lifestyle, but you do have that control. _Flow_ doesn't come to you magically, it's trained. Stephen King doesn't get lucky and isn't magically a productive author. He writes every single day and has done so long enough for his creativity, his _flow_, to become a habit.

The difficult decision is not to call yourself different, a suffering artist who is so unique, he can only do his amazing work when everyone else is getting a good night's sleep. To wake up early, build a routine based on your body's natural requirements and take control of your productivity is the difficult decision. Often in life, we make decisions that seem hard but are in fact easy and those easy decisions can make our lives more difficult. When it comes to finding _flow_, we can be a bit harder on ourselves. We can take a little more responsibility. We'll be better for it.
Generating fake pokemon using GAN
Published: 2018-12-01 00:40:21

---
title: Generating fake pokemon using GAN
published: true
description: Gotta train 'em all! Let's generate some new pokemon using the power of Generative Adversarial Networks. This is a newer deep learning technique invented by a researcher & friend of mine named Ian Goodfellow. Yann LeCunn called it the coolest idea in the past 2 decades. I'll explain how it works, some more recent improvements, then we'll go through the code. 
tags: 
---

https://www.youtube.com/watch?v=yz6dNf7X7SA
Relay Issue 1: Code Review. Do you speak it?
Tags: softwareengineering, codereview, codinglive
Published: 2018-11-30 23:11:27

---
title: Relay Issue 1: Code Review. Do you speak it?
published: true
description: We wanted to start a newsletter about how engineers from all backgrounds get better at coding and what are the challenges they face in everyday life.
tags: Software Engineering, Code Review, Coding Live
---

We wanted to start a newsletter about how engineers from all backgrounds get better at coding. What are our success stories and our everyday struggles. We are very excited to share this with you and looking forward to seeing what do you think!

[Issue #1](https://go.checkgit.com/newsletter-1)

P.S. We were debating if to post the entire content of the newsletter or just a link. We ended just posting a link, but if you think it would be better to post the entire content, we will love to do so.
Check out this Advent of Code helper for Rust
Tags: rust, aoc
Published: 2018-11-30 23:08:25

---
title: Check out this Advent of Code helper for Rust
published: true
description: A link to a handy Advent of Code Rust helper
tags: rust, aoc
---

Disclaimer - **NOT** my project, I just think it's cool.

I've been waffling about what language I'd like to use for AoC this year but if you've settled on Rust, you should check out [this tool](https://github.com/gobanos/cargo-aoc).

It will download your input for you and handle running and benchmarking.  It also includes with some handy macros to hook generators to solvers, tailored to the format these problems generally take.

I'd gotten my heart set on F# as an intro to the MS ecosystem, but this is so dang cool.  I do love me some Rust... it's going to be hard to steer clear.