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
... | |
Jedis j; | |
j.connect(); | |
/* | |
*using NX parameter on ZADD command -> ADD IF NOT EXISTS -> UNIQUE | |
*using Timestamp as score -> always increasing -> always MAX score -> Like RPUSH on a list |
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
"aa",<SCORE OF aa> | |
"bb",<SCORE OF bb> | |
"cc",<SCORE OF cc> | |
"dd",<SCORE OF dd> |
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
{ | |
"name":"Muhammad Li", | |
"message":"Hello World", | |
"age":45, | |
"weight_kg":82, | |
"height_cm":188 | |
} |
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
... | |
<dependencies> | |
<!-- https://mvnrepository.com/artifact/com.sun.xml.rpc/jaxrpc-impl --> | |
<dependency> | |
<groupId>com.sun.xml.rpc</groupId> | |
<artifactId>jaxrpc-impl</artifactId> | |
<version>1.1.5</version> | |
</dependency> | |
</dependencies> |
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 main | |
import "fmt" | |
import "strconv" | |
func main() { | |
var cities = [4][4]int { | |
{0, 2, 5, 7} , // a b c d | |
{2, 0, 8, 3} , // b |
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 main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func main() { |
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
ssh [email protected] -L <ANY_AVAILABLE_PORT_YOU_FANCY>:127.0.0.1:39017 -N |
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 main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func main() { | |
num1 := "9879879879879879879879879879879879879879879879879879879879879879879879879879879875463473583567398798798798798798734526456367456745674999234582345898923845234523452345234523452989986001020012345678912398798798798798798798798798798798798798798798798798798798798798798798798798798798754634735835673987987987987987987345264563674567456749992345823458989238452345234523452345234529899860010200123456789123987987987987987987987987987987987987987987987987987987987987987987987987987987987546347358356739879879879879879873452645636745674567499923458234589892384523452345234523452345298998600102001234567891239879879879879879879879879879879879879879879879879879879879879879879879879879879875463473583567398798798798798798734526456367456745674999234582345898923845234523452345234523452989986001020012345678912398798798798798798798798798798798798798798798798798798798798798798798798798798798754634735835673987987987987987987345264563674567456749992345823458989238452 |
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
BucketOptions o=new BucketOptions(); | |
o.output( | |
new BsonField("student_ids", new Document("$push","$student_id")), | |
new BsonField("attended_class",new Document("$sum", | |
new Document("$cond", | |
Arrays.asList( | |
new Document("$gte",Arrays.asList("$attn",8)), | |
1, | |
0 |
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
Bson a=Aggregates.match( new Document("year", 5)); | |
BucketOptions o=new BucketOptions(); | |
o.output( | |
new BsonField("student_ids", new Document("$push","$student_id")), | |
new BsonField("attended_class",new Document("$sum", | |
new Document("$cond", | |
Arrays.asList( | |
new Document("$gte",Arrays.asList("$attn",8)), |
OlderNewer