Build the Solar System with WebGL & Three.js

Since beginning my journey into the Front End, I have always been interested in how to create 3-dimensional renderings in the browser.

Today we’re going to dive into an introduction on how to use WebGL with ThreeJS, and together build a fun 3D, not-to-scale rendering of our solar system!

I say not-to-scale because, well, space is vast.

It will take the SpaceX Starship 6 months to travel to Mars in 2024, a distance which takes light a full 3 minutes.

If we made our little browser-rendering to scale, our planets would be infinitesimally tiny in a black void… just like in real life! 🤣

No, instead we shall aim for the visually pleasing over real-world accuracy.

Here is a gif of our finished project in the browser:

And here is the final project repository.

Let’s have some fun.🚀


WebGL and ThreeJS

Compared to modern web tech, WebGL (based on OpenGL) is relatively old.

Created in 2006 and adopted by Mozilla and Opera a year later, WebGL has been steadily iterated upon over the years and is now a standard tech included in modern browsers.

ThreeJS, the primary tech we’ll be using today, is a library that allows us to create and display animated 3D computer graphics in the browser.

Built on WebGL, it allows us to create shapes, load textures, customize lighting, manipulate and animate perspectives, customize the orbit controls of the camera… among many other possibilities.

#threejs #webgl #javascript #web-development #programming

What is GEEK

Buddha Community

Build the Solar System with WebGL & Three.js
Maddy Bris

Maddy Bris

1606817198

Sunny Sky Solar announced you to launch 13.2KW Solar Power System in Queensland

Attending well to the global aim of turning towards sustainable energy and building a greener Earth, Sunny Sky Solar has always been dedicated towards providing the best in Queensland setups and components of solar power system. They have been known for their astounding quality and reasonable offerings of solar panels, solar charge controller, solar batteries, solar inverters and others that comprise of a solar panel system. In addition to quality, they also take pride in their offerings which stand high with a wide variety that would suffice varied needs at reasonable costs while not tampering the quality.

Sunny Sky Solar believes that the goal of a greener Earth through renewable source of energy can be achieved only if the components of solar power system are efficient and of commendable quality to deliver what exactly is expected out of them in terms of energy and cost related benefits. Aligning with this vision that they stand by, they offer a wide variety of solar power systems in Brisbane.

They have again made it to the headlines in the solar power industry by launching a 13.2 KW solar power system in Queensland. With their brand name that stands for quality and innovation, Sunny Sky Solar has grown and served a wide variety of customers ranging from small households to big commercial houses in a very short span of time. With a reputable Goodwill in the market, their new launches are always awaited and keenly assessed by the prospective customers and their competitors regularly.

The new launch of 13.2kW solar system is known to generate over 100 kWh of energy while running at a rate of 75% efficiency. The system comes in several variants off-grid solar system, gird tied solar panel system and hybrid solar power system. These panels add to the finishing and look of the system. The notable point of this launch is that this system will perfectly install on almost all sort of surfaces be they flat or tilted.

This solar power system type is already one of the most popular and preferred ones in Brisbane, owing to the size, efficiency and reasonable return on investment that it provides. They operate at maximum efficiency and are perfect for places like Brisbane, Queensland where it is sunny most part of the year.

This offering is being expected to attract many first time households and businesses to turn solar as the returns are brilliant and the design perfectly adaptable for all surfaces and property types. Made with high in quality components, this 13.2kW solar system in Brisbane comes with high grade solar cells (photovoltaic). These cells are embedded with astounding features like improved sunlight trapping ability, an increased energy conversion rate and better durability.

The Australian consumers, in a survey, came out to be preferring this variant rapidly over others because of the unending benefits that they observe coupled up with this solar system type. It gives better returns and results when compared to others like the 10kw solar power systems.

With such offerings and launches, Sunny Sky Solar has managed to retain its position as on of the best and most trusted solar system providers in the country. It not only ensures that the solar system parts and systems are quality oriented but also takes whole account of their look and efficiency hereby working overall on their offerings.

The growth of Sunny Sky Solar in Queensland is expected to multiply in leaps and bounds with this launch as the popularity of the 13.2kw solar system is on a rise. The market now awaits, it’s next move and growth strategy for the times to come.

