Unix Terminal Coding

Ask me anything   Submit   Hackers
All Tags Eugene Tryfonides is the creator of this place .

twitter.com/egelor:

    heinzehavinga:

    image

    I asked the amazing Bees & Bombs on Twitter about keeping gif file sizes smaller the day before yesterday and he replied with some good tips. I’ve also been counting how long GIF usually last and I’ve been making them way to long. 

    I made a small gif to combine my new found knowlegde and was able to keep it < 1 mb which is nice. Source code on the sketchpad.

    (via fyprocessing)

    — 1 week ago with 45 notes

    #processing 
    kqedscience:

Tiny Helicopters Can’t Out-Hover Hummingbirds
“The spinning blades of micro-helicopters are about as efficient at hovering as the average hummingbird, which have had more than 42 million years of natural selection to hone their energetically efficient flight.
That said, hummingbird wings can still generate lift more efficiently than the best micro-helicopter blades, according to a new analysis led by David Lentink, an assistant professor of mechanical engineering at Stanford University. The findings could lead to more powerful, bird-inspired robotic vehicles.”
Learn more about this new research at Futurity.org.

    kqedscience:

    Tiny Helicopters Can’t Out-Hover Hummingbirds

    The spinning blades of micro-helicopters are about as efficient at hovering as the average hummingbird, which have had more than 42 million years of natural selection to hone their energetically efficient flight.

    That said, hummingbird wings can still generate lift more efficiently than the best micro-helicopter blades, according to a new analysis led by David Lentink, an assistant professor of mechanical engineering at Stanford University. The findings could lead to more powerful, bird-inspired robotic vehicles.”

    Learn more about this new research at Futurity.org.

    — 2 weeks ago with 90 notes

    fouriestseries:

Given the starting positions, velocities, and masses of three objects interacting via gravity, the classical three-body problem involves determining the motions of the three particles throughout time.
What’s cool about the three-body system is that it’s impossible to solve for the motions of the objects exactly. That is, we can’t write down an equation that describes the system. Instead of finding an exact solution, we solve the system numerically, which amounts to finding an accurate approximation.
The three-body problem is an example of a chaotic system, meaning that even a slight change in the starting conditions drastically changes the time-evolution of the system.
The GIF above shows a planar (i.e., two-dimensional) three-body system.
Mathematica code:
G = 1; time = 30; 
mA = 1; xA0 = 0; yA0 = 0; vxA0 = 0; vyA0 = 0; 
mB = 1; xB0 = 1; yB0 = 0; vxB0 = 0; vyB0 = 0; 
mC = 1; xC0 = 0; yC0 = 0.8; vxC0 = 0; vyC0 = 0; 
soln1 = NDSolve[
    {mA*Derivative[2][xA][t] == 
     -((G*mA*mB*(xA[t] - xB[t]))/((xA[t] - xB[t])^2 + 
      (yA[t] - yB[t])^2)^(3/2)) - 
      (G*mA*mC*(xA[t] - xC[t]))/((xA[t] - xC[t])^2 + 
      (yA[t] - yC[t])^2)^(3/2), 
    mA*Derivative[2][yA][t] == 
      -((G*mA*mB*(yA[t] - yB[t]))/((xA[t] - xB[t])^2 + 
      (yA[t] - yB[t])^2)^(3/2)) - 
      (G*mA*mC*(yA[t] - yC[t]))/((xA[t] - xC[t])^2 + 
      (yA[t] - yC[t])^2)^(3/2),
    mB*Derivative[2][xB][t] == 
      -((G*mB*mC*(xB[t] - xC[t]))/((xB[t] - xC[t])^2 + 
      (yB[t] - yC[t])^2)^(3/2)) - 
      (G*mB*mA*(xB[t] - xA[t]))/((xB[t] - xA[t])^2 + 
      (yB[t] - yA[t])^2)^(3/2),
    mB*Derivative[2][yB][t] == 
      -((G*mB*mC*(yB[t] - yC[t]))/((xB[t] - xC[t])^2 + 
      (yB[t] - yC[t])^2)^(3/2)) - 
      (G*mB*mA*(yB[t] - yA[t]))/((xB[t] - xA[t])^2 + 
      (yB[t] - yA[t])^2)^(3/2),
    mC*Derivative[2][xC][t] == 
      -((G*mC*mA*(xC[t] - xA[t]))/((xC[t] - xA[t])^2 + 
      (yC[t] - yA[t])^2)^(3/2)) - 
      (G*mC*mB*(xC[t] - xB[t]))/((xC[t] - xB[t])^2 + 
      (yC[t] - yB[t])^2)^(3/2),
    mC*Derivative[2][yC][t] == 
      -((G*mC*mA*(yC[t] - yA[t]))/((xC[t] - xA[t])^2 + 
      (yC[t] - yA[t])^2)^(3/2)) - 
      (G*mC*mB*(yC[t] - yB[t]))/((xC[t] - xB[t])^2 + 
      (yC[t] - yB[t])^2)^(3/2),
    xA[0] == xA0, yA[0] == yA0,
    Derivative[1][xA][0] == vxA0, Derivative[1][yA][0] == vyA0,
    xB[0] == xB0, yB[0] == yB0,
    Derivative[1][xB][0] == vxB0, Derivative[1][yB][0] == vyB0,
    xC[0] == xC0, yC[0] == yC0, 
    Derivative[1][xC][0] == vxC0, Derivative[1][yC][0] == vyC0
    },
    {xA, yA, xB, yB, xC, yC},{t, 0, time}, MaxSteps -&gt; 100000]
