text:
layout: page
title: Joseph Woodard's 51st Birthday
date: 2016-05-24
author: Justin Riggs
tags: weekly links, java
status: published
summary: Sed odio elit, eleifend vitae feugiat non.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 02/25/2018
  endDate: 03/01/2018
  ctyhocn: MKCSMHX
  groupCode: JW5B
published: true
---
Curabitur eu erat a ligula pharetra rutrum. Pellentesque molestie nunc leo, id aliquam nunc maximus id. Integer risus dui, auctor ut nisi vitae, commodo maximus neque. Morbi sed vulputate mi. Suspendisse commodo justo vitae arcu placerat, sit amet vehicula lectus sodales. Mauris rhoncus dui posuere rutrum pulvinar. Curabitur maximus enim ante, sed porttitor lectus viverra id. Curabitur sit amet lorem in diam euismod placerat eu ac massa. Donec laoreet massa at dui lacinia luctus. Morbi est est, elementum at turpis sit amet, pretium molestie neque. Cras auctor pulvinar odio, eu ornare turpis fringilla a. Praesent ultrices erat sed euismod vehicula. Vivamus vitae massa ante. Fusce quis elit tellus.

1 Vestibulum at tellus a dui tristique molestie
1 Ut vehicula nulla vitae lorem faucibus vehicula
1 Ut commodo purus varius fermentum maximus.

Etiam convallis nisl turpis, sit amet auctor ex posuere sed. Quisque quis lectus mi. Ut bibendum, neque sed molestie tempor, dui lacus vestibulum lacus, rutrum accumsan justo ipsum in leo. Quisque condimentum nulla erat, ut posuere arcu scelerisque quis. Donec quis lorem blandit, fermentum libero molestie, pharetra purus. Pellentesque eros nisi, egestas non porta sed, pharetra a magna. Maecenas quis posuere ex. Nullam nec nulla nec mauris feugiat gravida in ut arcu. Morbi auctor metus id ipsum convallis, sit amet pharetra velit luctus. Praesent vitae est ut lorem feugiat consectetur quis vel nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.


text:
struct ParamDescriptor
{
    char*	name;
    mdToken tok;
    DWORD	attr;
};

char* DumpMarshaling(IMDInternalImport* pImport,
                     __inout_ecount(cchszString) char* szString,
                     DWORD cchszString,
                     mdToken tok);
char* DumpParamAttr(__inout_ecount(cchszString) char* szString,
                    DWORD cchszString,
                    DWORD dwAttr);

const char* PrettyPrintSig(
    PCCOR_SIGNATURE typePtr,            // type to convert,
    unsigned typeLen,					// the lenght of 'typePtr'
    const char* name,                   // can be "", the name of the method for this sig 0 means local var sig
    CQuickBytes *out,                   // where to put the pretty printed string
    IMDInternalImport *pIMDI,           // ptr to IMDInternalImport class with ComSig
    __in_opt const char* inlabel,			// prefix for names (NULL if no names required)
    BOOL printTyArity=FALSE);           // flag to print Type Param number (MemberRefs only)

PCCOR_SIGNATURE PrettyPrintType(
    PCCOR_SIGNATURE typePtr,            // type to convert,
    CQuickBytes *out,                   // where to put the pretty printed string
    IMDInternalImport *pIMDI);          // ptr to IMDInternal class with ComSig

PCCOR_SIGNATURE PrettyPrintTypeOrDef(   // outside ILDASM - simple wrapper of PrettyPrintType
    PCCOR_SIGNATURE typePtr,            // type to convert,
    CQuickBytes *out,                   // where to put the pretty printed string
    IMDInternalImport *pIMDI);          // ptr to IMDInternal class with ComSig

const char* PrettyPrintClass(
    CQuickBytes *out,                   // where to put the pretty printed string
    mdToken tk,					 		// The class token to look up
    IMDInternalImport *pIMDI);          // ptr to IMDInternalImport class with ComSig

//================= ILDASM-specific ==================================================================

#ifdef __ILDASM__

#include "../ildasm/dynamicarray.h"

bool IsNameToQuote(const char *name);
bool IsLocalToQuote(const char *name);
const char* UnquotedProperName(__in __nullterminated const char* name, unsigned len=(unsigned)-1);
const char* ProperName(__in __nullterminated const char* name, bool isLocalName = false);
#define ProperLocalName(x) ProperName(x, true)
const char* KEYWORD(__in_opt __nullterminated const char* szOrig);
const char* COMMENT(__in_opt __nullterminated const char* szOrig);
const char* ERRORMSG(__in_opt __nullterminated const char* szOrig);
const char* ANCHORPT(__in __nullterminated const char* szOrig, mdToken tk);
const char* JUMPPT(__in __nullterminated const char* szOrig, mdToken tk);
const char* SCOPE(void);
const char* UNSCOPE(void);
const char* LTN(void);
const char* GTN(void);
const char* AMP(void);

extern BOOL g_fDumpRTF,g_fDumpHTML; // declared in FormatType.cpp
//-------------------------------------------------------------------------------
// Protection against null names
extern const char* const szStdNamePrefix[]; //declared in formatType.cpp

extern DynamicArray<mdToken>   *g_dups;
extern DWORD                   g_NumDups;
inline BOOL IsDup(mdToken tk)
{
    if(g_NumDups)
    {
        mdToken tktype = TypeFromToken(tk);
        if((tktype==mdtTypeDef)||(tktype==mdtMethodDef)||(tktype==mdtFieldDef))
        {
            for (unsigned i=0; i<g_NumDups; i++)
            {
                if((*g_dups)[i] == tk) return TRUE;
            }
        }
    }
    return FALSE;
}
#define MAKE_NAME_IF_NONE(psz, tk) { if((!(psz && *psz))||IsDup(tk)) { char* sz = (char*)_alloca(16); \
sprintf_s(sz,16,"$%s$%X",szStdNamePrefix[tk>>24],tk&0x00FFFFFF); psz = sz; } }

