Archive for category programming

Rant: SF.net GIT repositories

If unable to push commits, use git clone ssh://USERNAME@git.code.sf.net/u/USERNAME/PROJECTNAME instead of proposed git clone ssh://USERNAME@git.code.sf.net/u/USERNAME/PROJECTNAME u-USERNAME-PROJECTNAME

LCM-WM002

LCM-WM002 is a 16×2 LCD display, coming from a “refurbished” equipment. To be true, the equipment was a HP 5000 / 5100 laser printer, and the LCD has a bezel and a PCB with buttons attached, named ESU19516, part number RG5-5438. Read the rest of this entry »

Tags: , ,

Rant on AVR ISRs

Once you define an ISR bit in the TIMSKx, the appropriate ISR must be attached.

Lost almost a day on non functioning serial port, until stumbled upon the post in stackoverflow.com

So, when copypasting

TIMSK1 |= (1 << TOIE1) | (1 << OCIE1A);

be sure to define both
ISR(TIMER1_OVF_vect) {
...
}

and
ISR (TIMER1_COMPA_vect)
{
...
}



                      

Tags: , ,

Current token in Arduino’s ArduinoSerialCommand

Ever played with ArduinoSerialCommand? Nice library, but it lacks the possibility to retrieve current command. This possibility is waiting in the pull request for a long time, so if you deadly need it – merge it by yourself.

Tags: ,

Meet the fMRI Parrot

fMRI Parrot

Camera
LG-D405n
Focal Length
3.2mm
Aperture
f/2.4
Exposure
1/20s
ISO
600

What the heck is “fMRI Parrot”?

First of all, the heck is fMRI. fMRI stands for “Functional Magnetic Resonace Imaging”, as defined in Wikipedia. It involves tons of expensive hardware, like Magnetic Resonance machine, and software, used to reconstruct the scanned volumes. During fMRI scanning a series of stimulus are applied to the patient and the brain is scanned using fast scanning MRI techniques. The aim of fMRI is to record immediate changes happening in particular areas of the brain.

The single MRI scan is called “volume”. It is created from a series of slices of the predefined thickness. Having more slices creates more detailed volume and extends acquisition time. As the changes of the brain activity are momentary, a short volume acquisition interval, named TR or “Time Repetition” is needed. Usually it varies from 7 to 1.5 seconds, depending on the capabilities of the MR machine. Short TR time supposes lower quality scans, compared to the “traditional” MR scanning. So the level of detail of particular volume is a trade off between time and specific requirements.

The fMRI scans consists from a number of volumes, recorded at particular intervals. The key condition for a successful scan is the precise timing. In order to find a region with elevated activity, a stimulus must be started just when the volume acquisition begins. For this the MRI machine may expose a short pulse – start of a volume. The pulse may be brought to the MRI control room via the interface box and the required stimulus started automatically. Some stimulus require the patient to respond, eg. press the predefined button. The response from the patient is also brought to the MRI control room. As there are special requirements for any hardware at the MRI machine, only certified equipment is allowed to the MR room. The requirement at the MRI control room are more relaxed as well as the choice of the equipment There are different vendors of the interface boxes and response buttons, NordicNeuroLab (NNL) being one of them.

In order to create the simulation series, or paradigmas in fMRI terminology, a lot of time is needed. Each paradigma is to be verified before the clinical test, while some of them can not be tested without a signal form the MRI scanner or a response from the patient. There is no need to say the MRI equipment is expensive, so is the time spent in the MRI machine. Most of the MRI scanner interface boxed can be used in so called “simulation” mode, sending particular responses at the predefined moments, without actually running the scanner. For example the Sync Box from NordicNeuroLab will send “S” symbol at the start of the volume acquisition, while fORP from Cambridge Reserch Systems is to send “5”. So what is actually required to test a paradigma, is the response from the scan… WAIT!

It’s must not be the MRI scanner nor the interface box.

Read the rest of this entry »

Tags: , , , , , , ,

On the door handiness in Autodesk Revit

I was working on semi – automated solution to enter door handiness in Revit models. The existing solutions are either quite expensive (like Reforma Swing Direction) or has weird assumptions.

My intial setup is Dynamo and the Dynamo Door Set Handing module from http://archi-lab.net/. It has fine tutorials, so you only need to create your model in Dynamo.

