Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View 3Nigma's full-sized avatar
Sprinting

Victor ADĂSCĂLIȚEI 3Nigma

Sprinting
View GitHub Profile
@3Nigma
3Nigma / talk-to.dialogflow.request.w-on
Created March 15, 2020 09:58
New DialogFlow conversation session request body - session highlights with custom query
{
...
"originalDetectIntentRequest": {
...
"payload": {
...
"conversation": {
"conversationId": "...gZsMB8ajfLvsg",
"type": "NEW"
},
@3Nigma
3Nigma / talk-to.dialogflow.request
Created March 15, 2020 09:29
New DialogFlow conversation session request body - session highlights
{
...
"originalDetectIntentRequest": {
...
"payload": {
...
"conversation": {
"conversationId": "...5nmoRA2pY",
"type": "NEW"
},
@3Nigma
3Nigma / <Android-ART>\compiler\compiler_driver.cc
Created June 11, 2014 08:49
Method used to analyze the triggering of the new "return-void-barrier" opcode in Google's Android ART distribution
static void ResolveClassFieldsAndMethods(const ParallelCompilationManager* manager,
size_t class_def_index)
LOCKS_EXCLUDED(Locks::mutator_lock_) {
ATRACE_CALL();
Thread* self = Thread::Current();
jobject jclass_loader = manager->GetClassLoader();
const DexFile& dex_file = *manager->GetDexFile();
ClassLinker* class_linker = manager->GetClassLinker();
// If an instance field is final then we need to have a barrier on the return, static final
@3Nigma
3Nigma / gist:8964454
Created February 12, 2014 21:03
Octave/Matlab action-value method applied to the n-bandit problem and solved through an incremented epsilon-greedy approach
# the optimization consists in the elimination of the 'Qsum' variable from the normal case and modifying
# 'Qavg' directly using a simple mathematica observation as Rich Sutton elegantly demonstrates
# in section 2.4
function totalRewards = simulate_epsg_n_bandit(n, eps, gamecnt, rollcnt)
# make room for the estimated value - action [Q_t(a)]
totalRewards = zeros(1, rollcnt);
for k = 1:gamecnt
# generate the true value - action [q_*(a)] from a normal distribution of mean 0 and variance 1
@3Nigma
3Nigma / gist:8964249
Last active August 29, 2015 13:56
Octave/Matlab action-value method applied to the n-bandit problem and solved through a normal epsilon-greedy approach
function totalRewards = simulate_epsg_n_bandit(n, eps, gamecnt, rollcnt)
# make room for the estimated value - action [Q_t(a)]
totalRewards = zeros(1, rollcnt);
for k = 1:gamecnt
# generate the true value - action [q_*(a)] from a normal distribution of mean 0 and variance 1
q = randn(1, n);
# reset some game related, auxiliary variables
Qavg = zeros(1, n);
@3Nigma
3Nigma / gist:5962112
Created July 9, 2013 23:03
G+ VHDL SDRAM reading problem
addr : out std_logic_vector (SDR_ADDR_WIDTH - 1 downto 0);
data : in std_logic_vector (SDR_DATA_WIDTH - 1 downto 0);
...
addr(addr'length - 1 downto 0) <= data(addr'length - 1 downto 0);
@3Nigma
3Nigma / gist:5962035
Created July 9, 2013 22:52
Tri-state VHDL principle
tri_st_data : process (mem_write_data, data, cur_memc_st)
begin
if (cur_memc_st = ctrl_wait_for_write) then
data <= mem_write_data;
else
data <= (others => 'Z');
end if;
mem_read_data <= data;
end process tri_st_data;
#include "FastPWM.h"
FastPWM::FastPWM(PinName pin) : PWMObject(pin){
//Set clock source
LPC_SC->PCLKSEL0|=1<<12;
_duty=0;
_period=0.02;
if (pin==p26||pin==LED1) {
PWMUnit=1;
@3Nigma
3Nigma / gist:5430254
Last active December 16, 2015 11:49
Codul-lipici complet ce testează modulul PS/2-Mouse (ps2m) prezentat în numărul 2 al revistei "Electronica Azi Hobby" (eAh) / Aprilie '13
/*
* Aplicatie test pentru Modulul de comunicatii AVR-PS/2 Mouse
* Copyright (c) 2013, Victor ADASCALITEI, admin@tuscale.ro
*
* Eliberez aceste surse sub licenta CC de tip BY-NC-SA 3.0 . Pentru mai multe informatii, va invit sa accesati
* urmatoarea adresa : http://creativecommons.org/licenses/by-nc-sa/3.0/ro/ .
*/
#include <avr/io.h>
@3Nigma
3Nigma / ps2mouse.c
Last active December 16, 2015 05:28
Antetul (.h) și codul suport (.c) al librăriei avrps2m responsabilă de comunicațiile între un dispozitiv AVR și un mouse PS/2.
/*
* Modul de comunicatii AVR-PS/2 Mouse
* Copyright (c) 2013, Victor ADASCALITEI, admin@tuscale.ro
*
* Eliberez aceste surse sub licenta CC de tip BY-NC-SA 3.0 . Pentru mai multe informatii, va invit sa accesati
* urmatoarea adresa : http://creativecommons.org/licenses/by-nc-sa/3.0/ro/ .
*/
#include <avr/interrupt.h>
#define F_CPU 9600000UL