x1[t_] := Evaluate[xA[t] /. soln1[[1,1]]]
y1[t_] := Evaluate[yA[t] /. soln1[[1,2]]]
x2[t_] := Evaluate[xB[t] /. soln1[[1,3]]]
y2[t_] := Evaluate[yB[t] /. soln1[[1,4]]]
x3[t_] := Evaluate[xC[t] /. soln1[[1,5]]]
y3[t_] := Evaluate[yC[t] /. soln1[[1,6]]]
Manipulate[Show[
    {ParametricPlot[
      {{x1[t], y1[t]}, {x2[t], y2[t]}, {x3[t], y3[t]}},
      {t, tmax - 0.5, tmax}, 
      Axes -&gt; False, PlotRange -&gt; {{-0.55, 1.45}, 
      {-0.55, 1.08}}, PlotStyle -&gt; {Red, Green, Blue}, 
      GridLines -&gt; {Table[0.25*x + 0.07, {x, -100, 100}], 
      Table[0.25*y + 0.01, {y, -100, 100}]}, 
      GridLinesStyle -&gt; Directive[LightGray]]}, 
    {Graphics[{Opacity[0.7], EdgeForm[Directive[Black]], Red, 
      Disk[{x1[tmax], y1[tmax]}, 0.03], Green, 
      Disk[{x2[tmax], y2[tmax]}, 0.03], Blue, 
      Disk[{x3[tmax], y3[tmax]}, 0.03]}]}, ImageSize -&gt; 600], 
    {tmax, 6.05, 16.05}]

    fouriestseries:

    Given the starting positions, velocities, and masses of three objects interacting via gravity, the classical three-body problem involves determining the motions of the three particles throughout time.

    What’s cool about the three-body system is that it’s impossible to solve for the motions of the objects exactly. That is, we can’t write down an equation that describes the system. Instead of finding an exact solution, we solve the system numerically, which amounts to finding an accurate approximation.

    The three-body problem is an example of a chaotic system, meaning that even a slight change in the starting conditions drastically changes the time-evolution of the system.

    The GIF above shows a planar (i.e., two-dimensional) three-body system.

    Mathematica code:

    G = 1; time = 30; 
    mA = 1; xA0 = 0; yA0 = 0; vxA0 = 0; vyA0 = 0; 
    mB = 1; xB0 = 1; yB0 = 0; vxB0 = 0; vyB0 = 0; 
    mC = 1; xC0 = 0; yC0 = 0.8; vxC0 = 0; vyC0 = 0; 
    soln1 = NDSolve[
        {mA*Derivative[2][xA][t] == 
         -((G*mA*mB*(xA[t] - xB[t]))/((xA[t] - xB[t])^2 + 
          (yA[t] - yB[t])^2)^(3/2)) - 
          (G*mA*mC*(xA[t] - xC[t]))/((xA[t] - xC[t])^2 + 
          (yA[t] - yC[t])^2)^(3/2), 
        mA*Derivative[2][yA][t] == 
          -((G*mA*mB*(yA[t] - yB[t]))/((xA[t] - xB[t])^2 + 
          (yA[t] - yB[t])^2)^(3/2)) - 
          (G*mA*mC*(yA[t] - yC[t]))/((xA[t] - xC[t])^2 + 
          (yA[t] - yC[t])^2)^(3/2),
        mB*Derivative[2][xB][t] == 
          -((G*mB*mC*(xB[t] - xC[t]))/((xB[t] - xC[t])^2 + 
          (yB[t] - yC[t])^2)^(3/2)) - 
          (G*mB*mA*(xB[t] - xA[t]))/((xB[t] - xA[t])^2 + 
          (yB[t] - yA[t])^2)^(3/2),
        mB*Derivative[2][yB][t] == 
          -((G*mB*mC*(yB[t] - yC[t]))/((xB[t] - xC[t])^2 + 
          (yB[t] - yC[t])^2)^(3/2)) - 
          (G*mB*mA*(yB[t] - yA[t]))/((xB[t] - xA[t])^2 + 
          (yB[t] - yA[t])^2)^(3/2),
        mC*Derivative[2][xC][t] == 
          -((G*mC*mA*(xC[t] - xA[t]))/((xC[t] - xA[t])^2 + 
          (yC[t] - yA[t])^2)^(3/2)) - 
          (G*mC*mB*(xC[t] - xB[t]))/((xC[t] - xB[t])^2 + 
          (yC[t] - yB[t])^2)^(3/2),
        mC*Derivative[2][yC][t] == 
          -((G*mC*mA*(yC[t] - yA[t]))/((xC[t] - xA[t])^2 + 
          (yC[t] - yA[t])^2)^(3/2)) - 
          (G*mC*mB*(yC[t] - yB[t]))/((xC[t] - xB[t])^2 + 
          (yC[t] - yB[t])^2)^(3/2),
        xA[0] == xA0, yA[0] == yA0,
        Derivative[1][xA][0] == vxA0, Derivative[1][yA][0] == vyA0,
        xB[0] == xB0, yB[0] == yB0,
        Derivative[1][xB][0] == vxB0, Derivative[1][yB][0] == vyB0,
        xC[0] == xC0, yC[0] == yC0, 
        Derivative[1][xC][0] == vxC0, Derivative[1][yC][0] == vyC0
        },
        {xA, yA, xB, yB, xC, yC},{t, 0, time}, MaxSteps -> 100000]
    x1[t_] := Evaluate[xA[t] /. soln1[[1,1]]]
    y1[t_] := Evaluate[yA[t] /. soln1[[1,2]]]
    x2[t_] := Evaluate[xB[t] /. soln1[[1,3]]]
    y2[t_] := Evaluate[yB[t] /. soln1[[1,4]]]
    x3[t_] := Evaluate[xC[t] /. soln1[[1,5]]]
    y3[t_] := Evaluate[yC[t] /. soln1[[1,6]]]
    Manipulate[Show[
        {ParametricPlot[
          {{x1[t], y1[t]}, {x2[t], y2[t]}, {x3[t], y3[t]}},
          {t, tmax - 0.5, tmax}, 
          Axes -> False, PlotRange -> {{-0.55, 1.45}, 
          {-0.55, 1.08}}, PlotStyle -> {Red, Green, Blue}, 
          GridLines -> {Table[0.25*x + 0.07, {x, -100, 100}], 
          Table[0.25*y + 0.01, {y, -100, 100}]}, 
          GridLinesStyle -> Directive[LightGray]]}, 
        {Graphics[{Opacity[0.7], EdgeForm[Directive[Black]], Red, 
          Disk[{x1[tmax], y1[tmax]}, 0.03], Green, 
          Disk[{x2[tmax], y2[tmax]}, 0.03], Blue, 
          Disk[{x3[tmax], y3[tmax]}, 0.03]}]}, ImageSize -> 600], 
        {tmax, 6.05, 16.05}]

    (via derwents)

    — 3 weeks ago with 136 notes

    #mathematics  #code  #pure 
    kqedscience:

