Skip to content

Instantly share code, notes, and snippets.

View mmalohlava's full-sized avatar
:octocat:

Michal Malohlava mmalohlava

:octocat:
View GitHub Profile
@mmalohlava
mmalohlava / agent loop
Created March 10, 2025 20:41 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
from cgroups import Cgroup
from cgroups.user import create_user_cgroups
import os
import subprocess
try:
# setup cgroup directory for this user
user = os.getlogin()
create_user_cgroups(user)
@mmalohlava
mmalohlava / 20170621_hiring_hackathon.md
Last active June 21, 2017 22:47
06/21 Hiring Hackathon

06/21 Hiring Hackathon

Assignment: Develop "GitHub PR Query" tool

GitHub PR Query tool

Design a command line utility to get list of all PRs in given time interval (last hour, day, 3 weeks, 6 months).

The list should include:

  • all merged PRs in the specified interval
@mmalohlava
mmalohlava / msg.md
Created May 11, 2017 23:21
H2O 3.12 Announcement

Hello H2O community,

there are many new changes in H2O ecosystem and we are working furiously to publish and share them with the community.

In this context, we are preparing a new H2O release 3.12 with amazing features (e.g., AutoML, XGBoost support) and planning some changes which can affect existing code bases. This email would like to inform and start discussion about them.

The changes include:

  • migrating from Java 6 to Java 7
  • modularization of code base with help of Java Service Provider Interface (SPI) instead of using reflections library
@mmalohlava
mmalohlava / karel_ha_assignment.md
Last active March 31, 2017 09:23
Assignment: Improve H2O PCA

Assignment: Improve H2O PCA

The goal of this assignment is to:

  1. Get familiar with the H2O stack
  2. Make an improvement in H2O

Details

H2O provides implementation of the PCA algorithm which depends on the Jama library. The library is used for several tasks including Singular Value Decomposition (SVD). However, the library also introduces sub-optimal performance.

@mmalohlava
mmalohlava / 0_sparkling_water_workshop.md
Last active February 16, 2017 16:25
H2O Open Tour 2016, Dallas

Sparkling Water Workshop

@mmalohlava
mmalohlava / a.java
Created May 16, 2016 23:25
Decompiled Jython code
import org.python.core.PyRunnableBootstrap;
import org.python.core.CodeBootstrap;
import org.python.core.CodeLoader;
import org.python.core.PyFunction;
import org.python.core.Py;
import org.python.core.PyObject;
import org.python.core.ThreadState;
import org.python.core.PyFrame;
import org.python.core.PyCode;
import org.python.compiler.Filename;
@mmalohlava
mmalohlava / start.sh
Last active October 7, 2016 05:30
Start Spark with Sparkling Water
$SPARK_HOME/bin/spark-submit \
--master "local[*]" \
--class water.SparklingWaterDriver \
--packages ai.h2o:sparkling-water-examples_2.11:2.0.0 \
--executor-memory=8g \
--driver-memory=8g \
--conf spark.driver.extraJavaOptions="-XX:MaxPermSize=256m" \
--conf spark.executor.extraJavaOptions="-XX:MaxPermSize=256m" \
--conf spark.ext.h2o.node.log.level=INFO \
--conf spark.ext.h2o.client.log.level=INFO \
@mmalohlava
mmalohlava / LoadModel.java
Created October 6, 2015 18:00
Load model into DKV
public ModelsV3 importModel(int version, ModelImportV3 mimport) {
ModelsV3 s = (ModelsV3) Schema.newInstance(ModelsV3.class);
try {
List<Key> importedKeys = new ObjectTreeBinarySerializer().load(FileUtils.getURI(mimport.dir));
Model model = (Model) importedKeys.get(0).get();
s.models = new ModelSchema[1];
s.models[0] = (ModelSchema) Schema.schema(version, model).fillFromImpl(model);
} catch (IOException e) {
throw new H2OIllegalArgumentException("dir", "importModel", e);
@mmalohlava
mmalohlava / ZipPrediction.scala
Created October 6, 2015 17:57
Zip prediction with actual response
//It depends what is your next processing step, i
// f you need to have data in (a) Spark DataFrame or you are happy with data in (b) H2OFrame.
// (a) We need data in DataFrame
val reconstructionError = dlModel.scoreAutoEncoder(train, Key.make)
val df: DataFrame = h2oContext.asDataFrame(reconstructionError)(sqlContext)
val joinedFrame = testData.zip(df) // This is Spark DataFrame
// Note: you need Spark 1.3, or 1.4
// (b) We need data in H2OFrame
val testDataH2OFrame: H2OFrame = h2oContext.asH2OFrame(testData);