Posts

Showing posts from February, 2011

c# - MetadataException in Release Build -

my program uses ef access data sql ce database. when debug application using debug setup works fine if use release setup metadataexception when program tries access database through ef. i've checked far: debug , release configuration identical (same target platform) the app.config copied same directory executable (\release) the sdf database file copied \release\ metadata artifact processing set embed in output assembly connection string name identical in app.config , ef model my app.config: <?xml version="1.0"?> <configuration> <connectionstrings> <add name="geodataentities" connectionstring="metadata=res://*/model.ef.model.csdl|res://*/model.ef.model.ssdl|res://*/model.ef.model.msl;provider=system.data.sqlserverce.3.5;provider connection string=&quot;data source=|datadirectory|\geodata.sdf&quot;" providername="system.data.entityclient" /> </connectionstrings> <s

Cannot make Rhino Mocks return the correct type -

i started new job , 1 of first things i've been asked build unit tests code base (the company work committed automated testing integration tests , build takes forever complete). so started nicely, started break dependencies here , there , started writing isolated unit tests i'm having issue rhino mocks not being able handle following situation: //authenticationsessionmanager injected through constructor. var authsession = authenticationsessionmanager.getsession(new guid(authentication.sessionid)); ((iexpirablesessioncontext)authsession).invalidateenabled = false; the type getsession method returns sessioncontext , can see gets casted iexpirablesessioncontext interface. there expirablesessioncontext object inherits sessioncontext , implements iexpirablesessioncontext interface. the way session object stored , retrieved shown in following snippet: private readonly dictionary<guid, sessioncontext<tcontent>> sessions= new dictionary<guid, sessionco

regex - Combined Text Files With a Delimiter to One line -

i'm looking combined multiple text files delimiter , file name erase of new lines , have on 1 line. so far can 2 different scripts: find -type f -name '*.txt' -print | while read filename; echo "±±±±± $filename"; cat "$filename"; done > files.txt; and tr '\n' ' ' < files.txt > desiredoutput.txt i've tried combining these 2 no avail. suggestions? the simplest way combine them tr on each $filename in place of cat : find -type f -name '*.txt' -print | while read filename echo -n "±±±±± $filename " # -n suppresses \n @ end of line. tr '\n' ' ' < "$filename" echo -n ' ' # add terminating delimiter done > desiredoutput.txt;

ruby on rails - Sum/ subtract dynamic element by id using jQuery -

