Skip to content

Instantly share code, notes, and snippets.

View Developer1Dev's full-sized avatar

Developer1Dev

View GitHub Profile
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)
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.
(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
};
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 + "]"
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)
)
)
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);
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])
#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:
@Developer1Dev
Developer1Dev / cinsight1.c
Created May 24, 2020 09:22
C Programming, Arrays, Pointers, References, C++ Programming
/*
In the following code coming from "The C Programming Language" of Kernighan and Ritchie,
we have an interesting insight, obvious, but still interesting to remind : even if the parameter s is not declared as a reference,
as it is allowed to be in C++, it acts as a reference. Indeed, what is behind an array in C Programming language, is a pointer.
*/
int getline(char s[ ], int lim)
{
int c,i;