Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, December 9, 2011

more thoughts about programming

I've come across the programming lanauge for text based adventure games at 
http://inform7.com/learn/man/doc61.html


Basically they wanted a language which was english like and able to handle cool amounts of inferanceing. I described it to a college as vernacular programming. Look the kinds of constructs they give. 


A dead end is either secret or ordinary.


This creates just one new property, not two. The names are taken as the two states of a single either/or property: secret means not ordinary, ordinary means not secret


A dead end is usually secret. A room is usually indoors.


A property can be used by several kinds at once. For example, the built-in either/or property "open" is used by both doors and containers, even though door isn't a kind of container and container isn't a kind of door.


Wow imagine if you had this in a typical programming languages or 



The lightest and easiest way to change behavior is with an Instead rule:


Instead of eating the apple: 
    say "It turns out to be made of beeswax, so that's a non-starter."
Instead of tasting an edible thing: 
    say "It's delicious!" 
    rule succeeds.

So basically this is like intercepting a message and redefining it ( but outside the comfort of a class). 

I'm not sure how much good software engineering there is here but that doesn't matter. What matters is how provocative this is in programming terms and I'm very provoked. 


Friday, March 11, 2011

ideal programming language thoughts

I think things like strong and weak references have to be brought into the programming language.

so in the definition
class Telephone 
{ 
  public: 
       
      Number phoneNumberDigit ; // normal 
      String weak name ;
      String  lazy phoneNumber ; // regenerable 
 } 


So when you assign elements you have

  thing.phoneNumberDigit = new Number( 230033) ; // normal 
 name <- "bob" ; // weak reference and don't forget it. 
 phoneNumber <- thing.phoneNumber.toString();// we can regenerate on demand 

   when you accesses them you get the same kind of thing.
  
    this->name.something(); 
   if( this->phoneNumber != null )  this->phoneNumber.something() ; // forced by compiler

naturally you would put the access to a lazy value in an accessor to make sure it was there when
you needed it.

Basically weak things say - if everyone else has stopped looking at this then its OK to loose the object. I don't own this I just know about it.
Lazy objects say - hay if your short of space its OK to loose this reference too I will check each time I need it.  Good for compact low memory environments.
  

Monday, December 21, 2009

Ill musings

Hi - I'm sitting at home feeling a bit crap. I had a cold this weekend and looking after kids when your feeling low is one of the outer rings of hell.

So I'm does up in bed and checked out Slashdot where there is a entry on what would happen if Facebook switchted from PHP to C as programming language of choice. What I thought was curious was that most of the comments began to talk about the 'speed' of PHP against C then comment on the ease of development of PHP against C++. Talk about Splughing.

I've talked at length about creating a new language based on C/C++ but removing things like buffer over runs (forbidding binaries with gets). But the C code would be embedded into the HTML code. Like this


[%C println("HELLO WORLD") ; %C]



Naturally there would be extensions for doing basic operations ( in built hashes? Strings, pattern matching ? ) and talking to Msql and so on. There would be a new stage where the code would have to be compiled into a binary with the HTML embedded.

I think what is most interesting about PHP/ASP and so on is that the languages appear to work because they embed code with HTML ( presentation) which is against the general separation of presentation and operation.

I think I've talked about this before but I'm so short of time I don't think I could create 'Green' quickly.

Thursday, October 1, 2009

Verification

I see a lot of programming work with statements like ( by redoing software like this it would be possible to do formal things with it ) . For example functional programming languages make this big claim that using this you could make something 'provable'.

This is the first time I've every seen something actually proved and its of some use. I think the next thing they should attempt is a garbage collector. I wonder how they handled multi-threading ( I guess that's what took 6 years )

Friday, November 21, 2008

OpenCV Yum

How lovely a version of openCV done for processing  and java. Lots of good examples. 

Thursday, November 13, 2008

Java persistence thought

I had a thought about Java there are number of persistent object systems and database links but my perception of them is that they are all rather complicated ( to define the relations between the two). 

I'm wondering if it would be better to think about making databases that look like a collection class. For example you might say

