Skip to content

Instantly share code, notes, and snippets.

NameIDBuilder nameIDBuilder = new NameIDBuilder();
NameID nameID = nameIDBuilder.buildObject();
nameID.setSPNameQualifier(spEntityId);
nameID.setValue(pai);
nameID.setFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent");
if (encryptionService != null) {
EncryptedID encryptedNameID = encryptionService.encryptNameID(nameID);
logoutRequest.setEncryptedID(encryptedNameID);
} else {
@mburrows02
mburrows02 / multiline-equation.tex
Last active August 29, 2015 14:14
Multi-line equation in math environment
\begin{align*}
\sigma&=(P(0)\times (1-\mu)^2+P(2)\times (-1-\mu)^2+P(5)\times (-4-\mu)^2\\
&\qquad {} + P(10)\times (-9-\mu)^2+P(50)\times (-49-\mu)^2\\
&\qquad {} + P(100)\times (-99-\mu)^2+P(500)\times (-499-\mu)^2\\
&\qquad {} + P(1000)\times (-999-\mu)^2+P(10000)\times (-9999-\mu)^2\\
&\qquad {} + P(100000)\times (-99999-\mu)^2\\
&\qquad {} + P(1000000)\times (-999999-\mu)^2)^{1/2}\\[3px]
&\approx 330.307\pagebreak
\end{align*}
@mburrows02
mburrows02 / BasicSimulation.scala
Created July 29, 2014 14:06
Basic Simulation with heaviside
package computerdatabase
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class BasicSimulation extends Simulation {
val httpConf = http
.baseURL("http://computer-database.herokuapp.com") // Here is the root for all relative URLs
@mburrows02
mburrows02 / CustomSimulation.scala
Last active April 18, 2023 23:23
Gatling simulation with dynamic scenarios and injection profiles
package test
import io.gatling.core.Predef._
import io.gatling.core.structure.PopulatedScenarioBuilder
import io.gatling.core.controller.inject.InjectionStep
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import scala.concurrent.duration._
import scala.collection.mutable.ArraySeq
import org.json.JSONArray;
import org.json.JSONObject;