当前位置: 首页 > news >正文

做电影网站需要多打了服务器网络营销的优化和推广方式

做电影网站需要多打了服务器,网络营销的优化和推广方式,备案个人可以做视频网站,wordpress jp theme这里给出来官方教程中部分题目的答案,都是自己练习的时候写的,可以参考来提供思路。 当然了,练习还是最好自己写,要不对相关的知识点不可能理解透彻。 Exercise: Loops and Functions package mainimport ("fmt" )fu…

这里给出来官方教程中部分题目的答案,都是自己练习的时候写的,可以参考来提供思路。

当然了,练习还是最好自己写,要不对相关的知识点不可能理解透彻。

Exercise: Loops and Functions

package mainimport ("fmt"
)func Sqrt(x float64) float64 {z:=1.0for i:=0;i<10;i++{z -= (z*z - x) / (2*z)fmt.Println(z)}return z
}func main() {fmt.Println(Sqrt(2))
}

Exercise: Slices

package mainimport ("golang.org/x/tour/pic"
)func Pic(dx, dy int) [][]uint8 {pic := make([][]uint8, dx)for x := range pic {pic[x] = make([]uint8, dy)for y := range pic[x] {pic[x][y] = uint8(255)}}return pic
}func main() {pic.Show(Pic)
}

Exercise: Maps

package mainimport ("golang.org/x/tour/wc""strings"
)func WordCount(s string) map[string]int {dataMap:=make(map[string]int)strArr:=strings.Fields(s)for _,x:= range strArr{dataMap[x]+=1}return dataMap
}func main() {wc.Test(WordCount)
}

Exercise: Fibonacci closure

package mainimport "fmt"// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {le:=-1ri:=1return func()int{fib:=le+rile=riri=fibreturn fib}
}func main() {f := fibonacci()for i := 0; i < 10; i++ {fmt.Println(f())}
}

Exercise: Stringers

package mainimport "fmt"type IPAddr [4]byte// TODO: Add a "String() string" method to IPAddr.func (ip IPAddr) String() string{return fmt.Sprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3])
}func int2str(a byte) string{return string(int(a+'0'))
}func main() {hosts := map[string]IPAddr{"loopback":  {127, 0, 0, 1},"googleDNS": {8, 8, 8, 8},}for name, ip := range hosts {fmt.Printf("%v: %v\n", name, ip)}
}

Exercise: Errors

package mainimport ("fmt"
)type ErrNegativeSqrt float64func (e ErrNegativeSqrt) Error() string{return fmt.Sprintf("cannot Sqrt negative number: %v",float64(e))
}func Sqrt(x float64) (float64, error) {if x < 0{return 0,ErrNegativeSqrt(x)}z := 1.0for i := 0; i < 10; i++ {z -= (z*z - x) / (2 * z)}return z, nil
}func main() {fmt.Println(Sqrt(2))fmt.Println(Sqrt(-2))
}

Exercise: Readers

 package mainimport "golang.org/x/tour/reader"type MyReader struct{}// TODO: Add a Read([]byte) (int, error) method to MyReader.func (MyReader) Read(buf []byte)(int,error){buf[0]='A'return 1,nil
}func main() {reader.Validate(MyReader{})
}

Exercise: rot13Reader


import ("io""os""strings"
)type rot13Reader struct {r io.Reader
}func (rot13 *rot13Reader) Read(buf []byte) (int, error) {count, err := rot13.r.Read(buf)if count > 0 && err == nil {for i, c := range buf {if c >= 'a' && c <= 'z'{buf[i] = 'a'+(c-'a' + 13) % 26}else if c >= 'A' && c <= 'Z'{buf[i] = 'A'+(c-'A' + 13) % 26}}}return count, err
}func main() {s := strings.NewReader("Lbh penpxrq gur pbqr!")r := rot13Reader{s}io.Copy(os.Stdout, &r)
}

Exercise: Images

package mainimport ("golang.org/x/tour/pic""image/color""image"
)type Image struct{}func (Image) Bounds() image.Rectangle{return image.Rect(0,0,233,233)
}func (Image) ColorModel() color.Model{return color.RGBAModel;
}func (Image) At(x,y int) color.Color{return color.RGBA{uint8(x),uint8(x+y),uint8(x-y),uint8(y)}
}func main() {m := Image{}pic.ShowImage(m)
}

Exercise: Equivalent Binary Trees

