Skip to content

Instantly share code, notes, and snippets.

using System;
using PowerLanguage.Strategy;
using ATCenterProxy.interop;
namespace PowerLanguage.Strategy
{
public enum OrderDirection
{
Long,
Short
using System;
using System.Drawing;
using PowerLanguage.Function;
namespace PowerLanguage.Strategy
{
[IOGMode(IOGMode.Enabled)]
public class CustomMACDStrategy : SignalObject
{
[Input]
@pandaxbacon
pandaxbacon / list.md
Created June 3, 2024 02:48 — forked from ih2502mk/list.md
Quantopian Lectures Saved
public UserPointResponseData getPoint(@PathVariable Integer id) {
Optional<UserPointResponseData> points = getPointInlet.getPoints(UUID.randomUUID(), "52251E57-15EC-4786-8161-46BF549D1704", id);
return points.get();
// 1. initial a LoyaltyPlusGatewayAdapter(outlet adaptor)
// 2. since our usecase constructor takes in (an outlet interface)
// 3. initial a usecase and then pass in the adaptor implmenetation we created in step 1
// new Usecase(outlet: LoyaltyPlusGatewayAdapter)
// return Usecase
// Inlet interfaces
public interface GetUserPointBalanceInlet {
Result<Map<String,Object>, Error> getUserPointBalance(String ssoid); // <- ssoid??
}
public interface PingTestInlet {
Result<Success, Error> pingTest();
}
class RestAdaptor {
// path /loyalty/user/create
class loyalty_user_create (params, requestBody) -> Result<> {
// CreateProfileInlet
}
}
//MARK: - RESTfulAdaptor
class RESTfulAdaptor: CreateProfileInlet, QueryMissionListInlet {
func createProfile(with ssoid: String) -> Result<Bool, Error?> {
function recordsReducer(state = { pageNumber: 0, records: [] }, action) {
switch (action.type) {
case 'first_load':
// Call API to get 100 records and pass the pageNumber as an argument
const records = api.getRecords(state.pageNumber);
// Update state.records with the records
return {
...state,
records
@pandaxbacon
pandaxbacon / README.md
Created August 26, 2016 04:00
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?

When are Python circular imports fatal?

In your Python package, you have:

  • an __init__.py that designates this as a Python package
  • a module_a.py, containing a function action_a() that references an attribute (like a function or variable) in module_b.py, and
  • a module_b.py, containing a function action_b() that references an attribute (like a function or variable) in module_a.py.

This situation can introduce a circular import error: module_a attempts to import module_b, but can't, because module_b needs to import module_a, which is in the process of being interpreted.

But, sometimes Python is magic, and code that looks like it should cause this circular import error works just fine!

@pandaxbacon
pandaxbacon / 词性标记.md
Created August 23, 2016 02:24 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名