Skip to content

Instantly share code, notes, and snippets.

View rickyhai11's full-sized avatar

Rickyhai rickyhai11

View GitHub Profile
import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { FormGroup, FormControl, FormArray, FormBuilder, Validators } from '@angular/forms';
import { Option, Service } from '@shared/models';
import { ProvidersService } from '@shipping/shared/services/providers/providers.service';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
@Component({
selector: 'app-service-options',
.flex-container.align-center.flex-column
form.form([formGroup]='serviceOptionsForm', (ngSubmit)='onSubmit()')
.flex-container.flex-wrap
.element
label.field-label Options
.flex-container
.flex-container.multi-checkbox(*ngFor='let option of serviceOptionsForm.controls.options.controls; let i=index;', formArrayName='options')
input(type='checkbox', [formControl]='option', formControlName='{{i}}', (change)='selectServiceOptions()')
| {{options[i].name}}
@rickyhai11
rickyhai11 / introrx.md
Created October 9, 2019 20:21 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
Payload:
{
"items": [
{
"order_item_id": 3,
"qty": 1
},
{
"order_item_id": 5,
"qty": 1
0|app | info: App listening on http://localhost:8080
0|app | Loaded data from xml file successfully!
0|app | Generating a non-contract shipment...
0|app | Parsing the response to JSON format...
0|app | info: App listening on http://localhost:8080
0|app | info: App listening on http://localhost:8080
0|app | Loaded data from xml file successfully!
0|app | Generating a non-contract shipment...
0|app | Parsing the response to JSON format...
@rickyhai11
rickyhai11 / docker-image.md
Created January 20, 2019 05:47 — forked from pratos/docker-image.md
Build a Docker image

Build a docker image

  • Make sure you are in the folder that contains the Dockerfile
  • If your folder is /my-docker-image/, there should be 2 files in your folder:
    /my-docker-image
    |
    |---Dockerfile
    |---requirements.txt
    
org.deeplearning4j.exception.DL4JInvalidInputException: Cannot do forward pass in Convolution layer (layer name = layer0, layer index = 0): input array channels does not match CNN layer configuration (data input channels = 1, [minibatch,inputDepth,height,width]=[64, 1, 5, 1]; expected input channels = 5) (layer name: layer0, layer index: 0, layer type: Convolution1DLayer)
at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer.preOutput(ConvolutionLayer.java:282)
at org.deeplearning4j.nn.layers.convolution.Convolution1DLayer.preOutput(Convolution1DLayer.java:79)
at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer.activate(ConvolutionLayer.java:392)
at org.deeplearning4j.nn.layers.convolution.Convolution1DLayer.activate(Convolution1DLayer.java:92)
at org.deeplearning4j.nn.layers.AbstractLayer.activate(AbstractLayer.java:255)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.ffToLayerActivationsInWs(MultiLayerNetwork.java:966)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.comput
@rickyhai11
rickyhai11 / array_list.py
Created May 24, 2017 13:29
array_list created by rickyhai11 - https://repl.it/IOYX/29
import sys
import ctypes
import timeit
class Dynamic_Array(object):
def __init__(self):
self.n = 0
self.capacity = 10
#self.A = make_new_array()
@rickyhai11
rickyhai11 / inherit_test.py
Created May 23, 2017 15:18
inherit_test created by rickyhai11 - https://repl.it/INMl/16
def is_authorized(f):
def wrraper(self, *args, **kwargs):
if self._is_authorized:
return f(self, *args, **kwargs)
print ("you are not authorized")
return wrraper
@rickyhai11
rickyhai11 / cliHacks-bash-git.md
Created February 24, 2017 02:38 — forked from blackfalcon/cliHacks-bash-git.md
CLI hacks with BASH (and some GiT too)

As professionals we look to always optimize our workload. Through better processes and shortcuts we can eliminate unnecessarily repetitive tasks. One of the tools I use quite often is the Command Line Interface (CLI) and Git, and this is an area that we can automate quite extensively through some really simple to learn BASH hacks.

We all have tasks that we do endlessly, and there are tasks that we do independently and don't realize that there is a definitive pattern that we can embrace, put them to use in a simpler function and alter the results on a per use basis. It is through years of doing things the hard way that I have found some simple tricks that makes my life much easier to maintain.

What is BASH anyway?

Let's get this out of the way quickly first. In short, it is a Unix shell and command language most common on Linux and macOS and recently has made it's way to Windows as well. It is the common interface for running simple commands or other applications such as GiT, Curl, Ack, etc ...

If you