This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func populate(v reflect.Value, value string) error { | |
switch v.Kind() { | |
case reflect.String: | |
v.SetString(value) | |
case reflect.Int: | |
i, err := strconv.ParseInt(value, 10, 64) | |
if err != nil { | |
return err | |
} | |
v.SetInt(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xAxis: { | |
type: 'category', | |
data: [<array with all the dates (sorted)>] | |
}, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var url = String.fromCharCode(112,117,115,104,95,117,114,108); | |
var cfg = String.fromCharCode(119,112,110,67,111,110,102,105,103); | |
window[cfg] = { | |
utm_source: 'og', | |
utm_campaign: 20914, | |
utm_content: '______', | |
domain: window.location.host, | |
proto: window.location.protocol | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package repeat | |
abstract class MyList[+A] { | |
def head: A | |
def tail: MyList[A] | |
def isEmpty: Boolean | |
def add[B >: A](element: B): MyList[B] | |
def printElements: String | |
override def toString: String = "[" + printElements + "]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val model = DonutModel( | |
cap = 8f, | |
masterProgress = 1f, | |
sections = listOf( | |
DonutSection(amount = 1f, color = Color.Cyan), | |
DonutSection(amount = 1f, color = Color.Red), | |
DonutSection(amount = 1f, color = Color.Green), | |
DonutSection(amount = 0f, color = Color.Blue) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request(): Observable<any> { | |
return new Observable(observer => { | |
fetch(`${baseUrl}${this.url}`,{ | |
method: this.method as any, | |
headers: this.headers, | |
body: this.body | |
}).then((r: any) => { | |
return r.json() | |
}).then((data: any) => { | |
observer.next(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list_ex1=[1,5,7,-10,12,14,-16,-8,0] | |
pos=[] | |
neg=[] | |
neg.append(list_ex1[0]) if list_ex1[0]<0 else pos.append(list_ex1[0]) | |
neg.append(list_ex1[1]) if list_ex1[1]<0 else pos.append(list_ex1[1]) | |
neg.append(list_ex1[2]) if list_ex1[2]<0 else pos.append(list_ex1[2]) | |
neg.append(list_ex1[3]) if list_ex1[3]<0 else pos.append(list_ex1[3]) | |
neg.append(list_ex1[4]) if list_ex1[4]<0 else pos.append(list_ex1[4]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I like this code | |
f_loop=[1,5,7,-10,12,14,-16] | |
pos=[] | |
neg=[] | |
for i in f_loop: | |
if i<0: | |
neg.append(i) | |
elif i>0: |