Here is another good screencast on using Inkscape. This is my effort. Not as good as his, but I don't think it's too bad at all. Not sure what I would use this for though...
This is a handy piece of code. As your database gets bigger you can allow the user to pick the correct value by typing. If the db gets very big, you can always increase the threshold, so that the query does not run until there will be a suitably sized resultset returned. Running it at a threshold of 1 is fine for very small resultsets. Here is the code you need to back your AutoCompleteTextView with a cursor adapter. @Override protected void onResume() { super.onResume(); text = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1); final AdapterHelper h = new AdapterHelper(this); Cursor c = h.getAllResults(); startManagingCursor(c); String[] from = new String[] { "val" }; int[] to = new int[] { android.R.id.text1 }; CursorAdapter adapter = new MyCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, c, from, to); adapter.setFilterQueryProvider(new FilterQueryProvider() { public Cursor runQuery(Cha...
Inkscape has a command line that lets you do stuff in batch form. The most obvious use of this for an Android developer is to produce the various image resolutions required to support multiple devices on Android. This code opens inkscape, opens the drawing indicated (I created the $desktop variable to facilitate this) and then exports this drawing as a png file. $ inkscape --file=$desktop/inkscape-work/mystar.svg --export-png=$desktop/myfile.png -D The -D switch makes sure the whole drawing is exported, not just the page, or selected objects (you can select objects from the command line too). Width and height can also be provided, or you can give a resolution for the output. This is where the value will be for me. I will get this bit working next time I need multiple resolution drawings. Some of the command line options can be found here .
The Central Statistics Office in Ireland has published this dataset: http://www.cso.ie/en/census/census2011griddataset/ And here is the user guide: http://www.cso.ie/en/media/csoie/census/documents/census2011griddataset/1,Km%C2%B2,Grid,dataset,User,Guide,2011.pdf It gives the population of each 1km square of Ireland on census night 2011. It has various buckets, but I have just looked at total population. I used the 3dscatterplot package in R which is very easy to use. Here is my code: cen<-read.csv("COP2011_Grid_ITM_IE_1Km.csv") install.packages('scatterplot3d') library(scatterplot3d) scatterplot3d(cen$CENT_EAST, cen$CENT_NORTH, cen$TOT_P) and here is the resulting plot You can see the big cities jumping up there. It needs a lot of polish to avoid things like Cork getting swamped in the 3d projection, but that's it for now.
Comments
Post a Comment