The weird thing on door handines is it is different in some countries.

  • Door handiness in Germany is defined as hinge position on the door, when one is pulling the door to open. if the hinges are on the left side, the door is left-handed, and if the hinges are on the right side, the door is right-handed. I will refer it ad “DIN – style”.
  • The IFC, together with ISO 16739 defines door handiness as the position of “positive Y axis”, which is definitelly the position of door handle when puling.  I will refer it as “ISO – style”.
  • Americans use ISO style, but also has “reversed” option. I still have no idea on this option, as “reversed right” is “left”.

So, what’s to do?

Read the rest of this entry »

Tags: , , ,

Revit and IronPython: the early bird

ODS module does not work on IronPython, and i don’t know the way to add Revit modules to regular Python.Whatever …

''' cut-n-paste from the net
 @author: ejs
 '''
 import clr
 import sys
 clr.AddReference('RevitAPI')
 clr.AddReference('RevitAPIUI')
 from Autodesk.Revit.DB import *
 from Autodesk.Revit.DB.Architecture import *
 from Autodesk.Revit.DB.Analysis import *
 
 #sys.path.append(r'C:\Python\3.4\Lib\site-packages')
 
 #from odslib import ODS
 
 #ods = ODS()
 
 uidoc = __revit__.ActiveUIDocument
 doc = __revit__.ActiveUIDocument.Document
 
 cView = uidoc.ActiveView
 
 collector = FilteredElementCollector(doc)
 collector = FilteredElementCollector(doc).OfClass(ViewSchedule);
 
elems=collector.ToElements()
 n_elems=len(elems)
 
 for elem in elems:
     if cView.Id == elem.Id: Read the rest of this entry »

Search engine providers for Firefox and MS IE

I’m lazy person.
Here are search engine providers for Firefox and MS IE web browsers.

I’ve added keywords for these search engines, like evt for Evita.lt, lmn for lemona.lt. Now, searching in particular site is as easy as Lotus 1-2-3: type in keyword and the term you need to search in the address bar. So, typing lmn ds180 will search for ds180 in Lemona.lt site.

Firefox Lemona.lt Evita.lt Datasheetcatalog.com
MS IE Lemona.lt Evita.lt Datasheetcatalog.com

Cheers.

Just for fun / ᛃᚡᛊᛏ᛫ᚠᚮᚱ᛫ᚠᚡᚾ

I’m glad to present a small webapp, converting entered text to probably Elder FUTHARK. No spell checking is performed, some rune combinations are ommited, but it may still be funny.

ᛁᛗ᛫ᚷᛚᚨᛑ᛫ᛏᚮ᛫ᛈᚱᛂᛊᛂᚾᛏ᛫ᚨ᛫ᛊᛗᚨᛚᛚ᛫ᚹᛂᛒᚨᛈᛈ᛬ᛍᚰᚡᛂᚱᛏᛁᛝ᛫ᛂᚾᛏᛂᚱᛂᛑ᛫ᛏᛂᛪᛏ᛫ᛏᚮ᛫ᛈᚱᚮᛒᚨᛒᛚᚤ᛫ᛂᛚᛑᛂᚱ᛫ᚠᚡᚦᚨᚱᚲ᛭ᚾᚮ᛫ᛊᛈᛂᛚᛚ᛫ᛍᚻᛂᛍᚲᛁᛝ᛫ᛁᛊ᛫ᛈᛂᚱᚠᚮᚱᛗᛂᛑ᛬ᛊᚮᛗᛂ᛫ᚱᚡᚾᛂ᛫ᛍᚮᛗᛒᛁᚾᚨᛏᛁᚰᛊ᛫ᚨᚱᛂ᛫ᚮᛗᛗᛁᛏᛂᛑ᛬ᛒᚡᛏ᛫ᛁᛏ᛫ᛗᚨᚤ᛫ᛊᛏᛁᛚᛚ᛫ᛒᛂ᛫ᚠᚡᚾᚾᚤ᛭

OpenOffice.org, x64 and .NET interface

Here,’s the story short:

I need to create a series of graph for highly scientific data sets. The data is calculated in MatLAB, but the export of figures in MatLAB is a pain for me.

On the other hand OpenOffice.org seems to be the right tool for the job. The latest MatLAB has the function, called ‘xlswrite’. Happy with the fact, hoping it should write the XLS file I fire it up and…

Ouch. One must have Excell installed, as the data export goes through the ActiveX. If no Excell is found, the data is exported into CSV file, overwriting the file every time. Not the Right Thing. Read the rest of this entry »

Tags: , ,