**
About Sunny Sky Solar**
Sunny Sky Solar is a leading international solar power installation in Brisbane that offers extensive range of residential solar power system, commercial solar power system and hybrid solar power system. We providing the best solar power system ranging from 5KW Solar Power system to 100KW Solar Power system. Want to know more about Solar power system, then contact us, our solar experts helps you to find the best solar panel system as per your need and requirements.

#solar power system #13.2 kw solar power system #13.2 kw solar power system in queensland #off-grid solar system #13.2kw solar system in brisbane #5kw solar power systems

Maddy Bris

Maddy Bris

1599132316

5Kw Solar System in Brisbane

1 August 2020, Sunny Sky solarannounced you to launch a residential solar power system in Queensland, Australia. There are different sizes of houses with different energy requirements so one solar power system cannot fulfill every type of electricity need.

Whether energy need is low or higher they have announced a wide range of solar power system in Brisbane that includes 5KW solar panel system, 6Kw solar panel system, 10Kw solar panel system, and many more so that everyone can enjoy the benefits of solar energy.

Residential Solar Power System needs to be flexible because of the changing requirement of energy. As we know our energy needs hikes up in the summers more than winters because we use air conditioners, refrigerators (also used in winters but less than summers), fans. In winter we drop down these usages so the energy needs to go up and down according to the weather changing.

Some households have a high energy need, some have low, and mostly have the normal or average of high and low. Sunny Sky Solar offers expert’s advice to all the customers on call or personally because it is important to analyze the energy need, budget, location, and many other things before buying a solar power system for your home sweet home.

Their professionals analyze all these things and suggest you the best residential solar power system in Brisbane to reduce the energy costs and clean the environment as solar energy is green & clean energy.

At this time of announcing the residential solar panel system, the representative of Sunny Sky Solar has talked about some advantages of a residential solar power system. He said “get update yourself by the time is important because the latest technology will save you lots of money and time. The solar power system is the best technology in this era that can give you lots of benefits. Don’t get upset with the initial cost because after installing a solar power system at your house it will repay you the initial cost in two to three years. So, you are going to invest in a great deal if you are purchasing a solar panel system in Brisbane.”

He also added “Residential solar power system can save your pocket from getting loose every month for heavy electricity bills. You will earn money by producing solar energy and feeding your power supply grid as government, and mostly all the power suppliers give benefits to producing solar energy. You can easily earn money by feeding the power grid with your excess produced solar energy. You will use solar energy and save the excess by feeding the power grid this way.”

Sunny Sky Solar offering an efficient range of residential and commercial solar power system that includes 5KW solar panel system, 6.6Kw solar panel system, 10Kw solar panel system, and there are many more that you can select according to your energy needs and budget.
They provide expert assistance that will help you in choosing the best solar system for your house. Their experienced professionals work under the guidance of experts who ensures the perfections and safety at the time of installing and after the installation.

Installing a solar power system at your place will be more convenient with them because they work under the expert’s supervision that makes them perfect and faster. They ensure safety first at the time of installing because at that time family members are around the installing site and accidents can happen.

They also ensure the quality of products they used in installing and other solar products. If the products will be durable and efficient, the system will produce more electricity with higher efficiency for a longer period.
The main thing that matters while installing a solar power system at a residence is the roof situation, Sunny Sky Solar doesn’t work for doing business only. They first check the place or analyze from your information that your location is safe for installing a solar power system or not. If the find any problem they will suggest repairing it first because if you will put the solar power system at a less secure place and the solar system’s weight can damage it then repairing that place first should your main priority.
This shows their loyalty and caring behavior towards the customers.

#solar panel system #solar panel system in brisbane #5kw solar panel system #5kw solar panel system #10kw solar panel system #10kw solar panel system in brisbane

Maddy Bris

Maddy Bris

1604050265

Sunny Sky Solar announced you to launch Commercial Solar Power System in Queensland

