Skip to content

Instantly share code, notes, and snippets.

View alonsoir's full-sized avatar
👋
time to learn SCADA.

@alonso_isidoro alonsoir

👋
time to learn SCADA.
View GitHub Profile
@alonsoir
alonsoir / README.md
Created June 3, 2018 16:37 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
@alonsoir
alonsoir / official samples from databricks
Last active June 12, 2018 14:50
spark-structured-streaming 2.3.0 with kafka
https://github.com/apache/spark/tree/v2.3.0/examples/src/main/scala/org/apache/spark/examples/sql/streaming
@alonsoir
alonsoir / Operaciones-Git
Created October 15, 2018 10:16 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
1. Rebase Git workflow
When you’ve finished a feature on a local branch and it’s time to commit your changes to the master branch, you might prefer merging over rebasing.
I used to be in a team responsible for merging sprint features into the master branch. This was a nightmare. Always.
Another dev taught me an excellent Git workflow that combines rebasing and merging when it’s time to commit changes to the master branch, and it has honestly made such a difference to my workflow.
With the rebasing and merging combo outlined below, merge issues are kept to a minimum because your local history will match master before the final merge into master. No headaches! (Or just mini ones!)
1. Rebase Git workflow
When you’ve finished a feature on a local branch and it’s time to commit your changes to the master branch, you might prefer merging over rebasing.
I used to be in a team responsible for merging sprint features into the master branch. This was a nightmare. Always.
Another dev taught me an excellent Git workflow that combines rebasing and merging when it’s time to commit changes to the master branch, and it has honestly made such a difference to my workflow.
With the rebasing and merging combo outlined below, merge issues are kept to a minimum because your local history will match master before the final merge into master. No headaches! (Or just mini ones!)
@alonsoir
alonsoir / getCurrentFormattedTime.java
Created February 6, 2019 10:38
CURRENT TIME IN HH:MM:SS WITH JAVA 8+ AND DATETIMEFORMATTERBUILDER
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import static java.time.temporal.ChronoField.HOUR_OF_DAY;
import static java.time.temporal.ChronoField.MINUTE_OF_HOUR;
import static java.time.temporal.ChronoField.SECOND_OF_MINUTE;
static String currentFormattedTime() {
DateTimeFormatter timeFormatter = new DateTimeFormatterBuilder()
.appendValue(HOUR_OF_DAY, 2)
// cores can be four in my case because i have an i7 hyperthread with four physical cores.
// numThreadsToRun can be as much as you can. I usually run this code with this value set up to 10000000
// bigger the number, more time you need to finish the main task.
ExecutorService executor = Executors.newFixedThreadPool(cores * 2);
for (int i = 1; i <= numThreadsToRun; i++) {
if (isEmExp) {
Future<?> future = executor.submit(Utils.showSorteredValuesReversedOrder(pathToEM));
future.get(5, TimeUnit.SECONDS);
@alonsoir
alonsoir / setjdk.fish
Last active September 2, 2019 11:05 — forked from tobias/setjdk.fish
Manage multiple java versions on the mac from the fish shell
# quick way to change previous JAVA_HOME to jdk 8 version.
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8)
function setjdk
if test -n "$JAVA_HOME"
removeFromPath "$JAVA_HOME/bin"
end
set -gx JAVA_HOME (/usr/libexec/java_home -v $argv[1])
set -gx PATH $JAVA_HOME/bin $PATH
end
I am getting this exception when i try to load the model:
java.lang.IllegalStateException: Illegal set of indices for array: need at least 1 point/interval/all/specified indices for rank 1 array ([9472]), got indices [Point(0), Interval(b=0,e=64,s=1)]
at org.nd4j.base.Preconditions.throwStateEx(Preconditions.java:641)
at org.nd4j.base.Preconditions.checkState(Preconditions.java:412)
at org.nd4j.linalg.api.ndarray.BaseNDArray.get(BaseNDArray.java:4910)
at org.deeplearning4j.nn.layers.BaseLayer.setParams(BaseLayer.java:206)
at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer.setParams(ConvolutionLayer.java:483)
at com.aironman.demoFaceRecognition.service.FaceNetSmallV2Helper.loadWeights(FaceNetSmallV2Helper.java:142)
@alonsoir
alonsoir / scala.rb
Created October 10, 2019 15:19 — forked from fabiofumarola/scala.rb
Install Scala 2.10 RC3 on OSX
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10.0-RC3:
brew install https://raw.github.com/gist/4118557/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0-RC3