Best Syzkaller code snippet using main.getAxisTitle
benchcmp.go
Source:benchcmp.go
...196}197var axisTitles = map[string]string{198 "fuzzing": "Time, sec",199}200func getAxisTitle() string {201 value, ok := axisTitles[*flagOver]202 if ok {203 return value204 }205 return *flagOver206}207func display(graphs []*Graph) {208 var outf *os.File209 var err error210 if *flagOut == "" {211 outf, err = ioutil.TempFile("", "*.html")212 if err != nil {213 tool.Failf("failed to create temp file: %v", err)214 }215 } else {216 outf, err = os.Create(*flagOut)217 if err != nil {218 tool.Failf("failed to create file: %v", err)219 }220 }221 vars := map[string]interface{}{222 "Graphs": graphs,223 "HAxisTitle": getAxisTitle(),224 }225 if err := htmlTemplate.Execute(outf, vars); err != nil {226 tool.Failf("failed to execute template: %v", err)227 }228 outf.Close()229 if err := exec.Command("xdg-open", outf.Name()).Start(); err != nil {230 tool.Failf("failed to start browser: %v", err)231 }232}233type pointSlice []Point234func (a pointSlice) Len() int { return len(a) }235func (a pointSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }236func (a pointSlice) Less(i, j int) bool { return a[i].Time < a[j].Time }237var htmlTemplate = template.Must(...
graph.go
Source:graph.go
1package main2import (3 "fmt"4 ole "github.com/go-ole/go-ole"5 "github.com/tanaton/go-ole-msoffice/excel"6 "path/filepath"7 "strings"8)9type ExcelGraph struct {10 app *excel.Application11}12type GraphItem struct {13 x int14 count int15 rg *excel.Range16 leg []string17}18func main() {19 // COMã®åæå20 ole.CoInitializeEx(0, ole.COINIT_APARTMENTTHREADED|ole.COINIT_DISABLE_OLE1DDE)21 // 確å®ã«è¡ãå¿
è¦ããããã22 defer ole.CoUninitialize()23 // ã¨ã¯ã»ã«ãªãã¸ã§ã¯ãã®çæ24 e := excel.ThisApplication()25 if e == nil {26 return27 }28 ex := ExcelGraph{app: e}29 // çæãã¦ãæãåºãããã¢ããªã±ã¼ã·ã§ã³ã表示ãã30 ex.app.SetVisible(true)31 // æ¢åã®ããã¯ã®èªã¿è¾¼ã¿32 workbooks := ex.app.GetWorkbooks()33 rp, _ := filepath.Abs("data/data.csv")34 book := workbooks.Open(rp)35 // ã·ã¼ãã®åå¾36 sheets := book.GetWorksheets()37 sheet := sheets.GetItem(1)38 // 空ã°ã©ãã®çæ39 graph := sheet.ChartObjects().Add(30, 30, 500, 300)40 graph.SetName("graph.goã§çæããã°ã©ã")41 // éä¸æç»ããã¨é
ãã®ã§ãé©å½ã«ã¾ã¨ãã¦æç»ãã42 ex.app.SetScreenUpdating(false)43 // ã·ã¼ãå
容ãã°ã©ãã«å¤æ44 ex.sheetToChart(graph, sheet, []int{1, 2})45 ex.app.SetScreenUpdating(true)46 ex.app.SetScreenUpdating(false)47 // ã¿ã¤ãã«ãè¨å®48 ex.setGraphTitle(graph, "ã¶ããããã£ã¨")49 // ã°ã©ããªãã¸ã§ã¯ããã°ã©ãã·ã¼ãã«ç§»å50 chart := graph.GetChart()51 chart.Location(excel.XlLocationAsNewSheet, "ã°ã©ããã®1")52 ex.app.SetScreenUpdating(true)53 // ããã¯ãä¿å54 ex.app.SetDisplayAlerts(false)55 wp, _ := filepath.Abs("output.xlsx")56 book.SaveAs(wp, excel.XlWorkbookDefault)57 // ããã¯ãéãã58 book.Close()59 // Excelãéãã60 ex.app.Quit()61 // ã¡ã¢ãªè§£æ¾ã¿ãããªæã62 ex.app.Release()63}64// ã°ã©ãã«æç»ããããã®ãã¼ã¿ãåå¾65func (ex *ExcelGraph) getGraphRange(sheet *excel.Worksheet) []GraphItem {66 x := 167 arr := []GraphItem{}68 maxCol := sheet.GetCells().GetItem(1, sheet.GetColumns().GetCount()).GetEnd(excel.XlToLeft).GetColumn() + 169 // æ¢ç´¢70 for {71 v := sheet.GetCells().GetItem(1, x).GetValue()72 if v.Value() == nil || sheet.Err != nil {73 break74 }75 // åã®æ¢ç´¢76 leg := []string{}77 i := x + 178 for ; i < maxCol; i++ {79 v := sheet.GetCells().GetItem(1, i).GetValue()80 if v.Value() == nil || sheet.Err != nil {81 break82 } else {83 leg = append(leg, v.ToString())84 }85 }86 item := GraphItem{87 x: x, // ãã¼ã¿éå§ä½ç½®88 count: ((i - 1) - (x + 1)) + 1, // ãã¼ã¿ã®åæ°89 rg: sheet.GetRange(sheet.GetColumns().GetItem(x+1), sheet.GetColumns().GetItem(i-1)),90 leg: leg,91 }92 arr = append(arr, item)93 x = i + 194 }95 return arr96}97// ã·ã¼ãããã°ã©ããä½ã98func (ex *ExcelGraph) sheetToChart(g *excel.ChartObject, sheet *excel.Worksheet, secondary []int) {99 j := 1100 arr := ex.getGraphRange(sheet)101 if len(arr) <= 0 {102 fmt.Println("ã·ã¼ãã«ã°ã©ãåã§ãããã¼ã¿ãç¡ãã¿ãã")103 return104 }105 priname := []string{}106 secname := []string{}107 sec := map[int]struct{}{}108 for _, it := range secondary {109 sec[it] = struct{}{}110 }111 // ä¸ã¤ã®ã¬ã³ã¸ã«ã¾ã¨ãã112 union := arr[0].rg113 for i := 1; i < len(arr); i++ {114 union = ex.app.Union(union, arr[i].rg)115 }116 chart := g.GetChart()117 // ãã¼ã¿ã®è¨å®118 chart.SetSourceData(union, excel.XlColumns)119 // ã°ã©ãã®ç¨®é¡ãè¨å®120 chart.SetChartType(excel.XlXYScatterLinesNoMarkers)121 // å¡ä¾ã®ä½ç½®ãä¿®æ£122 legend := chart.GetLegend()123 legend.SetPosition(excel.XlLegendPositionBottom)124 // è¦ç´ ã®è¨å®125 for _, it := range arr {126 xcell := sheet.GetCells().GetItem(2, it.x)127 for k := 1; k <= it.count; k++ {128 // ç·ãã¨ã«X軸ã®è¨å®129 sc := chart.SeriesCollection().Item(j)130 if _, ok := sec[j]; ok {131 // 2軸132 sc.SetAxisGroup(excel.XlSecondary)133 secname = append(secname, it.leg[k-1])134 } else {135 priname = append(priname, it.leg[k-1])136 }137 end := xcell.GetEnd(excel.XlDown)138 rg := sheet.GetRange(xcell, end)139 sc.SetXValues(rg)140 j++141 }142 }143 // X軸ã®ååãåå¾144 var at string145 v := sheet.GetCells().GetItem(1, 1).GetValue()146 if v.Value() != nil && sheet.Err == nil {147 at = v.ToString()148 } else {149 at = "横軸"150 }151 // ã°ã©ãã®è»¸ã«ã¤ãã¦ã®è¨å®152 ex.setGraphAxis(g, strings.Join(priname, " / "), at)153 // æå®ããè¦ç´ ã第äºè»¸ã¸ç§»å154 if len(secondary) > 0 {155 ex.setGraphAxisSecondary(g, strings.Join(secname, " / "))156 }157}158// ã°ã©ãã®è»¸ãè¨å®159func (ex *ExcelGraph) setGraphAxis(g *excel.ChartObject, name, axistitle string) {160 chart := g.GetChart()161 cp := chart.Axes(excel.XlCategory, excel.XlPrimary)162 vp := chart.Axes(excel.XlValue, excel.XlPrimary)163 // X軸ã®ç®çç·ã®è¡¨ç¤º164 cp.SetHasMajorGridlines(true)165 cp.SetHasMinorGridlines(true)166 // Y軸ã®ç®çç·ã®è¡¨ç¤º167 vp.SetHasMinorGridlines(true)168 // ç®çç·ã®ä½ç½®ãä¸ã«ç§»å169 cp.SetTickLabelPosition(excel.XlTickLabelPositionLow)170 // X軸ã©ãã«ã表示171 cp.SetHasTitle(true)172 at := cp.GetAxisTitle()173 at.SetText(axistitle)174 // Y軸ã©ãã«ã表示175 vp.SetHasTitle(true)176 at = vp.GetAxisTitle()177 at.SetText(name)178}179// æå®ããè¦ç´ ã第äºè»¸ã«ç§»å180func (ex *ExcelGraph) setGraphAxisSecondary(g *excel.ChartObject, name string) {181 chart := g.GetChart()182 // 2軸ç®ã®Y軸ã©ãã«ã表示183 vs := chart.Axes(excel.XlValue, excel.XlSecondary)184 vs.SetHasTitle(true)185 at := vs.GetAxisTitle()186 at.SetText(name)187}188// ã¿ã¤ãã«ãè¨å®189func (ex *ExcelGraph) setGraphTitle(g *excel.ChartObject, title string) {190 chart := g.GetChart()191 chart.SetHasTitle(true)192 ct := chart.GetChartTitle()193 ct.SetText(title)194 ct.SetPosition(excel.XlChartElementPositionAutomatic)195 ct.SetIncludeInLayout(false) // ã¿ã¤ãã«ãã°ã©ãã¨éãã196}...
getAxisTitle
Using AI Code Generation
1import (2func main() {3 fmt.Println(getAxisTitle())4}5import (6func getAxisTitle() string {7}8import (9func main() {10 http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {11 fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))12 })13 http.ListenAndServe(":8080", nil)14}15import (16func main() {17 http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {18 fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))19 })20 http.ListenAndServe(":8080", nil)21}22import (23func main() {24 http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {25 fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))26 })27 http.ListenAndServe(":8080", nil)28}29import (30func main() {31 http.HandleFunc("/", func(w
getAxisTitle
Using AI Code Generation
1import (2func main() {3 fmt.Println(main.getAxisTitle())4}5import (6func main() {7 fmt.Println(main.getAxisTitle())8}9import (10func main() {11 fmt.Println(main.getAxisTitle())12}13import (14func main() {15 fmt.Println(main.getAxisTitle())16}17import (18func main() {19 fmt.Println(main.getAxisTitle())20}21import (22func main() {23 fmt.Println(main.getAxisTitle())24}25import (26func main() {27 fmt.Println(main.getAxisTitle())28}29import (30func main() {31 fmt.Println(main.getAxisTitle())32}33import (34func main() {35 fmt.Println(main.getAxisTitle())36}37import (38func main() {39 fmt.Println(main.getAxisTitle())40}41import (42func main() {43 fmt.Println(main.getAxisTitle())44}45import (
getAxisTitle
Using AI Code Generation
1import ("fmt")2func main() {3 var axisTitle = getAxisTitle()4 fmt.Println(axisTitle)5}6import ("fmt")7func getAxisTitle() string {8}9 /usr/lib/go-1.10/src/main (from $GOROOT)10 /home/user/go/src/main (from $GOPATH)11import (12func handler(w http.ResponseWriter, r *http.Request) {13 fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])14}15func main() {16 http.HandleFunc("/", handler)17 http.ListenAndServe(":8080", nil)18}19package net/http/httptest: unrecognized import path "net/http/httptest" (import path does not begin with hostname)
getAxisTitle
Using AI Code Generation
1import (2func main() {3 fmt.Println("Hello World!")4}5import (6type Axis struct {7}8func (a Axis) getAxisTitle() string {9}10func main() {11 fmt.Println("Hello World!")12}13cannot use a (type Axis) as type *Axis in argument to a.getAxisTitle14func (a *Axis) getAxisTitle() string {15}16func (a *Axis) getAxisTitle() string {17}18a := Axis{Title: "My Title"}19a.getAxisTitle()20func (a *Axis) getAxisTitle() string {21}22a := Axis{Title: "My Title"}23a.getAxisTitle()24func (a *Axis) getAxisTitle() string {25}26a := Axis{Title: "My Title"}27a.getAxisTitle()28func (a *Axis) getAxisTitle() string {29}30a := Axis{Title: "My Title"}31a.getAxisTitle()32func (a *Axis) getAxisTitle() string {33}
getAxisTitle
Using AI Code Generation
1import (2func main() {3 fmt.Println(axis.GetAxisTitle())4}5import (6func main() {7 fmt.Println(axis.GetAxisTitle())8}9import (10func main() {11 fmt.Println(axis.GetAxisTitle())12}13import (14func main() {15 fmt.Println(axis.GetAxisTitle())16}17import (18func main() {19 fmt.Println(axis.GetAxisTitle())20}21import (22func main() {23 fmt.Println(axis.GetAxisTitle())24}25import (26func main() {27 fmt.Println(axis.GetAxisTitle())28}29import (30func main() {31 fmt.Println(axis.GetAxisTitle())32}
getAxisTitle
Using AI Code Generation
1import (2func main() {3 axisObj := axis.Axis{}4 fmt.Println(axisObj.GetAxisTitle())5}6import (7func main() {8 axisObj := axis.Axis{}9 fmt.Println(axisObj.GetAxisTitle())10}11import (12func main() {13 axisObj := axis.Axis{}14 fmt.Println(axisObj.GetAxisTitle())15}16import (17func main() {18 axisObj := axis.Axis{}19 fmt.Println(axisObj.GetAxisTitle())20}21import (22func main() {23 axisObj := axis.Axis{}24 fmt.Println(axisObj.GetAxisTitle())25}26import (27func main() {28 axisObj := axis.Axis{}29 fmt.Println(axisObj.GetAxisTitle())30}31import (32func main() {33 axisObj := axis.Axis{}34 fmt.Println(axisObj.GetAxisTitle())35}36import (37func main() {38 axisObj := axis.Axis{}39 fmt.Println(axisObj.GetAxisTitle())40}41import (
getAxisTitle
Using AI Code Generation
1func main() {2 chart.getAxisTitle()3}4import "fmt"5type chart interface {6 getAxisTitle()7}8type lineChart struct {9}10type barChart struct {11}12func (line lineChart) getAxisTitle() {13 fmt.Println("x-axis")14 fmt.Println("y-axis")15}16func (bar barChart) getAxisTitle() {17 fmt.Println("x-axis")18 fmt.Println("y-axis")19}20func printAxisTitle(chart chart) {21 chart.getAxisTitle()22}23func main() {24 printAxisTitle(line)
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!