For the last 10+years, Sunny Sky Solar, is a leading international solar power system installer in Brisbane is making the environment eco-friendly with the help of renewable resources of energy. Now, they have announced you to launch a commercial solar power system in Queensland, Australia. They bring a huge range of solar power systems for the big, medium, and small size offices, shops, and other commercial areas.
You can choose between an on-grid solar power system, off-grid solar power system, and **hybrid solar power system **according to your energy need at your workplace. By installing a commercial solar power system in Brisbane you can avail of the benefits of government rebates that gives to the businesses who have installed a solar power system at workplace. You can save lots of money after installing a solar panel system at your office.
A commercial solar power system provides energy security that means it helps businesses in becoming energy independent. It reduces your reliance on the local power grid that didn’t have any solution to sudden power cuts.
Energy consumption is increasing according to the yearly reports of researches and analysis. Businesses are paying more and more money for electricity bills in commercial areas.

As per company representative, they offers wide range of commercial solar power systems that will benefit your pocket and environment too. Their high-quality range includes 5KW solar power system, 6KW or 6.6KW solar power system, 10KW solar power system, 13KW solar power system and so on. You can choose according to the energy requirement at your workplace and then comes the best part. Sunny Sky Solar has professionals on board that helps in not only finding the best solar power system in Brisbane, Queensland but also deals in the top-notch quality solar products that come directly from the best manufacturers.

They didn’t stop here, installing a solar energy system in the commercial area is always risky because there is machinery, people everywhere, and lots of electricity & power is running 24/7. Sunny Sky Solar is known for its safe, secure, and durable solar system installing services. They have installed hundreds of commercial solar power systems in Brisbane with their highly skilled installers, under the supervision of solar experts and engineers.

While talking to Mr. Johana company representative at Sunny Sky Solar said “Solar energy is highly beneficial for the businesses as we are experiencing the increase in electricity rates year by year. In a business, profit and expenses are the two main things that matter. You cannot ignore the heavy electricity bills of your commercial place when we are talking about the income and expenses of businesses. A big part of your income that goes to electricity bills can be reduced with one of the great sources that is solar energy. We bring some superb range of commercial solar power systems in Queensland to reduce the energy cost of the businesses, also it will reduce the carbon footprints of the surrounding environment.”

While answering our questions, she further adds “Solar power system is an expensive but most valuable investment for a business. Whether the business is small or big, energy consumption is always there. By taking care of different size businesses, we made our solar system range very flexible. We have many options that cover small to medium and medium to large size business energy requirements.”

About Sunny Sky Solar
Sunny Sky Solar is a leading international solar power system installer in Brisbane that offers a wide range of commercial and residential solar power systems. They have come so far and built a brand name based on their stunning services and super deals of high-end quality products.

If you are planning to install a commercial or residential solar power system whether you have decided to go for the on-grid solar power system or off-grid solar power system, I suggest Sunny Sky Solar for a safe & secure solar energy installation process. Contact them for a free consultancy from the experts of this field and get your brand new solar power system at an affordable price.

#solar power system #solar power system in brisbane #solar power in brisbane #solar panel system #commercial solar power system #commercial solar power system in brisbane

NBB: Ad-hoc CLJS Scripting on Node.js

Nbb

Not babashka. Node.js babashka!?

Ad-hoc CLJS scripting on Node.js.

Status

Experimental. Please report issues here.

Goals and features

Nbb's main goal is to make it easy to get started with ad hoc CLJS scripting on Node.js.

Additional goals and features are:

  • Fast startup without relying on a custom version of Node.js.
  • Small artifact (current size is around 1.2MB).
  • First class macros.
  • Support building small TUI apps using Reagent.
  • Complement babashka with libraries from the Node.js ecosystem.

Requirements

Nbb requires Node.js v12 or newer.

How does this tool work?

CLJS code is evaluated through SCI, the same interpreter that powers babashka. Because SCI works with advanced compilation, the bundle size, especially when combined with other dependencies, is smaller than what you get with self-hosted CLJS. That makes startup faster. The trade-off is that execution is less performant and that only a subset of CLJS is available (e.g. no deftype, yet).

Usage

Install nbb from NPM:

$ npm install nbb -g

Omit -g for a local install.

Try out an expression:

$ nbb -e '(+ 1 2 3)'
6

And then install some other NPM libraries to use in the script. E.g.:

