Posts

linq to sql - How to modify linqtosql entityref objects in handcoded MVC model? -

i trying set own mvc model rather letting environment create 1 via graphic designer tool. had hoped make easier keep separate repositories parts of model space far has caused me nothing grief. the first problem ran entityref classes had updated via selectlist control in view. managed work adding interal id field every entityref designer.cs do. however, has made model class quite bit more complex code below demonstrates. unfortunately, run problem when want explicitly update of entities in controller. if manually set id field, update dropped, if change entity exception while saving. my model [table(name = "dbo.jobs")] public class job { [column(isprimarykey = true, isdbgenerated = true, autosync = autosync.oninsert)] public int jobid { get; set; } internal string _companyid; // string legacy reasons [column(storage = "_companyid")] public string companyid{ { return _companyid} set { if ((_companyid != val...

android - Which user action causes a click event -

a click event on desktop generated, when user clicks mouse. dont use mouse smartphone. so far didnt find way generate click event on touchscreen. there hardware features, whith can "click"? first, can't ui click events when user on android phone clicks "desktop" (home screen). click events when user clicks in app. taken handling ui events tutorial: // create anonymous implementation of onclicklistener private onclicklistener mcorkylistener = new onclicklistener() { public void onclick(view v) { // when button clicked } }; protected void oncreate(bundle savedvalues) { ... // capture our button layout button button = (button)findviewbyid(r.id.corky); // register onclick listener implementation above button.setonclicklistener(mcorkylistener); ... }

algorithm - How to represent street address ranges for geo location lookups? -

i have following type of inputs: zone 1 => alabama street, 1 135, west side alabama street, 2 144, east side bahama square, 2 4 zone 2 => bahama square, 5 8 cecil street, 3 27 etc. these data represent zones within area. small disctrict in city, defined couple of enclosing streets. if i'm given geo location (latitude, longitude), how can map value zone in above context? it's obvious google maps lookup give me address, how proceed there? best way represent kind of data (address ranges) effective zone establishment? (whoa, 3 questions within 1) i'll take stab @ followup question. assuming streets 1 .. 6 in zone 1 major streets , zeta side street between these streets within address range. my solution form shapefile zone , check if lat/lng of address check within shapefile. here's approach detail: use reverse api lat/lng of each street endpoint (e.g., 1 w. alabama, 135 w. alabama, etc). use these endpoints create polygon shape (...

How to check if a field exists using iMacro -

i need check see if html field exists in website using imacro plugin firefox. if field not exist, need perform different opperation tag pos=1 type=a attr=txt:c tag pos= class yo want. type= find text in class attr= want class. (txt, href...) txt(or different): can use * find in class. İt marks object. or want search example: tag pos=1 type=b attr=txt:i<sp>am<sp>a<sp>text. this code means find first bold item in text:i text, , mark it.

linux - Using mknod on Ubuntu in c program -

i trying make c program using mknod command like #include<stdio.h> #include<fcntl.h> #include<string.h> char info[50]; main() { int fdr; int rc = mknod("testfile",'b',0); if(rc<0) { perror("error in mnod"); } fdr=open("testfile",o_rdonly); read(fdr,info,50); printf("\n received message=%s",info); printf("\n"); } and stuff. works on red hat system, fails on ubuntu giving error invalid argument. mknod deprecated; should not using it. if want create fifo, use standard mkfifo . if want create ordinary file, use creat or open o_creat . yes mknod can create device nodes, , on systems might still way it, on modern linux system rely on kernel and/or udevd handle this.

java - Sorting method not sorting correctly -

i'm calling arrays.sort(schedule, c); c instance of comparator so: import java.util.comparator; public class firstocccomparator implements comparator<abstractevent> { public int compare(abstractevent event1, abstractevent event2) { int result = 0; if (event1 == null || event2 == null) { //system.out.println("null"); } else if (event1.hasmoreoccurrences() && event2.hasmoreoccurrences()) { result = event1.nextoccurrence().compareto(event2.nextoccurrence()); } return result; } } the output i'm getting isn't it's supposed be. i'm wondering if can point me in right direction here. first sorting algorithm i've ever made , using concepts still new me (comparators , implementation), sorry multiple questions regarding code :) edit difference between outputs: http://pastebin.com/lwy1jqkt there 2 kinds of events, these hasmor...

cocoa - How can I use OS X's Accessibility API to write acceptance tests for my applications? -

i'm writing gui application in cocoa. i'd use cucumber write acceptance tests continually verify application's features work. i'm writing application in macruby. can use accessibility api click things , drag things around? can read how such things? i've found apple's site relatively mum on topic. i'd suggest checking out frank . uses accessibility approach , has worked great me far!