i have order form user can add or remove tickets dynamically using ajax ( similar railscast #197 it's nested form). each ticket displays ticket price (a ruby instance variable - @event.ticket_price) class of 'price'. i found snippet elsewhere adapted sum elements class 'price' , display result in div id 'total_price' $('#total_price').html(function() { var = 0; $(".price").each(function() { += parseint($(this).html()); }); return a; }); this generates total price when add ticket link clicked when page loads shows nothing (it should have price of 1 ticket there default). when ticket removed need function subtract price of ticket total. lastly prefer price in dollars nan when this, guess need regex of kind? new rails, newer jquery, appreciate this, thanks! the remove ticket function function remove_fields(link) { $(link).prev("input[type=hidden]").val("1"); $(link).closest(".fields"

api - AmazonEC2- Can an EC2 account be created programmatically? -

hello stackoverflow community, i've searched through amazon ec2's api documentation, haven't seen api create/modify/remove amazon ec2 account programmatically. know if possible? thanks, mauricio if talking creating new amazon's user ec2, not possible programmatically. in website registration requires human interaction. particularly need provide credit card etc. not able find way create new set of credentials programmatically.

android - How to move focus smothly between different icons in GridView -

there highlight focus if focus 1 icon or 1 image in gridview. topically, highlight color orange in emulator 2.3, green in honeycomb, , blue in googletv. doesn't matter. can use gridview.setselector(frame) gridview.setdrawselectorontop(true) to change it. highlight focus static. if debug on googletv, find googletv's highlight background move smoothly when move 1 icon another.i search viewswitcher, find defined changing different screen, or different view. viewflipper different activities. know how animate slide in , out between different icons or images? i search lot, still can't idea how it. can me. the way done having separate view in app selector. there stub drawable class used selector of gridview. stub class has reference other view, , when bounds set, animates view bounds of stub using viewanimator classes.

Java radio buttons -

i'm having trouble radio buttons. can click on 3 @ same time. should when click on 1 other 1 turns off? i'm using grid layout. when try group.add doesn't work. example: i have buttons declared this jradiobutton 7 = new jradiobutton("7 years @ 5.35%", false); jradiobutton fifteen = new jradiobutton("15 years @ 5.5%", false); jradiobutton thirty = new jradiobutton("30 years @ 5.75%", false); buttongroup group = new buttongroup(); grid.add(seven); grid.add(fifteen); grid.add(thirty); this code: /*change request #6 write program in java (with graphical user interface) allow user select way want calculate mortgage: input of amount of mortgage, term of mortgage, , interest rate of mortgage payment or input of amount of mortgage , select menu of mortgage loans: - 7 year @ 5.35% - 15 year @ 5.5 % - 30 year @ 5.75% in either case, display mortgage payment amount , then, list loan balance , interest paid

ruby - Rails nested resource with respond_with destroy action -

what appropriate respond_with line nested resources destroy action? my routes: resources :vendors resources :products, :except => [:index] end product#destroy (note @vendor , @product found before_filter omitted here) def destroy @product.destroy respond_with @vendor, @product end according functional tests, returning /vendors/x/products/x , not /vendors/x should change responed_to @vendor ? i believe rails smart enough understand if @product destroyed respond_with [@vendor, @product] if not, try this respond_with @product, :location => vendor_path(@vendor)

android ksoap2 - "<" and ">" become "&gt;" and "&lt;" in requestdump ,How to avoid this situation when I want to transfer the xml format parameters -

"<" , ">" become ">" , "<" in requestdump ,how avoid situation when want transfer xml format parameters? requestdump: <aaa i:type="d:string"> &lt;detect&gt;&lt;target tar="bbb" points="5"&gt;&lt;point x="306" y="63"/&gt;&lt;point x="399" y="63"/&gt;&lt;point x="399" y="261"/&gt;&lt;point x="306" `y="261"/&gt;&lt;point x="306" y="63"/&gt;&lt;/target&gt;&lt;/detect&gt; y="261"/&gt;&lt;point x="306" y="63"/&gt;&lt;/target&gt;&lt;/detect&gt; the format of server-side requirements: <aaa> <detect><target tar="bbb"><point x="111" y="222"/><point x="333" y="444" /><point x="555

java - Sending a variable to the Mapper Class -

i trying input user , pass mapper class have created whenever value initialises 0 instead of using actual value user input. how can make sure whenever variable maintain same value. have noticed job1.setmapperclass(parallel_for.class); creates instance of class hence forcing variable reinitialize original value. below link 2 classes. trying value of times runnertool class. link java testfor class link runnertool class // setup method in mapper @override public void setup(context context) { int defaultvalue = 1; times = context.getconfiguration().getint("parallel_for_iteration", defaultvalue ); log.info(context.getconfiguration().get("parallel_for_iteration") + " name commandline"); log.info(times + " number of iteration commandline"); } // runnertools class conf.setint(iteration, times); you should note mapper class recreated on many cluster nodes initalization done instance of mapper class when running j

validation - How can I prevent Concrete5 from injecting <style> and <link> tags in the HTML body instead of head? -

it causes theme not validate. , it's plain wrong. so why it? , how can fix it? concrete5 doesn't markup, instead it's due markup block you've added page (of course of blocks default ones came pre-installed system, of arbitrary distinction suppose). as frz mentions, if can block(s) offending markup coming specific advice can given how address (and more responses on @ concrete5 forums here on so). all being said, 1 of great features of concrete5 ability customize templates of each individual block, it's these can addressed without having hack core system or drastic that. know they're working on cleaning markup pre-installed blocks next version released in month or two. edit: future viewers of question, problem turned out <?php loader::element('header_required'); ?> line placed after closing </head> tag in op's theme template (that line of code responsible outputting system css , js files, needs placed inside theme's

javascript - Jquery change href attribute only works when I add an alert() function -

i using jquery load sidebar each of pages, sidebar contains list of story names, date, , content type (story, article, news, whatever) placed in unordered list, when each page loads use jquery's .load() function load sidebar information current page's unordered list, once sidebar information has loaded use script sets href of current story in sidebar #. problem piece of code sets href # works if put alert right before function. here flow: user clicks on story (lets call story nothing.html) nothing.html <!doctype html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="../../../../css/reset.css"> <link rel="stylesheet" href="../../../../css/index.css"> <script type="text/javascript" src="../../../../js/jquery.js"></script> <script type="text/javascript" src="../../../../js/storyloadsidebar.js"

How to add a cookie to save style selected by user Jquery -

i have styleswitcher added site , add cookie saves last style selected user. have code, guide me in process? thanks reading! i have code switch styles on site: html call main style , main color <style type="text/css"> @import url("style.css");</style> <link href="yellow.css" rel="stylesheet" type="text/css" title="yellow theme" /> then call scripts usual <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript" src="script.js"></script> each button has this: <a class="colorbox colorred" href="?theme=red" title="red theme"><img src="red.png" width="x" height="x" /></a> <a class="colorbox colorblack" href="?theme=black" title="black theme"><im

jsf - Enabling and disabling components via select checkbox -

i have component , i'm trying disable panelgrid below. <h:selectbooleancheckbox id="checkboxid" value="#{bean.checked}"> <p:ajax update="panelid" event="click"/> </h:selectbooleancheckbox> <h:panelgrid id="panelid" rendered="#{!bean.checked}"> <h:outputlabel>some text</h:outputlabel> <h:outputlabel>#registrationbb.registrationmodel.homeaddress.actualaddressmathwithregistration}</h:outputlabel> </h:panelgrid> as result clicking on checkbox doesn't take no effect. check indicator doesn't appear on checkbox component , value bean:checked doesn't sent server. tried use also. check indicator appeared panel not refreshed how use update via checkbox right? the example below got work: <h:form> <h:selectbooleancheckbox id="checkboxid" value="#{indexbean.checked}" &g

xcode4 - How do I specify an installation location for Xcode 4.1 from the Mac App Store? -

i installed lion, , downloaded xcode 4.1 mac app store. having xcodes installed in /developer directories have xcode versions appended (e.g. /developer-xcode3.2.6 ). downloading xcode 4.1 mac app store gives me installer app, not allow me specify installation location, xcode installers did in past. when ran installer, asked me move old xcode 3 installs out of /developer , renaming /developer directory sufficient? break stuff? locate 'xcode install' package. show package contents. inside resources folder find xcode.mpkg. install usual.

asp.net mvc 3 - MVC ActionMethod Controller events? -

is there event fired prior action method being called in controller? have common 'page control' specific variables passed client server in acton methods , benefit hanlder allow me retrieve these values , map them own data structures before action method executed. kind of viewstate mechanism. j. is there event fired prior action method being called in controller? you override onactionexecuting method. more reusable solution write custom action filter , decorate controllers/actions or declare global action filter applies controllers , actions in application.

c# - Castle.Windsor: passing a dependency through 2 typed factories -

types: public interface iwidgetfactoryfactory { iwidgetfactory createfactory(); } public interface iwidgetfactory { foowidget createfoo(foo model); } public class foowidget(icontextualservice service, foo model) { } registration: component.for<iwidgetfactoryfactory>() .asfactory(), // customfactorycomponentselector unnecessary discussion, know // it's there component.for<iwidgetfactory>() .asfactory(c => c.selectedwith<customfactorycomponentselector>()), question: what want able add method iwidgetfactoryfactory take icontextualservice : iwidgetfactory createfactory(icontextualservice service); and create factory proxy such when call iwidgetfactory.createfoo resolves icontextualservice dependency parameter passed via new createfactory method. note creating , calling multiple iwidgetfactoryfactory.createfactory(icontextualservice) in different contexts, , want each icontextualservice reflect context called in , pas

Import csv into a gridview using asp.net -

in asp.net app there 2 options import csv file gridview. one streamreader this: string rowvalue; string[] cellvalue; system.io.streamreader streamreader = new streamreader(txtpath.text); // reading header rowvalue = streamreader.readline(); cellvalue = rowvalue.split(','); (int = 0; <= cellvalue.count() - 1; i++) { datagridviewtextboxcolumn column = new datagridviewtextboxcolumn(); column.name = cellvalue[i]; column.headertext = cellvalue[i]; datagridview1.columns.add(column); } // reading content while (streamreader.peek() != -1) { rowvalue = streamreader.readline(); cellvalue = rowvalue.split(','); datagridview1.rows.add(cellvalue); } streamreader.close(); the other using oledb: string cmdstring = string.format("select * {0}", system.io.path.getfilename(target + "\\" + fileupload1.filename)); oledbdataadapter dataadapter = new oledbdataadapter(cmdstring, connstring); dataset d

php - if statement producing incorrect result -

i trying see why if statement not producing correct message. supposed happen, if user selects row not marked in db 'in' first message displayed. if forget select address or service level, else if sould triggered. if cases correct, perform else statement. however, happening, first message being triggered when selected first time , fires error. if user forgets select address or service error fired. if user meets conditions, instead of performing else statement, displays $boxstatus error, though conditions true. can please point out error? many thanks header("expires: mon, 26 jul 1997 05:00:00 gmt" ); header("last-modified: " . gmdate( "d, d m y h:i:s" ) . "gmt" ); header("cache-control: no-cache, must-revalidate" ); header("pragma: no-cache" ); header("content-type: application/json"); $json = ""; if ($boxstatus!="in") { $json .= "{\"error\": \"error: box must in

java - Error Android Virtual Device with eclipse -

i want crate new android virtual device eclipse had error, [2011-07-21 15:12:22 - emulator] invalid command-line parameter: and. [2011-07-21 15:12:22 - emulator] hint: use '@foo' launch virtual device named 'foo'. [2011-07-21 15:12:22 - emulator] please use -help more information can 1 me? i had 1 , me problem 'r12', doesn't accept spaces in install directory (of android sdk). instead of uninstall/reinstall, changed in eclipse c:/program files/... c:/program~/... , worked. i didn't invent it, found here : starting android emulator in sdk tools, revision 12

mobile - Time division multiplexing -

i have doubt regarding time division multipluxing. in gsm using time division multiplexing. in time division multiplxing, there timeslots foreach signel. while using gsm mobiles, getting continues flow of data, not transmitting continuesly rite?? how continues signal if transmission done using tdm. the simple answer you're not receiving continuous flow of data. receiving short bursts of data close enough seem form continuous stream. in case care, specific numbers gsm starts 4.615 ms frames, each of divided 8 timeslots of .577 ms. so, particular mobile handset receives data .577 ms, waits ~4 ms, receives data .577 ms, , on. there's delay of 3 time slots between receiving , transmitting, receives data, ~1.8 ms later, gets transmit .577 ms. the timing close enough if (for example) signal gets weak and/or there's interference few ms, , particular hand-set misses receiving data 1 time slot won't audible. when signal lost 20 ms, people can start perceive a

problem with closing python pypdf - writing. getting a valueError: I/O operation on closed file -

can't figure function (part of class scraping internet site pdf) supposed merge pdf file generated web pages using pypdf. this method code: def mergepdf(self,mainname,inputlist=0): """merging pdf pages getting inputlist merge or defaults class instance self.pdftomerge list""" pypdf import pdffilewriter, pdffilereader self._mergelist = inputlist or self.pdftomerge self.pdfoutput = pdffilewriter() name in self._mergelist: print "merging %s main pdf file: %s" % (name,mainname) self._filestream = file(name,"rb") self.pdfinput = pdffilereader(self._filestream) p in self.pdfinput.pages: self.pdfoutput.addpage(p) self._filestream.close() self._pdfstream = file(mainname,"wb") self._pdfstream.open() self.pdfoutput.write(self._pdfstream) self._pdfstream.close() i keep getting error: file "c:\tmp\easy_install-iik9vj\pypdf

GWT: Delete Content of RootPanel(id) -

i'm trying delete whole content of rootpanel element based on id. rootpanel returns correct , can see it's content in debugger. problem is, delete tried following things: rootpanel rp = rootpanel.get("layoutid2"); if (rp != null) { (widget widget : rp) { rp.remove(widget); } } any idea i'm missing, or there function? best regards, stefan all of contents of rootpanel might not widgets. example if placed following html in host page: <div id="layoutid2"> here goes dynamic content </div> the text "here goes dynamic content" not appear widget. by way, removal of widgets can achieved calling rp.clear() .

postgresql - PHP search function to look in pgsql table -

i want make search function in website. want search string in fields of table (about 13 columns). if 1 row contains field matches string (like operator) want added result. example |field 1 | field 2 | field 3| string test test string 1 simple string now if search string "test" want have first 2 rows. is there wildcard option : select * my.table * '%string%'; there no such syntax in postgresql (or other dbms). as spudley pointed out using query like '%string%' quite slow. if needed should postgresql's full text search capabilities.

javascript - next(), closest() and find() -

i have following html markup, <section> <img width="106" height="113" title="key-staff-tim" alt="key-staff-tim" class="attachment-post-thumbnail wp-post-image" src="http://wp-content/uploads/2011/07/key-staff-tim.jpg"> <article class="biography visible" style="display: block;"> <h3>director</h3> <p>aliquam sagittis purus vitae turpis elementum sed congue lectus tempor. integer eleifend vestibulum tristique. pellentesque ut risus leo. duis tempus sollicitudin viverra. pellentesque laoreet, justo ut dictum mattis, tellus odio dapibus lacus, convallis lobortis massa dolor nec quam.</p> <p>aliquam sagittis purus vitae turpis elementum sed congue lectus tempor. integer eleifend vestibulum tristique. pellentesque ut risus leo. duis tempus sollicitudin viverra. pellentesque laoreet, justo ut dictum mattis, tellus od

winapi - WM_COMMAND WM_NOTIFY custom notification code -

i wish define new nofication id used in wm_command messages of subclassed control. failed find rules of creating user control-defined notification codes. see technical note 20, 21 , 22 on that: tn020: id naming , numbering conventions tn021: command , message routing tn022: standard commands implementation short answer: pick number in range 0x8000 - 0xdfff .

jsf - Using resources of composite components from an external JAR -

i using composite components in external jar-archive. in jar-archive have resources images , css-files. example, 1 of components uses button image inside. when try use component in project, resource image not found. how solve problem? try resourcehandler api. check this article .

jquery - Fade out and slide up at the same time? -

i have following script works well: $(that).parents(".portlet").fadeout('slow', function() { $(that).parents(".portlet").remove(); }); it fades out element, removes totally screen. i want improve effect sliding while fading out. how that? just clarify, don't want fade out slide up, or slide fade out, fade out, , @ same time while fading out, slide up. $(that) .parents(".portlet") .animate({height: 0, opacity: 0}, 'slow', function() { $(this).remove(); });

php - Twitter API - get users which are common in my following and followers list -

i developing twitter api i using rest api using ruby oath gem i need users common in following , followers list. what api can use? thanks sreeraj quite easy! perform !diff between 2 lists. in other words, both lists, , iterate on each entry/person, remove differences, , viola!

javascript - Updating onclick function within another function not using unbind/removeAttr -

read final edit solution i'm try update onclick function of link using jquery. example best explain: html <a href='' id='one_click' onclick='do_things_here("fighter","bitter",2)'>first clicker</a> <a href='' id='two_click' onclick='do_things_here("abc","xyz",1)'>second clicker</a> js (something - don't correct logically speaking) function do_thing_here(data, info, source){ *//things happen here* $('#two_click').click(function() { do_things_here(data,info,source) return false; }); } that doesn't work goes recursive loop do_things_here gets set off when resetting onclick on 'two_click'. edit i've tried set reset flag prevent do_things_here running on re-setting onclick function do_thing_here(data, info, source,reset){ if (reset){ return false; } *//things happen here*

algorithm - Please discussing my Java code to find Factors(It's Correct?) -

do have solution solve factor problem? a few comments. firstly, @opensource pointed out, code not work correctly. should simplify approach forgetting primes @ top level. primes not need treated separately. some comments on specific lines of code: arraylist<integer> list = new arraylist<integer>(); at point know there 2 factors, 1 , n. why not add them list? if(i > n/2) break; //optimize why recalculate n/2 if n hasn't changed since last time? if(n % == 0) list.add(new integer(i)); if i factor (n / i) factor. every time n % == 0 have found 2 factors. }else if(n%3 == 0 && n%2 != 0 && n != 3 && n != 1){ //odd number this doesn't work , takes far effort it. have looked @ numbers, left must odd. }else{ //prime no, left isn't prime. , there 1 prime number well. for(int a:list){ system.out.println(a); } you might want sort list first, before printing.

c# - Inverting color depending on the background windows and desktop -

i have transparent wpf window ( windowstyle="none" ) black label. need make label change color dynamically, depending on background of content below window (other windows, desktop), visible , contrast. how can implemented? need make screenshot , read color values there or there way wpf tools? will more difficult if label has gradient? i don't suppose it's option make text of label have contrasting outline around letters? you can sort of drop shadow type effect uses contrasting color make (for example), black text have white border. <page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <grid background="black"> <textblock text="this text" fontsize="24" margin="30" foreground="black" fontweight="bold"> <textblock.effect> <dropshadoweffect shado

validation - How to match a value to a string within "rules" using jquery validate.js (bassistance.de) -

i want check if form radio input value matches string exactly, "equalto" match string , not field input can't find if there simple way similar using "equalto". as below want form field "foo" value match "bar" , hoping replace ????????s simple command if possible? if not appreciate showing how can implement string match within "rules" method. $("#this_form").validate({ rules:{ name:{ required:true }, foo:{ ????????: "bar", required:true } } }); so here want form validate if value of foo "bar" , not if value "manchu". < input type="radio" name="foo" value="bar" /> < input type="radio" name="foo" value="manchu" /> (i think reason pretty obvious, answer foo needs bar otherwise not want form

sql - Oracle: How to find the timestamp of the last update (any table) within a schema? -

there oracle database schema (very small in data, still 10-15 tables). contains sort of configuration (routing tables). there application have poll schema time time. notifications not used. if no data in schema updated, application should use current in-memory version. if table had update, application should reload tables memory. what effective way check whole schema update since given key point (time or transaction id)? i imagined oracle keeps transaction id per schema. there should way query such id , keep compare @ next poll. i've found question, such pseudo-column exists on row level: how find out when oracle table updated last time i think similar exists on schema level. can please point me in right direction? i'm not aware of such functionality in oracle. see below. the best solution can come create trigger on each of tables updates one-row table or context current date/time. such triggers @ table-level (as opposed row-level), wouldn'

objective c - How to make the union between two MKCoordinateRegion -

i'm trying union between 2 mkcoordinateregion. have idea on how this? there mkmaprectunion function accepts 2 mkmaprects first convert each mkcoordinateregion mkmaprect , call function (and convert result mkcoordinateregion using mkcoordinateregionformaprect function). the conversion method might this: - (mkmaprect)maprectforcoordinateregion:(mkcoordinateregion)coordinateregion { cllocationcoordinate2d topleftcoordinate = cllocationcoordinate2dmake(coordinateregion.center.latitude + (coordinateregion.span.latitudedelta/2.0), coordinateregion.center.longitude - (coordinateregion.span.longitudedelta/2.0)); mkmappoint topleftmappoint = mkmappointforcoordinate(topleftcoordinate); cllocationcoordinate2d bottomrightcoordinate = cllocationcoordinate2dmake(coordinateregion.center.latitude - (coordinateregion.span.latitudedelta/2.0), coordinateregion.center.lon

php - Blank Page after pressing Submit button with all fields filled up -

as shown in title, have page users create projects , page add database. when press submit form fields empty, page post isn't blank. when submit fields filled up, shows blank page without errors , have looked through both pages of codes can't seem find wrong. perhaps here me out? thanks. //codes on page data submitted. if ($_post['projecttitle'] != "" && $_post['projectstatus'] != "" && $_post['projectdesc'] != "" && $_post['projectdeliv'] != "" && $_post['year'] != "" && $_post['month'] != "" && $_post['day'] != "" && $_post['projectss'] != "") { $host = "localhost"; $user = "root"; $pass = ""; $db = "fyp1"; $pt = $_post['projecttitle']; $ps = $_post['projectstatus'];

validate dropdown field in asp.net mvc 3 razor -

code is: @using (html.beginform("register", "user", formmethod.post, new { id = "registerform" })) { @html.dropdownlist("stateid", new selectlist(model.states, "stateid", "statename"), "--select option--", new { @tabindex = "11" }) } i need required field validation dropdown have tried using data annotations in model mark property required? [required(errormessage = "you must select state")] are exposing stateid part of model? if that's should set required attribute, so: [required(errormessage = "you must select state")] public int stateid { get; set; }

jsp - In JSF how to hide resultBean until doAction executed? -

i adding web service jsf page. page should take input , give output after submit button clicked. problem before button clicked there empty displayed on page. want know how hide if form empty. the following jsp code <h:form styleclass="form" id="form1"> <table> <tbody> <tr> <td align="left">number:</td> <td><h:inputtext styleclass="inputtext" id="trainnumber1" value="#{xxx_porttype_display.parambean.request.number}"> </h:inputtext></td> </tr> </tbody> </table> <hx:commandexbutton id="buttondoaction1" styleclass="commandexbutton" type="submit" value="submit" action="#{xxx_porttype_display.doaction}">

sql - Complete db schema transformation - how to test rewritten queries? -

our database poorly designed way around (we inherited it). i've reworked schema useable , maintainable. quite few tables , columns have been dropped, many columns have moved , tables , columns have been renamed. datatypes have been changed also. i've extracted queries our webapps , we've started rewriting them. our dba able migrate old data new schema, think. sure need test each query comparing old results new. how can test such wholesale migration? need able specify parameters, , map old tables/columns new tables/columns. hundreds of queries daunting task. write myself have lot of demands on time using existing tool preferable. thanks! i've had ... , easy because rewrote entire application ;) many queries sounds basic operations such select,insert,updates have not been abstracted in functions - maybe can clean mess before adapting. now testing: you need test script a) run queries b) store output of selects comparison backup test db @

iphone - iOS - sqlite3_column_origin_name -

did tried function (sqlite3_column_origin_name) on objective-c? exists in sqlite3.h error when try use it: undefined symbols architecture i386: "_sqlite3_column_origin_name", referenced from: +[sqlcommunication executeselect:] in sqlcommunication.o ld: symbol(s) not found architecture i386 collect2: ld returned 1 exit status thanks i use sqlite3_column_name(). find sqlite3_column_origin_name() not work in ios.

java - Application not deployed automatically on saving -

i using netbeans 6.7 , jonas 5 server integrated using plugin. problem whenever have redeploy application on server have stop server , have redeploy again means application not automatically deployed when save files though checkbox deploy on save in project -> properties -> run checked.

html - Embedly tutorial/example no longer working? -

i've been using modification of embedly's tutorial embed thumbnails of photos onto website. it's been working far, though hasn't been embedding photos , figured i'd maybe messed up, looks somehow service not working more. if put in exact code give on website , run it, not work more , not embed anything. am missing something? else able code working? edit page looks like: http://i.imgur.com/kswyd.gif edit working jsfiddle http://jsfiddle.net/enderx475/7axfd/ <!doctype> <html> <head> <title>page title</title> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://scripts.embed.ly/jquery.embedly.min.js"></script> <script type="text/javascript"> $('document').ready(function(){ $('div.content').embedly({ maxwidth: 450, wmode: 'transparent', method: 'after' }); }); </scri

Mercurial Repository Searching/Indexing -

does know of solution search mercurial repositories? (we using hgweb host our repositories.) able search past revisions of source code. e.g. find out when bug may have been introduced. fisheye looks fit bill nicely company unwilling pay it. there open source alternatives or solution allow search source history in hg? an ideal solution allow to: search comments search revisions of source code search multiple repositories thanks! as long willing have local clone of code searched, mercurial , tortoisehg have strong search options. mercurial alone hg grep allows search code patterns. searches revisions of code, not working copy. hg revsets provide functional language limit output of commands hg log interesting sets. example, may limit output based on revision ranges, keywords, , many other options. hg filesets similar revsets, operates on file selections instead. finally, hg bisect can find changeset introduced bug, assuming have scriptable test

Android - getLocation() -

i have developed application company track work done our agency people , location capture work places. don't want agency people browse other website, of network providers have restricted other websites , allowed 2 url run webservice store information captured database. since android talks google location need map maps.googleapis.com when tried it's not working. can tell me url should map/whitelist allow application access google. i think u coordinates regardless of internet connectivity. of course wrong. sure added permissions location services in manifest. know have tested gps apps without internet enabled (emulator though). of course map wont load coords should able read gps receiver.

clojure - Generating Java Classes -

i understand 1 can use gen-class generate java class, however, i'm confused how can generate java class with constructors. possible generate java class constructor, not extend or implement class? i generated following class constructor: (ns test.t1 (:import (java.util hashmap)) (:gen-class :main false :state state :init init :constructors {[java.util.hashmap] []})) (defn -init [^hashmap tmapref] [[] tmapref]) and able create instance of it: user> (test.t1. (java.util.hashmap.)) #<t1 test.t1@7d6ac92e>

java - What Collection to use when searching and sorting -

there many posts regarding searching collection on stackoverflow. there many posts regarding sorting collection here. looking solution (data structure) handles both. maps great searching (i.e. map.containskey(key), map.get(key)). arraylists great sorting (using simple comparator). program adds elements hashmap (checking dupes .containskey(key)). map values assigned arraylist. simple (one line of code), yet terribly inefficient. uses twice memory. the program calls unique elements, duplicate elements? have scanned javadocs , see there many collection types whatever flavor need (map, list, table, set, tree, vector, priorityqueue-whatever is). there 1 java collection handles searching , sorting, including duplicate elements? have considered treemap ? the map sorted according natural ordering of keys, or comparator provided @ map creation time, depending on constructor used.

java - TCP Client Accepting Objects -

i writing java program needs continuously accept serialized objects throughout run of application. objects sent server requested user. my main application initializes tcp client (extends thread) in run method, trying read objects line function. pseudocode follows: *tcp client extends thread *global vars: ip, port, socket, oi stream, oo stream, object reference *run() make connection *getobject() object reference = (object).readobject() return object my main application calls client.getobject() in update loop. there may or not object waiting. am going wrong way? are trying "classic" server behavior or non-blocking io? if it's former, i'd recommend blocking queue on server accept incoming requests , pool of threads process them. have server assign thread process request when comes in until thread pool exhausted; queue requests until threads freed , returned pool. non-blocking io matter entirely. @ how netty , node.j

ios - xcode4 parameter of incompatible type -

a project runs fine on xcode3, fails compile on xcode4 error: file://localhost/users/ishaq/projects/game01/libs/cocos2d/cclayer.m: error: semantic issue: sending 'cccolor4b' (aka 'struct _cccolor4b') parameter of incompatible type 'cicolor *' the code throws error below (from cocos2d-iphone cclayer.m ): + (id) layerwithcolor:(cccolor4b)color { return [[[self alloc] initwithcolor:color] autorelease]; } somehow xcode thinks code calling - (id)initwithcolor:(cicolor *)color; of ciimage (inside ciimage.h ). how can set xcode's brain straight? ;-) i've got same problem. resolution explicitly cast proper type helps compiler find proper class. code looks this: return [[(cccolorlayer*)[self alloc] initwithcolor:color] autorelease];

SharePoint session persist across several users? -

i have custom web part starts getting current user login name this: protected static string iam = system.web.httpcontext.current.request.servervariables["auth_user"].split("\\".tochararray())[1].tolower(). then passes string bbl class , fetches user id: `idatareader _drinfo = cisf_bll.bll_myinfo.drgetmyinfo(iam); while (_drinfo.read()) { iuser_ident = _drinfo.getint32(30); } `after passes user id integer method fetches user's training record: _drusertraining = bll_training.drget_required_training_records(iuser_ident); _drusertrainingcompleted = bll_training.drget_completed_training_records(iuser_ident); this information displayed in tab container 3 tab such "overdue", "required", , "completed". the problem i'm having this: i'm logged sharepoint collaboration site domain user name , training displayed fine. if else logs in sp portal user sees training , not his, though user has logged in uniqu

Element coordinates in pure Javascript -

say have element inside div (or other containing element, or perhaps in body of document). how (x,y) coordinates of element, relative container? and need able in pure javascript... use below document.getelementbyid("elementid").offsettop; document.getelementbyid("elementid").offsetleft;

javascript - FF+Firebug got an error "Regular Expression too complex", IE crashed and Chrome hung -

according http://www.utexas.edu/its/help/domain-name-hosting-and/847 made regular expression: /^[a-z](\w+\.?\w*[a-z0-9]){5,17}@[a-z]((a-z0-9\-]{1,25}\.[a-z]{2,4})|([a-z0-9\-]{1,25}\.[a-z]{2,3}\.[a-z]{2,3}))$/; and throw value: asdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbn@yahoo.com firefox + firebug says "regular expression complex", ie crashed , chrome hung, there wrong regexp? i use javascript. missing [ /^[a-z](\w+\.?\w*[a-z0-9]){5,17}@[a-z](( here [ a-z0-9\-]{1,25}\.[a-z]{2,4})|([a-z0-9\-]{1,25}\.[a-z]{2,3}\.[a-z]{2,3}))$/;

visual studio - Is there a way to suppress VS trying to go online? -

Image
if there's configured binding of solution tfs, when opening solution vs asks you: --------------------------- microsoft visual studio --------------------------- go online solution offline associated team foundation server available. go online solution after has loaded? --------------------------- yes no --------------------------- or alternatively if tfs not available proposed choice work temporarily offline or remove bindings @ all. is there way suppress these dialogs? to give context. part of our team working tfs directly , other part working via git-tfs. when working git-tfs - don't need online mode @ all. every time open solution or reload project in solution - should answer same things, on , on again. couldn't delete bindings people working tfs directly lose ability connect tfs seamlessly. does connections command in tfpt (it tweakui in 2008 tfpt) accomplish need? can mark server (actually collection in 2010) offline vs. buck

excel - How to convert a table to multiple columns -

i have tons of spreadsheets formatted first table (but lot more records , different number of records). need make take right information format second table importing access. can done? thanks. ..........part 1 part 2 part 3 part 4 test 1..5 test 2.............x.........5 test 3..2.........x..................x test 4.......................x.........x test 5..x..............................2 test 1 part 1 5 test 2 part 2 x test 2 part 3 5 test 3 part 1 2 test 3 part 2 x test 3 part 4 x test 4 part 3 x test 4 part 4 x test 5 part 1 x test 5 part 4 2 here's 1 way it. use each loops ranges. dim workingrange1 range, workingrange2 range set workingrange1 = sheets("sheet1").usedrange set workingrange2 = range("putstuffhere") = 0 workingrange1.rows.count - 2 j = 0 workingrange1.columns.count - 2 if not isempty(workingrange1.cells(i+1, j+1)) workingrange2.offset(0, 0) = workingrange1.

regex - C# \b not being found -

match m = regex.match(richtext, "\\\\par\b", regexoptions.none); richtext = regex.replace(richtext, "\\\\par\b", "", regexoptions.ignorecase); input: "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil arial;}{\\f1\\fnil\\fcharset0 microsoft sans serif;}}\\viewkind4\\uc1\\pard\\f0\\fs20 cc: not specified\\f1\\fs17\\par}" i'd find \\par only, , not \\pard can found in middle of input. mrab correct: [testclass] public class unittest1 { [testmethod] public void testwithdoublebackslash() { const string regex1 = "\\\\par\\b"; testregex(regex1); } [testmethod] public void testwithsinglebackslash() { const string regex2 = "\\\\par\b"; testregex(regex2); } private static void testregex(string regex) { var richtext = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\

iphone - Xcode 4.1 with more than 400 compiling errors -

probably stupid thing i'm quite new xcode... today i've updated os x lion , xcode 4.1 when try compile iphone app more 400 compiling errors appear, of them sqlite3.h, cllocation.h , other original libraries apple. errors seem originated problem #import ... yesterday working os x snow leopard xcode 4.0 , fine. i'm using gcc 4.2 compiler in xcode , haven't change configuration on xcode or app. here errors: http://img10.imageshack.us/img10/7585/screenshotyum.png help please! update: ok, solved problem. not related compiler version or base sdk, error xcode 4.1 doesn't accept #import "/usr/include/sqlite3.h" , has change #import <sqlite3.h> more info here (only apple developers) hope other people. this caused me serious headaches posting! clarify, after updating lion , xcode 4.1 had 400 errors because of: #import "/usr/include/sqlite3.h" changing #import <sqlite3.h> solved it! took me ages figure out!!!