$ npm install csv-parse shelljs zx

Create a script which uses the NPM libraries:

(ns script
  (:require ["csv-parse/lib/sync$default" :as csv-parse]
            ["fs" :as fs]
            ["path" :as path]
            ["shelljs$default" :as sh]
            ["term-size$default" :as term-size]
            ["zx$default" :as zx]
            ["zx$fs" :as zxfs]
            [nbb.core :refer [*file*]]))

(prn (path/resolve "."))

(prn (term-size))

(println (count (str (fs/readFileSync *file*))))

(prn (sh/ls "."))

(prn (csv-parse "foo,bar"))

(prn (zxfs/existsSync *file*))

(zx/$ #js ["ls"])

Call the script:

$ nbb script.cljs
"/private/tmp/test-script"
#js {:columns 216, :rows 47}
510
#js ["node_modules" "package-lock.json" "package.json" "script.cljs"]
#js [#js ["foo" "bar"]]
true
$ ls
node_modules
package-lock.json
package.json
script.cljs

Macros

Nbb has first class support for macros: you can define them right inside your .cljs file, like you are used to from JVM Clojure. Consider the plet macro to make working with promises more palatable:

(defmacro plet
  [bindings & body]
  (let [binding-pairs (reverse (partition 2 bindings))
        body (cons 'do body)]
    (reduce (fn [body [sym expr]]
              (let [expr (list '.resolve 'js/Promise expr)]
                (list '.then expr (list 'clojure.core/fn (vector sym)
                                        body))))
            body
            binding-pairs)))

Using this macro we can look async code more like sync code. Consider this puppeteer example:

(-> (.launch puppeteer)
      (.then (fn [browser]
               (-> (.newPage browser)
                   (.then (fn [page]
                            (-> (.goto page "https://clojure.org")
                                (.then #(.screenshot page #js{:path "screenshot.png"}))
                                (.catch #(js/console.log %))
                                (.then #(.close browser)))))))))

Using plet this becomes:

(plet [browser (.launch puppeteer)
       page (.newPage browser)
       _ (.goto page "https://clojure.org")
       _ (-> (.screenshot page #js{:path "screenshot.png"})
             (.catch #(js/console.log %)))]
      (.close browser))

See the puppeteer example for the full code.

Since v0.0.36, nbb includes promesa which is a library to deal with promises. The above plet macro is similar to promesa.core/let.

Startup time

$ time nbb -e '(+ 1 2 3)'
6
nbb -e '(+ 1 2 3)'   0.17s  user 0.02s system 109% cpu 0.168 total

The baseline startup time for a script is about 170ms seconds on my laptop. When invoked via npx this adds another 300ms or so, so for faster startup, either use a globally installed nbb or use $(npm bin)/nbb script.cljs to bypass npx.

Dependencies

NPM dependencies

Nbb does not depend on any NPM dependencies. All NPM libraries loaded by a script are resolved relative to that script. When using the Reagent module, React is resolved in the same way as any other NPM library.

Classpath

To load .cljs files from local paths or dependencies, you can use the --classpath argument. The current dir is added to the classpath automatically. So if there is a file foo/bar.cljs relative to your current dir, then you can load it via (:require [foo.bar :as fb]). Note that nbb uses the same naming conventions for namespaces and directories as other Clojure tools: foo-bar in the namespace name becomes foo_bar in the directory name.

To load dependencies from the Clojure ecosystem, you can use the Clojure CLI or babashka to download them and produce a classpath:

$ classpath="$(clojure -A:nbb -Spath -Sdeps '{:aliases {:nbb {:replace-deps {com.github.seancorfield/honeysql {:git/tag "v2.0.0-rc5" :git/sha "01c3a55"}}}}}')"

and then feed it to the --classpath argument:

$ nbb --classpath "$classpath" -e "(require '[honey.sql :as sql]) (sql/format {:select :foo :from :bar :where [:= :baz 2]})"
["SELECT foo FROM bar WHERE baz = ?" 2]

Currently nbb only reads from directories, not jar files, so you are encouraged to use git libs. Support for .jar files will be added later.

Current file

The name of the file that is currently being executed is available via nbb.core/*file* or on the metadata of vars:

(ns foo
  (:require [nbb.core :refer [*file*]]))

(prn *file*) ;; "/private/tmp/foo.cljs"

(defn f [])
(prn (:file (meta #'f))) ;; "/private/tmp/foo.cljs"

Reagent

Nbb includes reagent.core which will be lazily loaded when required. You can use this together with ink to create a TUI application:

$ npm install ink

ink-demo.cljs:

(ns ink-demo
  (:require ["ink" :refer [render Text]]
            [reagent.core :as r]))

(defonce state (r/atom 0))

(doseq [n (range 1 11)]
  (js/setTimeout #(swap! state inc) (* n 500)))

(defn hello []
  [:> Text {:color "green"} "Hello, world! " @state])

(render (r/as-element [hello]))

Promesa

Working with callbacks and promises can become tedious. Since nbb v0.0.36 the promesa.core namespace is included with the let and do! macros. An example:

(ns prom
  (:require [promesa.core :as p]))

(defn sleep [ms]
  (js/Promise.
   (fn [resolve _]
     (js/setTimeout resolve ms))))

(defn do-stuff
  []
  (p/do!
   (println "Doing stuff which takes a while")
   (sleep 1000)
   1))

(p/let [a (do-stuff)
        b (inc a)
        c (do-stuff)
        d (+ b c)]
  (prn d))
$ nbb prom.cljs
Doing stuff which takes a while
Doing stuff which takes a while
3

Also see API docs.

Js-interop

Since nbb v0.0.75 applied-science/js-interop is available:

(ns example
  (:require [applied-science.js-interop :as j]))

(def o (j/lit {:a 1 :b 2 :c {:d 1}}))

(prn (j/select-keys o [:a :b])) ;; #js {:a 1, :b 2}
(prn (j/get-in o [:c :d])) ;; 1

Most of this library is supported in nbb, except the following:

  • destructuring using :syms
  • property access using .-x notation. In nbb, you must use keywords.

See the example of what is currently supported.

Examples

See the examples directory for small examples.

Also check out these projects built with nbb:

API

See API documentation.

Migrating to shadow-cljs

See this gist on how to convert an nbb script or project to shadow-cljs.

Build

Prequisites:

  • babashka >= 0.4.0
  • Clojure CLI >= 1.10.3.933
  • Node.js 16.5.0 (lower version may work, but this is the one I used to build)

To build:

  • Clone and cd into this repo
  • bb release

Run bb tasks for more project-related tasks.

Download Details:
Author: borkdude
Download Link: Download The Source Code
Official Website: https://github.com/borkdude/nbb 
License: EPL-1.0

#node #javascript

Ruth  Nabimanya

Ruth Nabimanya

1620633584

System Databases in SQL Server

Introduction

In SSMS, we many of may noticed System Databases under the Database Folder. But how many of us knows its purpose?. In this article lets discuss about the System Databases in SQL Server.

System Database

Fig. 1 System Databases

There are five system databases, these databases are created while installing SQL Server.

  • Master
  • Model
  • MSDB
  • Tempdb
  • Resource
Master
  • This database contains all the System level Information in SQL Server. The Information in form of Meta data.
  • Because of this master database, we are able to access the SQL Server (On premise SQL Server)
Model
  • This database is used as a template for new databases.
  • Whenever a new database is created, initially a copy of model database is what created as new database.
MSDB
  • This database is where a service called SQL Server Agent stores its data.
  • SQL server Agent is in charge of automation, which includes entities such as jobs, schedules, and alerts.
TempDB
  • The Tempdb is where SQL Server stores temporary data such as work tables, sort space, row versioning information and etc.
  • User can create their own version of temporary tables and those are stored in Tempdb.
  • But this database is destroyed and recreated every time when we restart the instance of SQL Server.
Resource
  • The resource database is a hidden, read only database that holds the definitions of all system objects.
  • When we query system object in a database, they appear to reside in the sys schema of the local database, but in actually their definitions reside in the resource db.

#sql server #master system database #model system database #msdb system database #sql server system databases #ssms #system database #system databases in sql server #tempdb system database