Skip to content

Instantly share code, notes, and snippets.

View misgeatgit's full-sized avatar
🎯

Misgana Bayetta misgeatgit

🎯
  • opencog
  • HongKong
View GitHub Profile
import datetime
import time
import urllib2
from BeautifulSoup import BeautifulSoup
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3'}
import time
while True:
{
"result": {
"atoms": [
{
"attentionvalue": {
"lti": 0,
"sti": 0,
"vlti": false
},
"handle": 10,
{
"result": {
"atoms": [
{
"attentionvalue": {
"lti": 0,
"sti": 0,
"vlti": false
},
"handle": 3984,
#include <algorithm>
#include <iostream>
#include <vector>
std::pair<int,int> find_sum(int sum, std::vector<int> aray)
{
std::vector<int> temp = aray;
std::sort(temp.begin(), temp.end()); // Ascending order
int i1; int i2;
diff --git a/opencog/attention/ImportanceDiffusionBase.cc b/opencog/attention/ImportanceDiffusionBase.cc
index 850818f..23f6244 100644
--- a/opencog/attention/ImportanceDiffusionBase.cc
+++ b/opencog/attention/ImportanceDiffusionBase.cc
@@ -131,35 +131,6 @@ void ImportanceDiffusionBase::diffuseAtom(Handle source)
AttentionValue::sti_t totalDiffusionAmount =
calculateDiffusionAmount(source);
-#ifdef LOG_AV_STAT
- // Log sti gain from spreading via non-hebbian links
/*
* Given a binary matrix, find the largest subsquare matrix.
*
*
*/
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
typedef unsigned int uint;

ECAN latest updates

Features added

  • Multithreaded mode
  • Runtime parameter loading and updating
  • Agents divided further more in to AF(AFImportanceUpdatingAgent and AFRentCollectionAgent) agents and WA agents (WAImportanceUpdatingAgent, WARentCollectionAgent)
  • Fine grained control of agent's runing time is possible. i.e via sleep sys call
  • Floating point importance values
@misgeatgit
misgeatgit / print_time.cc
Created May 11, 2017 05:10
print time_point
#include <iostream>
#include <chrono>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <string>
using namespace std::chrono;
int main(){
# Artanis is a guile web framework. Below are some code snippets demonestrating how to use it.
#------------------------------------------------------------------------------------------------
# A simple demo of parsing get parameters. eg. http://127.0.0.1:8080/hello?first=Foo&last=Bar
guile -c '(use-modules (artanis artanis))(get "/hello" (lambda (rc)(format #f "<h1 s style=\"color:YellowGreen\">Hola ~a ~a!</h1> " (params rc "first") (params rc "last")))) (run #:port 8080)'
# The executable has output sth like:
# cnode-8
# cnode-77
# cnode-7
# .
# .
# Which are randomly selcted outpus from cnode-i set where i is a natural number bn 0 and 2000.
# and the selection is done 10,000 times.
# Objective:
# count how many times each cnode-i has been choosen out of 10,000 draws.