Map m  = new DatabaseMap( Address.class, // so we can make new ones. 
"mySimpleAddressDB" ,// name of table defaults to stored class name  
"username" , "pasword" // with standard defaults.
DatabaseMap.MYSQL_driver ) // database driver to use 

m.put( 34 , jonAddress ) ; // inserts  0verrides 
m.update( 34, jonAddress ) ; // update this item 
jonAddess = m.get( 34) ;  // override fetch 

for( Address a : m ) { println(a.toString(); } // look over whole table. 
for(DBMapQurey itter = m.itterator('WHERE name like 'bob') ; itter.empty(); a = itter.next())
{ 
println(a.toString(); 
} // extension to implement filter. 

This the map would look like a map to a programmer but operate exclusively on disk base storage. The Map uses methods of the class to get the values for address and gets/sets them. 

This would be a zero configuration approach to databases but limit people to simple objects. Worst case use annotations ( @db_field_name('INDEX' )  or @db_IS_PRIMAY_INDEX to help line up information between the class and the database.

Shurly someone must have done this -but what is it called?

Tuesday, September 30, 2008

Google table idea

Thinking about things with google earth I realised that with apple script I could send move messages to GEarth from gestures which I have recognised from the table. 

So could do the whole Jeff Han zooming in but with the table. 

No hint of multi touch what would more than one person get from it. Nothing but good for demos.

Tuesday, February 26, 2008

Cool on line logo website

Very nice  all done in javascript + canvas I'm told (could be wrong). 
Made me realise that this was an form of embodied programming... 

day of good ideas (AKA squeak rant)

The PC died in transit to the show. Jeff wants to use this as an excuse to get USB connection working to table. The down side is that he wants to make it work in smalltalk (in fact more specifically in squeak). I'm quite the cosmopolitan when it comes to computer languages but I'm not sure I want to stick to a ghetto language with out any specific reason to do so apart from Jeff's reluctance to learn anything else. I can hardly blame him, I've seen people resolutely stick to the first language they learnt over a 30 year carrier in computing. 

I love changing languages but have recently come to the conclusion that the reason I change languages is to get access to some new cool library (compiler writers please take note) that lets me code something neat up quick. That said I'm about to go back to C++ to use the open computer vision library but open computer vision is in desperate need of a significantly well written user guide. 

So my research in the next few weeks will lie either with signal processing signals from the diamond touch table or doing real time video processing for gesture recognition and we should do this all in squeak because it is good at using the multimedia processing features (oddly no), you can deliver double click-able applications that conform to the operating system  interface standard that the non programmers on the team can use(no), that lots of people can reuse our library (no), that we can make the program open source by integrating it on to source forge. Basically there is no clear reason to my mind to program this in smalltalk any more than there is a reason to program this in visual basic. 

I'm open to the case to use smalltalk but I need something distinctive that smalltalk has that I can't find anywhere else (translation give me a USP). Don't get me wrong small talk is a good tinkers language, if you out put are papers to conferences rather than code that other people can use( which is the life of an academic so I don't think Jeff is badly trained)  then small talk is the way to go. But I'm not sure this is my or the projects context. 

Sunday, September 2, 2007

Intreasting software failure

Odd thought. I'm looking for an algorithum which will do a convex hull algorithum on a set of data points I wanted to create in my data set. I've done a search with google and found a few very hevery weight system and a few examples. what is intreasting is I cannot use any of them. I have code already and this is strutured in a particular way. This makes deriving my code from one of the hevey weight systems difficult or impossible. You know they will have some complex build process and lots of 'utility' class that will have to be loaded up not to mention the inheritance problem. the smaller examples are just rough code outlines sutible for examples but not final versions.

So my quest to use a previously written package is thrwated.

I guess the only thing to do is to create something which works as a component and can be added simply to something else - an intreasting exersise if I have time.

Friday, August 10, 2007

Object messages

I wonder how many times we right pass along messages like

boolean isEmpty(){ return someinternalmember.isEmpty(); }

in those cases were we want to expose some functionality of in internal class without exposing all the methods of the member ( in effect making it public).

perhaps one day we will have

@expose member.isEmpty,member.add, memeber.remove

This line will add 3 new public messsages to this class which are just forwarded on to the member class.

you can tell I have another day pumping out the java TMA ?

Wednesday, May 9, 2007

table and mouse state of play.

hi all.
After a weekend of furious coding we now have a semi viable experiment system.
What is working
- you can have 1 or 3 people using the Dtouch table.
- they can move around and drag people around.
- wires follow people showing linkage.
- data is entered with as many academics as we can find.
- log files can be created ( R == record and stop record )
- hitting the M key gives the experimenter a Marker incase they spot something interesting and
want that in the log file ( can also be used to sync with logs)
- hitting the K key keeps' or makes a snap shot of the current work.
- hitting the O key opens the previous snap shot restoring layout to previous state

The multiple mouse system is working
- we can plug in up to 8 mice in hub and via multiple powered ups limit of 255 mice !! !
- basically repeats the same experiment
- zooming via scroll wheel.
- hitting the O key opens the previous snap shot restoring layout to previous state
- have enlarged table with MDF to give a mouse pad area (under screen).

Not perfect but enough to do a dry run or a rehearsal

Not done (yet)
- be nice to have just 2 icons to double click on rather than using NetBeans.
- log files are not namable - they need to be dragged/renamed between experiments.
- need to check the interaction to see if it feels comfortable.
- secondary network ( course teams ) needs reformatting.

problems/questions
- noticed that people might want mice to move with their orientation. Someone standing
on left hand side of mice might want his/her mouse to move 90 degrees to the
screen/text reading orientation.
- need to check if people are comfortable leaning over the MDF mouse zone.
- one pad is down
- need more mice with long cables
- some problems filming screen - the building plan is too bright - perhaps should invert it in photoshop?

notifications
I'm not in on Friday its a PHD day ( can swap with Thursday if have to), then off next week to conference. Will leave how to do it details plus be available for skypeing e.t.c

Tuesday, March 27, 2007

Pad++ and the zooming user interface with adaptive rendering!

I've just got the adaptive code working for the amazon interface. I was looking around and low and behold the other people who have done time centric rendinerging where the people doing the original zooming interface ( Ben Bederson, Jon Meyer ) .

Pad Papers

I think what I have produced is novel enough that I can do a paper about it - this in in Java there stuff was C plus plus /C/TCL. I wonder what happend to the Pad plus pluse interface. zooming user interface appears to be such a natural thing.

Friday, March 16, 2007

Multiple mice part 2

http://icculus.org/manymouse/

The other thing I have always wanted to build was a 3d editor with multiple mice. So to make a cube you pulled the mice appart each mouse would be the approrparate corner. This would require scroll wheel mice to be the part.

Actions like cutting would become very simple - you click on the think you want to cut and use the other mouse to do the cutting. You could also use one mouse to move the viewpoint while useing the first mouse to hold/move the item in question.

Multiple mice (part1)

I have been checking out.

http://icculus.org/manymouse/

or

http://jusb.sourceforge.net/?selected=about if you have a Linux box. This allows multiple keybords to.

I always liked the notion of the open meeting tool - a way where groups could have conversations but not have to take turns to speak. There would be a large screen on the wall and the chairman would ask for opinions like should we do this or do that. People could speak but others could annotate with their typed opinions - these could be ether named or anonymous. Could be done if you could collect the input from many keyboards.

I've sat in meetings where something has come up and some senior person says 'that reminds me of the the time...' (ok case of pot calling the kettle black here but bear with me). This tends to move the conversation along making it impossible for people to go back and readdress the question.
Meanwhile some underling has important information 'I know this is possible this has been done already by our competitors' or has some alternative suggestion but is too nice but to speak up.

more random thoughts next week.

sheep

Monday, March 12, 2007

fun with GML Diamond touch driver for the mac.

On Friday I ended up spending most of the day working with the GML mac driver.
http://iihm.imag.fr/projects/gml/
The driver let me write a mac version of the PC merl program ( kind of a Diamond Touch debugger). Looking at the output we began to wonder if it was possible to pick up 2 or 3 individual fingers. With this you could draw a line between two fingers or use it to roate a knob or shape.

Anneli was determined to figure it out and kept me thinking about it while I should have gone off and got some admin work done.

I will test the Mac Merl program for a bit and possibly release it ( I need to contact the GML people to see if I can relase their library with it).

Friday, February 16, 2007

Programming Languages.

We where talking about M151 - new course indevelopment at the open u. I said I think there are programmers out there that want to keep abreasts about new languages out there. Supose somene says I've been to three interviews and they want t to know If I could program in a language called Flubble* where can I go to learn that ?' What I found intreasting was that three people asked me later on what this Flubble lanauge was... (so I told them I just made it up )

*I just invented this on the spot as an example.

On the subject of languages. things I would like to see in language X


override void mymethodthing( int x | ( x > 0 :"no negative array arguments ") | , Object o | o != null && o.valid() )
{
//being method
}



this would mean that when someone called this method like this
thing. mymethodthing( -3 , this ) ; // this is the calling line.

that is the line | ( x > 0 :"no negative array arguments ") | is an assert sayign the first integer argument is non negative.

there would be a COMPILE TIME error or a RUNTIME error on the calling line ( not the sub routine ). After all the subroutine interface clearly states the limits of the method/function and you have just crossed the line. the problem is with the calling code not the method ( which has clearly stated the assumtions). May be more asserts could be used to augment code generation. More programming concepts later.

Monday, February 12, 2007

zooming interface - first mulitple person demo.

First demo of the tablet to HCI group.

I think it went pretty well a fair amount of useful input ( try using colour) could you use this to look at large who-knows-who data sets. Could you use the zooming to control unfolding a to-do interface.

I spent most of the morning try to get the demo working but the PC has problems with running the video projector AND the externa VGA big screen. I think we need a second monitor.

The VC is coming to visit in march and it looks like the tablet is on display.

Need to come up with better second screen interface.

Monday, January 29, 2007

Function Point Analysis - Function Points - Web Counting

Function Point Analysis Consultancy - Function Points FAQs - Web Based Applications,
Training,Counting, Estimating , Productivity and Auditing


I had an email over my desk about function point analysis. I tried to remember as much as I could but decided to google it. I get the impression FPA onyl has a general view of HCI - making HCI a late add on rather than a fundermental aspect of a computing project.

A little bit of examination later and I dug up this link to FPA an websites. I wonder if anything doing on UBIcomp and FPA or is that too close to Ubicomp as engineering?

Tuesday, January 23, 2007

diamondspin found!




I've wasted a lot of time trying to get Jbuilder and CVS to work together. Even http://www.tortoisecvs.org/ failed it can only handle a CVROOT on the same machine not as a remote drive. I'm guessing but I think the OU don't have a Pserver or a Kserver... although I could be wrong. I don't know enough about the servers to know what kind of unix boxes they have yet I could SSH to. I need to go and talk to more people. Still all very fustrating.

From the mac I CVS checkedout the source code to the zoom family tree stuff and then began to find my way though all the code. All very fustrating, the code that exists to run the diamond touch stuff never came up on my google searchs. Paul had some examples which ran in Java ( harray), and I was trying to figure out how to use them. Over lunch ( was is positivisum) mention was made of a diamond touch subsystem. After stuggleing with 3( count them ) diffrent java IDE's I eventually found something i could maniuplate. A little low level but hay that's cool. Y&P and the new woman Eva left for high tea while I hacked into the code which began to work!

I then got the pure zoomView to work and now just need to use the background thread feature of zoomView to pick up the touch and box events I have a couple of days doing PHD stuff but hope to have something primative on friday.

when i got home Yvonne emailed me a very excellent link to the diamondSpin people. Diamond spin hopefully if enough people linkt to it then it will appear in Google.

I think it might be possible to hack the diamond hardware and project up from a projector to some gound glass this would remove the hand shadow problem.