contoh :
#[ | |
Copyright (c) 2019 RSDuck/Kemal Afzal | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
and associated documentation files (the "Software"), to deal in the Software without restriction, | |
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or |
include karax / prelude | |
import strutils | |
type | |
Model = object | |
counter*: int | |
Dispatch = proc(model: Model): void | |
proc init(): Model = | |
result = Model(counter: 0) |
Red [ | |
Title: "Red Android bridge demo" | |
Author: "Nenad Rakocevic" | |
File: %eval2.red | |
Config: [type: 'dll libRed?: no libRedRT?: yes export-ABI: 'cdecl] | |
Tabs: 4 | |
Needs: 'View | |
Rights: "Copyright (C) 2013-2017 Nenad Rakocevic. All rights reserved." | |
License: { | |
Distributed under the Boost Software License, Version 1.0. |
#[ | |
This Nim source file is a multiple threaded implementation to perform an | |
extremely fast Segmented Sieve of Zakiya (SSoZ) to find Twin Primes <= N. | |
Inputs are single values N, or ranges N1 and N2, of 64-bits, 0 -- 2^64 - 1. | |
Output is the number of twin primes <= N, or in range N1 to N2; the last | |
twin prime value for the range; and the total time of execution. | |
Code originally developed on a System76 laptop with an Intel I7 6700HQ cpu, | |
2.6-3.5 GHz clock, with 8 threads, and 16GB of memory. Parameter tuning |
First suggestion:
src/
<pkgname>.nim
tests/
docs/
<pkgname>.nimble # with srcDir = "src"
library with single module
There is a trending 'microservice' library called go-kit. I've been using the go-kit library for a while now. The library provide a lot of convenience integrations that you might need in your service: with service discovery with Consul, distributed tracing with Zipkin, for example, and nice logic utilities such as round robin client side load balancing, and circuit breaking. It is also providing a way to implement communication layer, with support of RPC and REST.
public class Sample1 | |
{ | |
public native int intMethod(int n); | |
public native boolean booleanMethod(boolean bool); | |
public native String stringMethod(String text); | |
public native int intArrayMethod(int[] intArray); | |
public static void main(String[] args) | |
{ | |
System.loadLibrary("Sample1"); |
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from