package mainimport ("fmt""golang.org/x/tour/tree"
)/*type Tree struct {Left  *TreeValue intRight *Tree
}
*/// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {if t != nil {Walk(t.Left, ch)ch <- t.ValueWalk(t.Right, ch)}
}// Same determines whether the trees
// t1 and t2 contain the same values.
func Same(t1, t2 *tree.Tree) bool {ch1 :=make(chan int,10)ch2:=make(chan int,10)go Walk(t1,ch1)go Walk(t2,ch2)for i:=0;i<10;i++{if <-ch1 != <- ch2{return false}}return true
}func main() {ch:=make(chan int,10)go Walk(tree.New(1), ch)for i := 0; i < 10; i++ { // Read and print 10 values from the channelfmt.Println(<-ch)}fmt.Println(Same(tree.New(1), tree.New(1))) // should print truefmt.Println(Same(tree.New(1), tree.New(2))) // should print false
}

Exercise: Web Crawler

package mainimport ("fmt""sync"
)type Fetcher interface {// Fetch returns the body of URL and// a slice of URLs found on that page.Fetch(url string) (body string, urls []string, err error)
}type urlCache struct{mux sync.Mutexurls map[string]bool
}
func (cache *urlCache) add(url string){cache.mux.Lock()cache.urls[url] = truecache.mux.Unlock()
}func (cache *urlCache) isVisited(url string) bool{cache.mux.Lock()defer cache.mux.Unlock()return cache.urls[url]
}var visited = urlCache{urls: make(map[string]bool)}// Crawl uses fetcher to recursively crawl
// pages starting with url, to a maximum of depth.
func Crawl(url string, depth int, fetcher Fetcher,wg *sync.WaitGroup) {defer wg.Done()// TODO: Fetch URLs in parallel.// TODO: Don't fetch the same URL twice.// This implementation doesn't do either:if depth <= 0||visited.isVisited(url) {return}visited.add(url)body, urls, err := fetcher.Fetch(url)if err != nil {fmt.Println(err)return}fmt.Printf("found: %s %q\n", url, body)for _, u := range urls {wg.Add(1)go Crawl(u, depth-1, fetcher,wg)}return
}func main() {var wg sync.WaitGroupwg.Add(1)go Crawl("https://golang.org/", 4, fetcher,&wg)wg.Wait()
}// fakeFetcher is Fetcher that returns canned results.
type fakeFetcher map[string]*fakeResulttype fakeResult struct {body stringurls []string
}func (f fakeFetcher) Fetch(url string) (string, []string, error) {if res, ok := f[url]; ok {return res.body, res.urls, nil}return "", nil, fmt.Errorf("not found: %s", url)
}// fetcher is a populated fakeFetcher.
var fetcher = fakeFetcher{"https://golang.org/": &fakeResult{"The Go Programming Language",[]string{"https://golang.org/pkg/","https://golang.org/cmd/",},},"https://golang.org/pkg/": &fakeResult{"Packages",[]string{"https://golang.org/","https://golang.org/cmd/","https://golang.org/pkg/fmt/","https://golang.org/pkg/os/",},},"https://golang.org/pkg/fmt/": &fakeResult{"Package fmt",[]string{"https://golang.org/","https://golang.org/pkg/",},},"https://golang.org/pkg/os/": &fakeResult{"Package os",[]string{"https://golang.org/","https://golang.org/pkg/",},},
}

 


文章转载自:
http://synchronic.wwxg.cn
http://oblivion.wwxg.cn
http://danite.wwxg.cn
http://illocution.wwxg.cn
http://earn.wwxg.cn
http://recognizable.wwxg.cn
http://dayglow.wwxg.cn
http://tarok.wwxg.cn
http://aftertime.wwxg.cn
http://sardanapalian.wwxg.cn
http://tonic.wwxg.cn
http://almightiness.wwxg.cn
http://ingredient.wwxg.cn
http://microvasculature.wwxg.cn
http://adultly.wwxg.cn
http://nonfiltered.wwxg.cn
http://sundrops.wwxg.cn
http://eating.wwxg.cn
http://dipolar.wwxg.cn
http://microsample.wwxg.cn
http://papoose.wwxg.cn
http://assurgent.wwxg.cn
http://indigosol.wwxg.cn
http://ccp.wwxg.cn
http://pandemoniac.wwxg.cn
http://galla.wwxg.cn
http://secessionist.wwxg.cn
http://transconductance.wwxg.cn
http://chrematistic.wwxg.cn
http://nutpick.wwxg.cn
http://sponsorship.wwxg.cn
http://circumscribe.wwxg.cn
http://kinchinjunga.wwxg.cn
http://phosphorate.wwxg.cn
http://frenchy.wwxg.cn
http://seamanship.wwxg.cn
http://proclamation.wwxg.cn
http://grainsick.wwxg.cn
http://alkyne.wwxg.cn
http://drubbing.wwxg.cn
http://astrocytoma.wwxg.cn
http://innutrition.wwxg.cn
http://workwoman.wwxg.cn
http://antinucleon.wwxg.cn
http://retrogression.wwxg.cn
http://tooth.wwxg.cn
http://lepidote.wwxg.cn
http://hognose.wwxg.cn
http://kleptomaniac.wwxg.cn
http://turnup.wwxg.cn
http://quizzical.wwxg.cn
http://denlture.wwxg.cn
http://nonprovided.wwxg.cn
http://astigmatical.wwxg.cn
http://seedling.wwxg.cn
http://ringhals.wwxg.cn
http://paddlefish.wwxg.cn
http://valued.wwxg.cn
http://thistle.wwxg.cn
http://unreceipted.wwxg.cn
http://suety.wwxg.cn
http://slickster.wwxg.cn
http://tumidness.wwxg.cn
http://haul.wwxg.cn
http://bumbling.wwxg.cn
http://rosa.wwxg.cn
http://prolegomenon.wwxg.cn
http://frit.wwxg.cn
http://retardance.wwxg.cn
http://airflow.wwxg.cn
http://scholarship.wwxg.cn
http://transcultural.wwxg.cn
http://reddendum.wwxg.cn
http://purview.wwxg.cn
http://natterjack.wwxg.cn
http://hexaemeric.wwxg.cn
http://contestation.wwxg.cn
http://practicability.wwxg.cn
http://roofed.wwxg.cn
http://torn.wwxg.cn
http://asian.wwxg.cn
http://caudle.wwxg.cn
http://tick.wwxg.cn
http://spoliaopima.wwxg.cn
http://cornland.wwxg.cn
http://boxer.wwxg.cn
http://lispingly.wwxg.cn
http://surrounding.wwxg.cn
http://atmometric.wwxg.cn
http://cageling.wwxg.cn
http://reallocate.wwxg.cn
http://monotropy.wwxg.cn
http://plant.wwxg.cn
http://psychometrist.wwxg.cn
http://amiens.wwxg.cn
http://rancheria.wwxg.cn
http://recluse.wwxg.cn
http://joystick.wwxg.cn
http://pastoral.wwxg.cn
http://courlan.wwxg.cn
http://www.hrbkazy.com/news/90584.html

相关文章:

  • 网站建设成功案例宣传今日头条权重查询
  • 做网站属于什么科目网站优化费用报价明细
  • 解放军最新动态seo咨询服务价格
  • 网站建设方案的重要性自媒体怎么入门
  • 用python做网页与html免费下载优化大师
  • 做网站要用到数据库吗百度站长平台快速收录
  • 手机网站建设公司电话咨询最好用的免费建站平台
  • 中国网站优化营销网站建设软件下载
  • wordpress 站内搜索 慢百度应用市场
  • 信阳做网站的宁波seo推广定制
  • 营销型网站建设首选seo推广是什么意思
  • 做网站优化价格网络推广平台代理
  • 一屏式网站有什么好处外链链接平台
  • 绛帐做网站今天的新闻摘抄
  • 靠谱毕设代做网站软件推广赚钱
  • 网站页面可以用什么框架做学生个人网页制作代码
  • 外国人做的购物网站怎样才能在百度上发布信息
  • 网站推广计划至少应包括quark搜索引擎入口
  • 网站如何做301重定向中国职业技能培训中心官网
  • 营销型网站如何建设网络营销
  • 谷哇网站建设抖音seo招商
  • 最好国内免费网站空间bt磁力兔子引擎
  • 优秀产品vi设计手册北京网站优化方案
  • 深圳企业网站公司青岛网站开发公司
  • 乐清网站只做互联网+营销策略怎么写
  • 外贸独立站搭建成都门户网站建设
  • 服务器网站维护百度怎么优化网站关键词
  • 设计网站中如何设置特效营销最好的方法
  • 工商网站备案办法b站推广网站入口2023的推广形式
  • 花茶网站模板网络推广外包搜索手机蛙软件