MIT Finger Device Reads to the Blind in Real Time
“Scientists at the Massachusetts Institute of Technology are developing an audio reading device to be worn on the index finger of people whose vision is impaired, giving them affordable and immediate access to printed words.
The so-called FingerReader, a prototype produced by a 3-D printer, fits like a ring on the user’s finger, equipped with a small camera that scans text. A synthesized voice reads words aloud, quickly translating books, restaurant menus and other needed materials for daily living, especially away from home or office.”
Read more from Boston.com.

    kqedscience:

    MIT Finger Device Reads to the Blind in Real Time

    Scientists at the Massachusetts Institute of Technology are developing an audio reading device to be worn on the index finger of people whose vision is impaired, giving them affordable and immediate access to printed words.

    The so-called FingerReader, a prototype produced by a 3-D printer, fits like a ring on the user’s finger, equipped with a small camera that scans text. A synthesized voice reads words aloud, quickly translating books, restaurant menus and other needed materials for daily living, especially away from home or office.”

    Read more from Boston.com.

    — 1 month ago with 4639 notes

    derwents:

sucysucyfivedolla:

sigsauer-ist:

goodbye

i thought this was a fuckin skate 3 glitch gif at first

nyoom

    derwents:

    sucysucyfivedolla:

    sigsauer-ist:

    goodbye

    i thought this was a fuckin skate 3 glitch gif at first

    nyoom

    (Source: relentless-soul)

    — 1 month ago with 149704 notes

    notational:

(via Typeface on Behance)
The typeface was created with Processing and Geomerative library.

    notational:

    (via Typeface on Behance)

    The typeface was created with Processing and Geomerative library.

    (via fyprocessing)

    — 1 month ago with 141 notes

    #processing 
    @myen International Lisp Conference 2014 →
    — 1 month ago

    #aug  #lisp  #2014  #emacs 
    p5art:

Triangles in flux II
(slight variation of the previous one; code here)

    p5art:

    Triangles in flux II

    (slight variation of the previous one; code here)

    (via fyprocessing)

    — 1 month ago with 340 notes

    #processing 
    @myen #ln Sculpting Sound with SuperCollider » Linux Magazine →
    — 1 month ago

    #sc  #supercollider 
    admiralpotato:

Yin Yang Masking - Source
Sometimes, I see an image, and it inspires me. Two nights ago was one of those times. This was one of those images. I have no idea who the original creator of that image was, but I’d like to thank that person for making it. Anyway, it gave me some ideas. So I coded this quick little sketch in processing to produce a pair of masks for me - one mask would be the original Alpha, and for the other, I would use the Luma.
How and why does one make use of two masks from one image? Well, I used them in the compositing breakdown below, and for the output below as well:

More in this set to come.
This image is one in a set named “Yin Yang Masking”

    admiralpotato:

    Yin Yang Masking - Source

    Sometimes, I see an image, and it inspires me. Two nights ago was one of those times. This was one of those images. I have no idea who the original creator of that image was, but I’d like to thank that person for making it. Anyway, it gave me some ideas. So I coded this quick little sketch in processing to produce a pair of masks for me - one mask would be the original Alpha, and for the other, I would use the Luma.

    How and why does one make use of two masks from one image? Well, I used them in the compositing breakdown below, and for the output below as well:

    It's a COMPOSITING EXPLOSION!!!

    More in this set to come.

    This image is one in a set named “Yin Yang Masking

    (via fyprocessing)

    — 2 months ago with 51 notes