Nuke the oil slick

May 11th, 2010

You have to give it to the russians. They dont mind taking a few Risks.

adjusting innodb_log_file_size in mysql to get around

May 11th, 2010

I was getting “ERROR 1033 (HY000): Incorrect information in file: ‘./realworx_production/analyzers.frm’” whenever I tried to adjust my mysql innodb parameters and run a query.
To adjust this you have do delete or move the ib_logfile0 and ib_logfile1 file in your datadir. Then start the database.
So step-by-step
1. stop mysql
2. modify my.cnf, specifically the changes you want to make to innodb_log_file_size
3. move or delete ib_logfile1 and ib_logfile0
4. start database.

Accessing a non standard database in rails

August 15th, 2009

Normally in rails you would configure a production, test and development database in the database.yml file. If some of your rails data comes from a different database you can configure it in database.yml as well. For example I wanted two rails applications to synchronize their databases occassionally.
To do this I created a remote db in one of the rails application that looks like this in database.yml:

remotedb:
adapter: mysql
database: remote_rails
username: remote_user
password: remote_pwd
host: remote server

Inside the script that is executed by script/runner I did the following to access the new db.

admin_cfg=Rails::Configuration.new.database_configuration["remotedb"]
if remote_cfg.nil?
raise “admindb is not configured. Cannot pull data from admin db.”
end
dbh = Mysql.real_connect(remote_cfg["host"], remote_cfg["username"], remote_cfg["password"], remote_cfg["database"])
Now use ruby’s mysql library to work with dbh

Is apple trying to do an endrun around the desktop

August 14th, 2009

A friend told me suggested apple was making a cradle that allowed you to connect your iphone to a monitor , keyboard and mouse. This is an interesting idea. Could apple try to make a dent into the desktop market by replacing the desktop. After all windows XP’s minimum requirements includes a 233 MHz processor. The iphone runs 600 MHz and Im sure the iphone’s OS is not nearly as bloted as XP. What is the real difference between an iphone and a Mac.

writeMultibyte for Flex on Linux

May 30th, 2009

writeMultiByte is not working for linux (though it is fine in Windows) in Flashplayer 10.  It failed for me in the ByteArray class and I’ve seen other postings that the issue exist for the binarySocket class as well. At least for the us-ascii encoding.

A For loop around a writeByte is thework around

Radio Buttons act more like Combobox

April 1st, 2009

Normally what I would do with radio buttons is to look for a click event and set variables accordingly.  However there is another way to use radio button if you are operating more in a ‘filling out a form’ approach.

Here it is

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Label text="{'Radio Selected :'+ rg.selectedValue.toString()}"/>
<mx:RadioButtonGroup id="rg"/>
<mx:RadioButton x="10" y="26" value="RADIO 1" selected="true" label="radio1" groupName="rg"/>
<mx:RadioButton x="10" y="52" value="RADIO 2" label="radio2" groupName="rg"/>
</mx:Application>

It now works more like a combobox instead of individual buttons. The label will alwys show the button group’s selected Value.

Verify ItemEditors input in a datagrid.

March 27th, 2009

Working a lot with ItemEditors in DataGrids.

One of the issues I’ve been dealing with is adding validation to the item editor text entry. I’ve been attaching my validations to the item editor objects themselves however  the Datagrid object throws out ItemEditEnd events. You have to check the event’s DataGridReason to see whether it is a cancel or not and then you have the opportunity to validate the data.  If the data is bad then do a event.PreventDefault to interrupt the data acceptance and set the target’s errorString to the error message.

More details can be found here.

http://www.adobe.com/devnet/flex/articles/itemeditors_pt2.html

How to import a helper function into rails script/console

March 19th, 2009
>> foo = ActionView::Base.new
=> #<ActionView::Base:0x2aaab0ac2af8 @assigns_added=nil, @assigns={}, 
   @helpers=#<ActionView::Base::ProxyModule:0x2aaab0ac2a58>, @controller=nil, @view_paths=[]>

>> foo.extend YourHelperModule
=> #<ActionView::Base:0x2aaab0ac2af8 @assigns_added=nil, @assigns={},
    @helpers=#<ActionView::Base::ProxyModule:0x2aaab0ac2a58>, @controller=nil, @view_paths=[]>

>> foo.your_helper_method(args)
=> "<html>created by your helper</html>"

C Version of Adobe Flex Policy Server

February 28th, 2009

Here is a rewrite of the adobe flex policy server written in C.

FlexPolicyServer

This is useful if you are adding a flex based web interface to an embedded system (something running openwrt). You can use this policy server instead of the ones written in perl and python.

MINI SA from dunehaven

February 7th, 2009

I just got a mini SA board from dunehven.com. My goal was to write a flex UI for a spectrum analyzer. Somr ething I’ve done at work but unable to demo or discuss. So I’ve been looking for a cheap spectrum analyzer to supply the rf data. I’ve been considering a wi-spy but am unable to bring myself to buying a $200 device for this project. Ebay never gave me joy on finding a cheaper model. I’ve bidded on 2 or 3 models bug gave up at 120 dollars.

Then I found the MiniSA for $50 at dunehaven. Just from the specs it looks like it is better than the Wi-spy. However it is a little bit bulkier because in addition to the $50 SA you must buy a open source .Arduino board (~40). I like this solution better because I wanted to get into the AVR microcontrollers anyway.

First impressions of the MINISA is that the software is pretty minimal compared to what I’ve seen Wi-spy does. Wi-spy gives you templates, Spectrum screen, waterfall graphs, statistical displays and all sorts of daemon software.

MiniSA’s windows only client is a minimal Spectrum screen.

The other problem is that minisa’s usb protocol is not documented. I have email out to the designer hoping he will give me some info. Until then I might try my hand at some USB snooping.