Giter Club home page Giter Club logo

go_web_app's People

Contributors

goestoeleven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go_web_app's Issues

doc2 does not execute after doc1

package main

import(
"net/http"
"io"
)

type statistic struct{
arr string
count int
Mean float32
Median float32
}

var integer []int
var cnt,i int
var sum,median float32

func main() {
http.HandleFunc("/", hello)
http.ListenAndServe(":9999", nil)
}

func hello(w http.ResponseWriter,r http.Request) {
s:= statistic{}
sum=0
w.Header().Set("Content-Type", "text/html")
switch r.Method {
case "GET":
/
display the form to the user */
io.WriteString(w, doc1 );
case "POST":
s.arr=r.FormValue("array")
for i:= range s.arr {
if s.arr[i]==0 {
continue
}
integer[i]=int(s.arr[i])
}
cnt=len(integer)
for i := range integer {
sum+=float32(integer[i])
}
s.count=cnt
s.Mean=float32(sum)/float32(cnt)
i=cnt%2
switch(i) {
case 0:
median=float32(integer[cnt/2]+integer[cnt/2-1])/2.0
break
case 1:
median=float32(integer[(cnt+1)/2])/2.0
break
}
s.Median=median
io.WriteString(w, doc2)
}
}

const doc1=`

<title></title>

Statistics

Computes basic statistics for the given list of numbers

`

const doc2=`

<title></title>

Statistics

Computes basic statistics for the given list of numbers

Numbers{{.arr}}
Count{{.count}}
Mean{{.Mean}}
Median{{.Median}}
`

for some reason once I click calculate on doc1,doc2 does not show up

howto: fix issue with commiting .idea dir

Hi, I've seen your youtube video, I like your project and way you talk about go, good job!
I can help you with git.
This should be applied to each branch:

  1. git rm -r --cached .idea
  2. add ".idea" and "*.iml" to .gitignore file
  3. commit those above

It is a good practise NOT to commit .idea directory to git project ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.