Skip to content

Instantly share code, notes, and snippets.

@mnjstwins
mnjstwins / Using %ResultSet.SQL
Created December 9, 2016 18:34 — forked from mccrackend/Using %ResultSet.SQL
Using %ResultSet.SQL Objects for query results. Written in Intersystems Cache Object Script.
ResultSetSample()
// Build query string
Set sql = "Select Value, DateTimeStamp From Spectrum_Support_Metrics.EnsPerformanceMetricsData Where " _
"CheckType = 'datasize' AND " _
"Detail = '/ensemble/mgr/PROD/' AND " _
"DateTimeStamp > '201012170930'"
// Create new resultSet object to work with called "rs". It's basically a cursor.
// This %Prepare command executes the query contained in "sql", sets the result to "rs", and gives an "error" flag back.
Set rs = ##class(%ResultSet.SQL).%Prepare(sql,.error,"")
@mnjstwins
mnjstwins / search.csp
Created December 9, 2016 18:35 — forked from mhulse/search.csp
Caché DTI ContentPublisher: Tested in 7.6, 7.7.2: DEMO: Sorting search results by CMSStory property (in this case, I'm using publishedToWebDate")...
<csp:comment>
/// Sort ListObjects based on one or more properties.<br>
/// obj: A list object.<br>
/// dir: Direction, 1 ascending, -1 descending.<br>
/// prp: A property name.<br>
/// (c) 2008 J.Kavay<br>
/// Ref: http://groups.google.com/group/intersystems-public-cache/browse_thread/thread/289bc2e02e4875ff
</csp:comment>
<script language="cache" method="multiSortListObj" arguments='obj:%ListOfObjects=-1, dir:%Integer=1, prp...' returntype="%ListOfObjects" procedureblock="1">
@mnjstwins
mnjstwins / ewd3_cache.md
Created December 9, 2016 18:36 — forked from shabiel/ewd3_cache.md
Getting Started with EWD 3

EWD 3 on Cache/Windows

Documentation in Public Domain. No copyright claimed.

I am doing this on Cache/Windows with MinGW.

Everytime I say "test", you need to do a full sanity test. It will be obvious when things don't work.

First need to install Cache and Node.js. Make sure your Cachexxxx.node version and your node.js version are the same.

EWD Xpress Install

Reference: https://groups.google.com/d/msg/enterprise-web-developer-community/Wth-hLoAOpI/j8XyXog-BAAJ

@mnjstwins
mnjstwins / StudioRoutines.xml
Created December 9, 2016 18:36 — forked from daimor/StudioRoutines.xml
Caché JavaScript Routine
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for UNIX (SUSE Linux Enterprise Server for x86-64) 2014.1 (Build 608U)" ts="2014-05-19 00:22:31">
<Class name="%CJS.RoutineWizard">
<Description><![CDATA[
Studio Template:<br>
Create a new Cache JavaScript Routine.]]></Description>
<StorageStrategy/>
<Super>%ZEN.Template.studioTemplate</Super>
<TimeChanged>63325,86382.045933</TimeChanged>
<TimeCreated>63325,65834.566957</TimeCreated>
ftp://ftp.intron.ac/
ftp://ftp.ox.ac/
ftp://ftp.robelle3000.ai/
ftp://ftp.linux.org.ar/
ftp://ftp.secyt.gov.ar/
ftp://eclipt.uni-klu.ac.at/
ftp://ftp.ad.or.at/
ftp://ftp.adis.at/
ftp://ftp.ai.univie.ac.at/
ftp://ftp.cg.tuwien.ac.at/
@mnjstwins
mnjstwins / ResultSetConvertor.java
Created January 9, 2017 17:47 — forked from azakordonets/ResultSetConvertor.java
This class is designed to convert ResultSet data taken as a result of Db query into JSON. Also additional coverter methods are available
import org.json.JSONArray;
import org.json.JSONObject;
import java.sql.ResultSet;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
/**
* Utility for converting ResultSets into some Output formats
@mnjstwins
mnjstwins / _readme.md
Created February 15, 2017 17:43 — forked from maxivak/_readme.md
Vagrant with Ubuntu 16.04 in VirtualBox

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
s ^%oddENV("callererrorinfo")=1 ; record caller location
s ^%oddENV("callererrorinfo")=2 ; record caller stack
s ^%oddENV("callererrorinfo")=3 ; record caller ^%ETN
Do $SYSTEM.OBJ.DisplayError()
@mnjstwins
mnjstwins / PlayVideoUnity56beta.cs
Created August 28, 2017 17:59 — forked from demonixis/PlayVideoUnity56beta.cs
Playing a video with the new VideoPlayer component with Unity 5.6 beta.
public class VideoManager : MonoBehaviour
{
[SerializeField]
private RenderTexture _renderTexture = null;
[SerializeField]
private VideoClip _videoClip = null;
private IEnumerator Start()
{
Application.runInBackground = true;
@mnjstwins
mnjstwins / Angular2DotNetCoreResources.md
Created August 29, 2017 12:43 — forked from jerkovicl/Angular2DotNetCoreResources.md
Angular 2 and .NET Core resources and tutorials