struct TypeDefDescr
{
    char* szName;
    mdToken tkTypeSpec;
    mdToken tkSelf;
    PCCOR_SIGNATURE psig;
    ULONG   cb;
};
extern DynamicArray<TypeDefDescr>   *g_typedefs;
extern DWORD                   g_NumTypedefs;

//-------------------------------------------------------------------------------
// Reference analysis (ILDASM)
struct TokPair
{
    mdToken tkUser;
    mdToken tkRef;
    TokPair() { tkUser = tkRef = 0; };
};
extern DynamicArray<TokPair>    *g_refs;
extern DWORD                    g_NumRefs;
extern mdToken                  g_tkRefUser; // for PrettyPrintSig
#define REGISTER_REF(x,y)  if(g_refs && (x)){ (*g_refs)[g_NumRefs].tkUser = x; (*g_refs)[g_NumRefs++].tkRef = y;}

//--------------------------------------------------------------------------------
// No-throw deallocators

#define SDELETE(x) {PAL_CPP_TRY{ delete (x); } PAL_CPP_CATCH_ALL { _ASSERTE(!"AV in scalar deallocator");} PAL_CPP_ENDTRY; (x)=NULL; }
#define VDELETE(x) {PAL_CPP_TRY{ delete [] (x); } PAL_CPP_CATCH_ALL { _ASSERTE(!"AV in vector deallocator");}; PAL_CPP_ENDTRY; (x)=NULL; }

//--------------------------------------------------------------------------------
// Generic param names
extern mdToken  g_tkVarOwner;
extern mdToken  g_tkMVarOwner;
//void SetVarOwner(mdToken tk) { g_tkVarOwner = tk; }
//void SetMVarOwner(mdToken tk) { g_tkMVarOwner = tk; }
BOOL PrettyPrintGP(                      // defined in dasm.cpp
    mdToken tkOwner,                    // Class, method or 0
    CQuickBytes *out,                   // where to put the pretty printed generic param
    int n);	      			 		    // Index of generic param

//============== End of ILDASM-specific ================================================================

#else

#define IsNameToQuote(x) false
#define IsLocalToQuote(x) false
#define UnquotedProperName(x) x
#define ProperName(x) x
#define ProperLocalName(x) x
#define KEYWORD(x) x
#define COMMENT(x) x
#define ERRORMSG(x) x
#define ANCHORPT(x,y) x
#define JUMPPT(x,y) x
#define SCOPE() "{"
#define UNSCOPE() "}"
#define LTN() "<"
#define GTN() ">"
#define AMP() "&"
#define REGISTER_REF(x,y) {}
#define MAKE_NAME_IF_NONE(x,y) { }
#define g_fDumpTokens false
#define SDELETE(x) delete (x)
#define VDELETE(x) delete [] (x)

#endif

#endif

redpajama_set_name: RedPajamaGithub


text:
/**
 * This package includes all annotations which are used to
 * annotating class like it would be written with the Guice ESL.
 */
package org.nnsoft.guice.autobind.scanner.asm;

/*
 *    Copyright 2012 The 99 Software Foundation
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */


text:
<?php

class CI_Loader
{
	protected $load;

	public function __construct()
	{
		$this->load = Seezoo::$Importer->classes('Importer');
	}

	public function library($libName)
	{
		$this->load->library($libName);
	}

	public function model($modelName)
	{
		$this->load->model($modelName);
	}

	public function helper($helperName)
	{
		return $this->load->helper($helperName);
	}

	public function view($path, $vars = array(), $return = FALSE)
	{
		$SZ = Seezoo::getInstance();
		return $SZ->view->render($path, $vars, $return);
	}

	public function config($conf, $orig = FALSE)
	{
		$this->load->config($conf, $orig);
	}
}


text:
/**
 *
 */
package org.dataportal.controllers;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

import org.dataportal.SystemSingleton;
import org.dataportal.model.Search;

/**
 * @author Micho Garcia
 *
 */
public class JPASearchController {

	/**
	 *
	 * Create an entitymanager
	 *
	 * @return EntityManager
	 */
	public EntityManager getEntityManager() {
		EntityManagerFactory entityFactory = Persistence
				.createEntityManagerFactory(SystemSingleton
						.getPersistenceUnit());
		return entityFactory.createEntityManager();
	}

	/**
	 * JPASearchController Constructor
	 */
	public JPASearchController() {
	}

	/**
	 * Insert the search received in params into RDBMS
	 *
	 * @param search
	 * @return boolean with operations result
	 * @throws Exception
	 */
	public Integer insert(Search search) throws Exception {

		EntityManager manager = getEntityManager();
		EntityTransaction transaction = manager.getTransaction();
		try {
			transaction.begin();
			manager.persist(search);
			transaction.commit();
			Integer id = search.getId();
			return id;
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		} finally {
		    if (transaction.isActive())
		    {
		        transaction.rollback();
		    }
			if (manager != null)
				manager.close();
		}
	}

	public void delete(Search search) throws Exception {

		EntityManager manager = getEntityManager();
		EntityTransaction transaction = manager.getTransaction();
		try {
			transaction.begin();
			Search searchInto = manager.find(Search.class, search.getId());
			if (searchInto != null) {
				manager.remove(searchInto);
				transaction.commit();
			} else {
				transaction.rollback();
			}
		} catch (Exception e) {
			throw e;
		} finally {
			if (transaction.isActive()) {
				transaction.rollback();
			}
			if (manager != null)
				manager.close();
		}
	}
}