Posts

Showing posts from April, 2014

c# - Adding Textbox and MessageBox to a class library -

c# - Adding Textbox and MessageBox to a class library - i'm trying create dll existing project. existing project application calculates involvement rates , windows form. the code i've been given create dll includes references textbox , messagebox. here's sample method in code: public static bool ispresent(textbox textbox) { if (textbox.text == "") { messagebox.show(textbox.tag + " required field.", title); textbox.focus(); homecoming false; } homecoming true; } i've never created class library/dll before, followed the instructions here. when build solution (for class library), error: error 1 type or namespace name 'textbox' not found (are missing using directive or assembly reference?) j:\loanapplication\validatorsolution\validatorsolution\class1.cs 24 38 validatorsolution and it; understand error saying. problem don't know how around it. any advice? you...

Overriding the default session manager with embedded tomcat 7 java -

Overriding the default session manager with embedded tomcat 7 java - i trying override tomcat session manager embedded tomcat. these steps preformed in-order load context.xml defines manager entity. .. context context = tomcat.addwebapp(contextpath, appbase); file configfile = new file ("d:\\context.xml"); context.setconfigfile(configfile.touri().tourl()); tomcat.start(); .. the session manager seems recognized it's constructor beingness invoked startinternal() method never invoked , session manager beingness used old tomcat session manager. the weird thing when defining same configuration in non embedded tomcat, session manager beingness overridden without problems. would appriciate help on subject. non embedded tomcat uses server.xml , embedded tomcat not uses server.xml file rather need pass arguments in method. session tomcat

date - MYSQL select the monday of two weeks ago -

date - MYSQL select the monday of two weeks ago - how select not lastly monday, mon before, utilize in statement so: where date(ramses.batch_log.start_time) < date_sub(now(), interval 2 week) so, 2 weeks ago, not today(wednesday), monday. edit cleaner , right one: where date(ramses.batch_log.start_time) < subdate(subdate(now(), interval weekday(now()) day), interval 2 week); mysql date time

iphone - Hide UITableViewStyleGrouped separator at certain sections -

iphone - Hide UITableViewStyleGrouped separator at certain sections - i have grouped uitableview , have 1 cell @ section 0. want hide separator @ first section. if utilize tableview.separator = [uicolor clearcolor] , hides separators. ideas? while original comment way (roll own subclass separator), ios7 has given new pretty easy way too. with add-on of separatorinsets on tables in ios7, uitableviewcell has separatorinset property. giving big value larger size of table (such uiedgeinsetsmake(0, 320, 0, 0) ), can hide separator moving off screen. the caveat default, built-in views of uitableviewcell rely on separator inset horizontal alignment of content (so content off screen , invisible). way prepare build own subviews instead, or set x origin of default ones using in layoutsubviews method of uitableviewcell subclass. iphone objective-c uitableview

linux - How to parse out the end of a path in a unix shell script? -

linux - How to parse out the end of a path in a unix shell script? - i have .sh unix shell script receives parameter path, /home/test/user1 . so, in variable ${1} , parameter. i want create file name based on lastly part of path, user1. how can parse path retrieve lastly piece of path? i think looking basename command. $ basename /home/test/user1 user1 edit: (in response comment) in shell-script variable, need backticks: end_of_path=`basename "${1}"` linux unix shell

add External javascript file - Syntax issue -

add External javascript file - Syntax issue - when utilize next syntax, inline script not executed. in firebug not able debug code. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js" type="text/javascript" /> <script> $(document).ready(function () { $('#btn').bind('click', function () { alert('hai'); }); }); </script> but if alter external file add together script, works fine. no issues @ all. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js" type="text/javascript" > </script> you must close <script> tag. w3.org: start tag: required, end tag: required javascript

exception - SOAP request exceptionjava.lang.ClassCastException -

exception - SOAP request exceptionjava.lang.ClassCastException - i using ejb3 , hibernate running on jboss4.2.2.ga jdk1.5 i have several soap web services , when deploy ear server, 1 time deployment done , comes request web services next exception. btw can't figure out why when test on local server there not error messages, wierd.. any help appreciated, in advance guys. error [org.jboss.ws.core.jaxws.soapfaulthelperjaxws] soap request exception java.lang.classcastexception: com.sun.xml.messaging.saaj.soap.ver1_1.envelope1_1impl [org.jboss.wsf.stack.jbws.requesthandlerimpl] error processing web service request org.jboss.ws.wsexception: java.lang.classcastexception: com.sun.xml.messaging.saaj.soap.ver1_1.message1_1impl [org.apache.catalina.core.containerbase.[jboss.web].[localhost].[/myproject].[catalogservice]] servlet.service() servlet catalogservice threw exception java.lang.classcastexception: com.sun.xml.messaging.saaj.soap.ver1_1.message1_1impl the pr...

jquery obj.find problem in javascript -

jquery obj.find problem in javascript - i have snippet of code, fails @ var link: var obj = $(this[0]); var html = obj.html(); var link = html.find('a[href*=/comment/reply]'); this ajax response submitted form. output of var html follows: ===><div class="comment-new-success"><a id="new"></a> <a id="comment-482"></a> <div class="comment"> <div class="submitted">submitted <a href="/user/1" title="view user profile.">name</a> on sun, 07/10/2011 - 12:48.<span class="new"> *new</span></div> <div class="content clearfix"><p>123123123123122</p> </div> <div class="links_box"><ul class="links"><li class="comment_delete first"><a href="/comment/delete/482?token=e1fba5ef1c99c5a3760313b53f582972">delete</a></li...

mysql - SQL - Select distinct rows and join them with another table to get data -

mysql - SQL - Select distinct rows and join them with another table to get data - i have 2 tables: 1) person (person_id, person_name) 2) cars (car_id, person_id) i want people's names have cars no duplicates. this have come with: select person.person_name, cars.person_id cars inner bring together person on person.person_id=cars.person_id but don't want duplicates, need incorporate using this: select distinct person_id cars select person_name person person_id in ( select person_id cars ) mysql sql

java - How to catch a CTRL + mouseWheel event with InputMap -

java - How to catch a CTRL + mouseWheel event with InputMap - i've implemented hotkeys swing application inputmap like getinputmap(jcomponent.when_in_focused_window).put(keystroke.getkeystroke(keyevent.vk_a, event.ctrl_mask), "selectall"); getactionmap().put("selectall", new selectallaction()); it's working fine. now, how can same thing if want grab the ctrl + mousewheelup i've tried combinations such as getinputmap(jcomponent.when_in_focused_window).put(keystroke.getkeystroke(mouseevent.mouse_wheel, event.ctrl_mask), "zoom"); with no luck thanks you can't utilize inputmap/actionmap this. need utilize mousewheellistener. listener can access custom action actionmap. here simple illustration uses "control 1" keystroke: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class mousewheeltest extends jpanel implements mousewheellistener { private final static strin...

mysql - Combining two GROUP BY queries grouped by the same column -

mysql - Combining two GROUP BY queries grouped by the same column - i have transaction table, , tag table. want sum of transactions in transaction table grouped tag. there 2 different types of transaction: "budget" , "actual" this query homecoming me want "budget" transactions: select tg.name tag, sum(amount) budgettotal transaction tx bring together transaction_tag tt on tt.transaction_id = tx.id bring together tag tg on tg.id = tt.tag_id tx.type = "budget" , tx.date >= '2011-07-15' , tx.date < '2011-08-15' grouping tg.name and of course of study pretty much same query "actual" transactions: select tg.name tag, sum(amount) actualtotal transaction tx bring together transaction_tag tt on tt.transaction_id = tx.id bring together tag tg on tg.id = tt.tag_id tx.type = "actual" , tx.date >= '2011-07-15' , tx.date < ...

c# - Why does WebRequest timeout always on the first request, but never on any subsequent ones -

c# - Why does WebRequest timeout always on the first request, but never on any subsequent ones - having issue, calling webrequest.getresponse() hangs , times out on first call, after first call, works fine. seek { webrequest myhttpwebrequest = webrequest.create(@"http://192.168.x.x/"); // sends httpwebrequest , waits response. myhttpwebrequest.timeout = 1000; webresponse myhttpwebresponse = myhttpwebrequest.getresponse(); } catch(exception e) { console.writeline("failure 1"); } seek { webrequest myhttpwebrequest = webrequest.create(@"http://192.168.x.x/"); // sends httpwebrequest , waits response. myhttpwebrequest.timeout = 1000; webresponse myhttpwebresponse = myhttpwebrequest.getresponse(); } catch(exception e) { console.writeline("failure 2"); } ...

java - Large list returned from a SimpleJdbcTemplate query -

java - Large list returned from a SimpleJdbcTemplate query - here problem : @ point in java program, (very) big list of events database using simplejdbctemplate class spring. list<event> events = this.simplejdbctemplate.query(myquery, mymapper(), new object[] { filter.getfirst(), filter.getsecond(), filter.getthird()} ); the problem list may contain 600,000 events ... hence using lot of memory (and taking time processed). however don't need retrieve events @ once. able iterate on list, read few events (linked specific key_id - sql query myquery ordered key_id), process them , iterating, letting garbage collector rid of previous , processed events never exceed amount of memory. is there nice way using spring library (or library)? cheers, vakimshaar. if understand correctly, iterate on result set, not interested in building total list of result...

ruby on rails 3 - send devise registration mails using reque background job -

ruby on rails 3 - send devise registration mails using reque background job - i using rails 3 devise authentication , resque handling background job there way send devise registration mails using resque ? https://github.com/defunkt/resque https://github.com/plataformatec/devise use next gem, send mails devise through resque queue https://github.com/zapnap/resque_mailer ruby-on-rails-3 devise resque

ASP.Net MVC and 14 Rules of Performance -

ASP.Net MVC and 14 Rules of Performance - is there similar asp.net mvc this plugin grails implements of 14 rules great performing websites? though not work you, these tools point out problems have: can utilize in browser, (ff example) yslow add-on , google´s page speed. there a great post in encosia combining , minifying js files in vs. asp.net-mvc performance

ios - kABPersonEmailProperty returns weird stuff -

ios - kABPersonEmailProperty returns weird stuff - i tring email address of abrecordref this: abrecordref ref = cfarraygetvalueatindex( allpeople, ); nsstring *email = [(nsstring*) abrecordcopyvalue( ref, kabpersonemailproperty ) autorelease]; nslog(@"%@", email); it returning this: _$!<home>!$_ (0x6840af0) - test@test.com (0x6840cc0) what's stuff around email? , how can rid of it?thanks. kabpersonemailproperty of type kabmultistringpropertytype . there no single email address property, person might have email address work, 1 home, etc. can array of email addresses using abmultivaluecopyarrayofallvalues : abmultivalueref emailmultivalue = abrecordcopyvalue(ref, kabpersonemailproperty); nsarray *emailaddresses = [(nsarray *)abmultivaluecopyarrayofallvalues(emailmultivalue) autorelease]; cfrelease(emailmultivalue); to labels of email addresses, utilize abmultivaluecopylabelatindex . " _$!<home>!$ " special constant that...

html - Javascript window object -

html - Javascript window object - in javascript, let's have main page ( main.html ) contains <iframe> ( iframe.html ) now within iframe.html , if need refer on main page ( main.html ) , can not specify window instead of parent.window if reply need write parent.window , wanted understand there not single window object reference iframes within main page.. while understand document specific individual iframes, window should mutual all..isn't it...please help me in understanding concept... also there window.parent ? if yes, how differ parent.window ? the concept of window tied document : there's 1 window per document , , 1 document per window . that means <iframe> elements, have own document , have own window , pop-up window or main navigator window. so, you'll indeed have utilize window.parent access container of <iframe> element, have utilize window.opener access owner of pop-up window. edit: both window.paren...

php - array search not working -

php - array search not working - i have got folowing code. $coauthors = get_post_meta( $post_id, "coauthors" ); print_r($coauthors); ok result print_r is array ( [0] => 78 ) array ( [0] => 78 ) now user id 78 should homecoming true follow code doesnt. $key = array_search( 78, $coauthors ); if($key) { homecoming true; }else{ echo "no"; } why no going wrong best way this??? thanks im still getting issues here function. add_action('is_true','isdauthortrue'); function isdauthortrue( $post_id ) { $current_user = wp_get_current_user(); if ( !($current_user instanceof wp_user) ) return; $current_user = wp_get_current_user(); $coauthors = get_post_meta( $post_id, "coauthors" ); $key = array_search( $current_user->id, $coauthors ); $key = 0; if($key !== false) { homecoming true; ...

python - update file descriptor after os.rename() -

python - update file descriptor after os.rename() - what best way handle bad file descriptor errors after calling os.rename() in next manner? f = open('foo.txt', 'rw') os.rename(f.name, f.name + ".bak") in file scheme there no longer foo.txt instead foo.txt.bak however.. f.name gives foo.txt instead of foo.txt.bak but.. f.write("test") gives bad file descriptor is there way update file descriptor? should still phone call f.close() tho file has been renamed? you can write function rename open file. basically, close, rename, , reopen file, preserving attributes such file position , mode. tweaking of mode necessary reopen -- if file's mode "w", reopening same mode lose in it, utilize "r+" mode in case when reopening. (this isn't perfect, allows read access file, didn't have before, it's best can do.) of course of study new file descriptor, function's homecoming valu...

javascript - default value f:textarea -

javascript - default value f:textarea - i've probelm jsp. need set default value f:textarea field so, that, on mvc controller extract info db , on jps print it: <textarea id="description" name="description" rows="10" cols="74"> <c:out value="${fn:trim(f_default_text)}" /> </textarea> it works fine , field filled but, there empty char @ origin of inserted text. take on db , value right , tried print value on mvc controller , it's without empty space. what's happening? many guys! andrea i think <textarea> value picking indentation , line separator between tags. try joining tags ( >< ): <textarea id="description" name="description" rows="10" cols="74"><c:out value="${fn:trim(f_default_text)}" /></textarea> javascript spring jsp jstl

Determining Excel BG color in C# -

Determining Excel BG color in C# - i need write app in c# opens excel file has rows have either ayellow, bluish or plain white background color, returns values in column 'a' not have white background(just yellowish or bluish values in column should returned). i found code on info spreadsheet, don't have info on background color. i can confirm, chris walsh's reply good. utilize microsoft office primary interop assemblies: http://www.microsoft.com/download/en/details.aspx?id=3508 you can take road of visual studio tools office recommend former, it's easier , cleaner. here's code illustration shows how can set cell color, have sample of how access property. http://forums.asp.net/t/1310118.aspx/1?changing+cell+color+of+excel+sheet+programatically+ c#

iphone - UITableView with JSON help -

iphone - UITableView with JSON help - i trying feed in json info iphone app, info coming in fine have nslog's telling me so. the problem having trying results show in uitableview. have navigation controller underneath tab bar controller, navigation controller contains table view controller loads nib file table view connected class delegate , info source delegate. i need categorize results sections - these being england scotland wales n.ireland to thought of json string using see one. as can see json not cater sections yet implement this, need know beforehand not have amend much code later on. ok - using stig json parser. here listvenuesview.h (connected table view) #import <uikit/uikit.h> #import "sbjson.h" @interface listvenuesview : uitableviewcontroller <uitableviewdelegate, uitableviewdatasource> { iboutlet uitableview *venuelist; nsmutabledictionary *jsonarray; } @property (nonatomic, retain) iboutlet uitableview *v...

sql - Oracle Index not being used when joining to another table -

sql - Oracle Index not being used when joining to another table - i have next sql beingness run on oracle 10g database: select /*+ all_rows */ to_number(cv.old_value) cv_id, to_number(job.old_value) job_id amendments, amnddets cv, amnddets job amendments.table_name = 'timesheet_layer' , amendments.dml_type = 'd' , cv.amnd_id = amendments.amnd_id , cv.column_name = 'cv_id' , job.amnd_id = amendments.amnd_id , job.column_name = 'job_id'; there next indexes have been created: create index amendments_dmp_type_upper on amendments upper(dmp_type); create index amendments_table_name_upper on amendments upper(table_name); create index amendments_pk on amendments (amnd_id); create index amended_column_name_idx on amnddets (column_name); create index amnddets_amnd_id_idx on amnddets (amnd_id); i have tried using ansi joins (the below sql) not utilize indexes either, placing upper() around table_...

xml - Actions on gallery view android -

xml - Actions on gallery view android - i have 2 gallery views in single ui screen or may activity, want have listener in such way on scroll of 1 gallery view other should scroll , tried giving listener 1 gallery , calling other 1 gallery view ., working me , pls can 1 help me.. thanks in advance datta you seek find position of 1 of galleries gallery.setonitemselectedlistener() , update other gallery gallery.setselection(). android xml gallery

How to prevent sprocket code clashes Rails 3.1 -

How to prevent sprocket code clashes Rails 3.1 - rails 3.1 nice , good, except decent sized application getting lots of code clashes because rails throwing scripts , serving them every page. there must way prevent page-specific code beingness bundled , served time? the culprit require_tree . in app/assets/javascripts/application.js : http://edgeguides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives replace line 1 or more individual require statements. ruby-on-rails-3

php - My randomizing code doesn't work off-line -

php - My randomizing code doesn't work off-line - i'm php noob , made little script other scripts found on net. picks 3 random images folder named "random" , shows them. while run script online works, when seek run offline on xampp error: notice: undefined variable: random2 in c:\xampp\htdocs\sito\finaleasd2.php on line 69 it's line images given name variable. think it's due script doesn't folder name right when offline, i'm not sure: what's going wrong? :) btw script , line 69 while (!$random2 || $random2 == $random1) { (i know, it's mess! :d) thank help , time! :) <?php function randomfile($folder='', $extensions='.*'){ // prepare path: $folder = trim($folder); $folder = ($folder == '') ? './' : $folder; // check folder: if (!is_dir($folder)){ die('invalid folder given!'); } // create files array $files = array(); // open directory if ($dir = ...

c# - How to change DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames collection -

c# - How to change DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames collection - how alter datetimeformatinfo.currentinfo abbreviateddaynames collection. want utilize mine, tues instead of tue . , when utilize tostring("ddd") want see tue . is possible in c#? you may in fashion cultureinfo cinfo = cultureinfo.createspecificculture("en-en"); cinfo.datetimeformat.abbreviateddaynames = new string[]{"suns","mon","tues", "weds","thursday","fries","sats"}; now assign current civilization , should go c# asp.net asp.net-mvc

jquery - Wrapping a div around every three divs -

jquery - Wrapping a div around every three divs - say have 6 kid divs , don't have unique identifiers: <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> with jquery, want wrap every set of 3 <div class="parent"></div> . render as: <div class="parent"> <div class="child"></div> <div class="child"></div> <div class="child"></div> </div> <div class="parent"> <div class="child"></div> <div class="child"></div> <div class="child"></div> </div> what's easiest way this? wow, nice challenging question =)...

php - String comparison with alternate character variables -

php - String comparison with alternate character variables - right problem...user need input text (to specific input text serial number), input must compared database. because of little print user create error between characters like: (b/8), (1/l),(0,o),(u,v). the question how create user input "l234b" valid entry when serial number "12348"?? here examples: o12u3 ---> 012v3 thanks. some solution might replace occorences "8" "[8b]" match against both possibilities: $sn = "l234b"; $sn_new = ""; $problematic_chars = ['b' => 'b8', '8' => 'b8', '1' => '1l', 'l' => '1l', ...]; // go through original string , create new string // "l234b" becomes "[1l]234[8b]" for($i = 0; $i < strlen($sn); $i++) { $char = $sn[$i]; if (array_key_exists($char, $problematic_chars)) { $sn_new .= "[".$probl...

javascript - jQuery Mobile $.mobile.changePage post to page -

javascript - jQuery Mobile $.mobile.changePage post to page - i'm using jquery mobile create mobile (obviously) website. have list of items created dynamically based off ajax request. works well! the next thing these list items need link "page" require parameter beingness sent it. the code i'm using is: $("#cwcountries [data-role='listview'] a").live("click", function() { var dataurl = $(this).data("url"); if(dataurl != null) { $.mobile.changepage($("#cwcountryspec"), { type: "post", data: dataurl }); } }); which alter cwcountryspec page you'd expect. can see i'm using sec parameter in $.mobile.changepage pass info through want already-existent page able receive , create utilize of. i can intercept alter cwcountryspec code: $("#cwcountryspec").live('pagebeforecreate', function(event) { console.log(ev...

javascript - conditional loading of jquery and jquery UI issues -

javascript - conditional loading of jquery and jquery UI issues - the next works perfectly: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script>!window.jquery && document.write(unescape('%3cscript src="/scripts/jquery-1.6.2.min.js"%3e%3c/script%3e'))</script> however, doing same jquery ui (but alter window.ui - should right i'm not 100% sure) not work - loads local version every time not when cdn file not available (per firebug): <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"></script> <script>!window.ui && document.write(unescape('%3cscript src="/scripts/jquery-ui-1.8.14.min.js"%3e%3c/script%3e'))</script> it load local version when network unavailable when cdn version loaded (which means unnecessary double loading). ? your load check needs little tweak. jquery ui c...

java - Clustering vs Replication -

java - Clustering vs Replication - there n clients, main concern is of them online (the more better) much time. there 1 server, reasons of budget , powerfulness consumption. have seen problem many angles, exposed in give-and-take strategies java orm unreliable network , low bandwidth summarized options. clustering. using terracotta , using sec server (passive) installed on node. replication / synchronization. original idea: allow nodes offline during network failures , restart operations. what recommend? ps if there wrong in reasoning please tell me thanks thoughts. application simple point of sale. after thinking , analyzing reply seek store users, products , sales in dso's (using boxes servers , nodes @ same time). @ 1 time server database available pour sales according producer-consumer pattern. and apology short communication skills, i'm still learning english!. java hibernate network-programming replication cluster-computing

x86 - Can static storage (mostly data segment) cause segmentation fault? -

x86 - Can static storage (mostly data segment) cause segmentation fault? - static storage decided @ compilation time. however, consider scenario have lot of lazy initialization in functions: void foo () { static int a[1000]; } i not discussing coding practice here, technical aspect. many such other functions like foo() executed, many static variables introduced on info segment. will compiler take lazy initialization in business relationship while allocating space info segment. if 'no' then, cause segmentation fault @ runtime while code executing ? (more happen when lot of static info within template methods). just because initialization lazy, allocation isn't. standard requires static variables (including local variables) 0 initialized before start of program. , in fact, static means (in case): space variable nowadays entire lifetime of program. x86 segmentation-fault lazy-initialization data-segment

c# - Microsoft.Office.Interop.Word Version 11 with VS2010? -

c# - Microsoft.Office.Interop.Word Version 11 with VS2010? - i have winform app scrapes .doc files glean info them. it's using microsoft.office.interop.word v14 , works fine on windows 7 machine office 2010. need create app work on xp office 2003. going add together reference v11 of dll not find it. downloaded pia installer here http://support.microsoft.com/kb/897646 install disappears sec install. how add together reference v11 of interop libraries without having office 2003 installed? thanks, chris i needed alter embed interop types property on assemblies true. found article on here: msdn.microsoft.com/en-us/library/ee317478.aspx. working on win7/office2010 , xp/office2003. pointing me downwards right path hans! c# visual-studio-2010

recursion - How to convert an iterative method into a recursive method (Java) -

recursion - How to convert an iterative method into a recursive method (Java) - i working through java course of study on own, don't have answers of problems. problem unit one, based on karel++, stumped me. there robot object on pile of "beepers" , needs determine how many in pile , homecoming value. need convert next iterative method recursive method. public int numofbeepersinpile() { int count = 0; while(nexttoabeeper()) { pickbeeper(); count++; } homecoming count; } can give me hint? public int numofbeepersinpile() { if (nexttobeeper()) { pickbeeper(); homecoming 1 + numofbeepersinpile(); } homecoming 0; } java recursion karel

map - How to detect location is settled iphone sdk -

map - How to detect location is settled iphone sdk - i have application gets users location , draws polyline on map. @ start app draws line on place (where gps trys gain accurate location). there way tell location accurate , hence start drawing. i thought count , if statement after 5 location updates start- should user have strong location app fail. any ideas? check out cllocation objects passed cllocationmanagerdelegate's locationmanager:didupdatetolocation:fromlocation method; have, among other things, 2 properties available: horizontalaccuracy , verticalaccuracy. they describe radius of error, measured in meters. http://developer.apple.com/library/ios/documentation/corelocation/reference/cllocation_class/cllocation/cllocation.html#//apple_ref/occ/instp/cllocation/horizontalaccuracy iphone map core-location

.net - Detecting Horizontal Mouse Wheel movement -

.net - Detecting Horizontal Mouse Wheel movement - i using mousewheel in dotnet application, have done following: msdn mousewheel example but on application great utilize existing hardware horizontal mouse wheel too. how can observe when used in .net? i using logitech rx1500 or or m-rag97. regards - * solution * override winproc grab mouse wheel event. mustinherit class win32messages public const wm_mousehwheel integer = &h20e 'discovered via spy++ end class protected overrides sub wndproc(byref m message) mybase.wndproc(m) if m.hwnd <> me.handle homecoming end if select case m.msg case win32messages.wm_mousehwheel firemousehwheel(m.wparam, m.lparam) m.result = directcast(1, intptr) exit select case else exit select end select end sub this blog post shows how can add together back upwards winforms application. .net events mouse...

entity framework - EF CF Mapping complex relationship with Fluent API -

entity framework - EF CF Mapping complex relationship with Fluent API - i trying create next constraint in model tag object's tagtype valid. a valid tagtype 1 operatingcompanyid matches tag's website's operatingcompanyid. realize seems convoluted makes sense business standpoint: an operating company has websites. websites contain tags. tags have tagtype(singular). tagtypes same across operating companies, meaning if 1 operating company has 20 tagtypes , 5 websites, 20 tagtypes should able used across fives of websites. want ensure tag's tagtype cannot 1 associated operatingcompany. what best way create constraint in model? need alter poco, or utilize fluent api? thanks in advance! [table("operatingcompanies")] public class operatingcompany : configobject { public operatingcompany() { websites = new list<website>(); } [required(errormessage = "name required field operating company.")] [maxlength(100,...

java - How should I program a simulation of physics? -

java - How should I program a simulation of physics? - i trying create java bundle can used write simulation programs. goal create 'objects' springs or solid objects cubes , spheres. have mass, velocity, gravity etc. , can interact each other. i have seen simulation programs on www.myphysicslab.com problem don't want write different equations different senarios. there way this? new programming. creating physics engine hard. (very hard). can lot of fun. well, fun in "why doing myself?" kind of way. assuming have fair grasp of maths involved*, , assuming you're interested in stiff body dynamics there couple of classic references start with: first of chris hecker's rigid body dynamics tutorials and of course of study witkin , baraff's siggraph course those places start , provide more plenty of challenge you. you @ box2d erin catto , associated gdc tutorials can download. for more specific help, forums bullet contain sub-sectio...

.net - Possible to make WebBrowser control share cookies with HttpWebRequest? -

.net - Possible to make WebBrowser control share cookies with HttpWebRequest? - is there way create webbrowser command in c#.net , requests made httpwebrequest share cookies? e.g. if request made programmatically httpwebrequest , httpwebresponse sets cookie, there way create sure set in webbrowser control? and likewise, if user navigates webbrowser command , cookie set, there way ensure cookiecontainer httpwebrequest updated? thanks help! you'd need synchronize cookies manually using internetsetcookieex / internetgetcookieex apis, , require know of urls of of subdownloads used page in question. you need pass internet_cookie_httponly flag ensure httponly cookies seen application. .net cookies httpwebrequest webbrowser-control

maven with cuke4duke: optionally defining cucumber tags on cmd line -

maven with cuke4duke: optionally defining cucumber tags on cmd line - as test developer using cuke4duke maven2, want able optionally select tests tags on cmd line. seems since maven doesn't have conditionals, 'optionally' part requires hack. the cucumber arg might e.g. "--tags @firsttag". 1 way implement have in pom.xml <cucumberargs> ... <cucumberarg>${tagargs}</cucumberarg> </cucumberargs> then cmd line has mvn integration-test -dtagargs="--tags @firsttag" this works fine when want define tags, when don't include -d argument (i.e. not selecting tags), get [info] no such file or directory - null (errno::enoent) a workaround define ${tagargs} in properties duplicate of cucumber arg use: <properties> <tagargs>--strict</tagargs> </properties> so, worst case "--strict --strict". such hack best maven capable of? i've managed work around problem u...

c# - Why does HttpSessionState not implement IDictionary? -

c# - Why does HttpSessionState not implement IDictionary? - httpsessionstate appears typical key -> value collection, why not implement idictionary-interface? background: trying output/save context of asp.net website when error occurs , wanted recursive function, outputs collection , containing collections. because httpsessionstate implements icollection , ienumerable , losing info keys if want in generic manner (= working interfaces). idictionary implies target collection capable of quick lookups key. (as far aware) httpsessionstate list of items, not dictionary style structure. search of construction take linear time there's no reason treat dictionary. if need lot of quick lookups re-create keys , values true dictionary. if don't need quick lookups, you'll need specialize class. there more things interface list of method prototypes. there semantics need preserved interface too. quick lookups key 1 such non-explicit assumption (most) consumers of ...

java - file.lastModified() is never what was set with file.setLastModified() -

java - file.lastModified() is never what was set with file.setLastModified() - i have problem millis set , read on android 2.3.4 on nexus one. code: file filefolder = new file(environment.getexternalstoragedirectory(), appname + "/" + urldecoder.decode(folder.geturl())); if (filefolder != null && !filefolder.exists()) { filefolder.setlastmodified(1310198774); filefolder.mkdirs(); filefolder.setlastmodified(1310198774); } if (filefolder != null && filefolder.exists()) { long l = filefolder.lastmodified(); } in little test write 1310198774 result returned lastmodified() 1310199771000. even if cutting trailing "000" there's difference of several minutes. i need sync files between webservice , android device. lastmodification millis part of info sent service. set millis created/copied files , folders check if file/folder needs overwritten. everything working millis returned filesystem different values set. i'm pret...

Qt: passing variables to subprojects -

Qt: passing variables to subprojects - the construction of project follow: proj proj.pro --subproj --subproj.pro ----subsubproj ----subsubproj.pro is there way can instance global variable in subproj.pro , phone call en e.g. subsubproj.pro like: proj.pro: global_var = true subsubproj.pro: message($$global_var) update maybe should more precise problem. the usual behavior in qt creator when right-click on proj , take "build project"proj"" qmake proj.pro gets invoked qmake subproj.pro , subsubproj.pro what want accomplish is: when build project "proj" proj.pro , subproj.pro invoked (not subsubproj.pro) but: when build project "subproj" invoked files subproj.pro , subsubproj.pro you accomplish 1) adding subproj.pro: template = subdirs dont_invoke_subsub{ subdirs = subsubproj } in case when qmake proj.pro 1) fulfilled. when qmake subproj.pro subsubproj doesnt built neither. so thought hand on variable p...

CodeIgniter PHP Apache 500 Internal Server Error -

CodeIgniter PHP Apache 500 Internal Server Error - i have done project in codeigniter working fine on localhost giving 500 internal server error in remote server .htacces file content. rewriteengine on rewritebase /ezgov rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l] please help me open httpd.conf located in apache installation directory in windows /apache/conf/httpd.conf and /etc/httpd/httpd.conf in unix based systems. httpd.conf apache configuration file stores various info server. search module mod_rewrite.so or ( mod_rewrite.c in rare cases). mod_rewrite module developed rewrite requested urls on fly. of time find in commented state. #loadmodule rewrite_module modules/mod_rewrite.* here # character represents commented or disabled. loadmodule rewrite_module modules/mod_rewrite.* remove # , restart apache http...

.net - Multiple oracle queries problem -

.net - Multiple oracle queries problem - i'm trying run query .net page seem having problems having multiple queries. my query similar this select * table1; select * table2 but seem invalid character error when executing .net page. runs fine in sql developer fails when set in .net page. i've added begin , end query websites suggest need run multiple queries next error ora-06550: line 1, column 7: pls-00428: clause expected in select statement can shed lite on one? thanks in advance! edit here's code query = conn.createcommand() query.commandtext = "select * table1; select * table2;" dataset = new dataset() dataadapter = new dataadapter(query) dataadapter.fill(dataset) datagrid1.datasource = dataset.tables(0) datagrid1.databind() lbl1.text = dataset.tables(1).rows(0).item("column1").tostring() if want pull 2 tables , dataset can fill dataadapte...

Is oauth (for twitter/or in general) safe over http -

Is oauth (for twitter/or in general) safe over http - i'm thinking of implementing twitter login website. i'm using library takes care of everything. on first step: retrieving request token, twitter strongly recommends you utilize https oauth authorization steps . one more question, oauth_token twitter send alter on every request? , when twitter sends access token array, values alter next time user logs in-- inquire because want save them in database. i see lot of websites not using https. question, safe utilize oauth without https? i'd no, it's not secure utilize regular http oauth. relatively simple man in middle attack on logins don't utilize https. many people have complained of having twitter , facebook accounts hacked method. many people, such myself, utilize browser plugins forcefulness sites twitter , facebook automatically onto https when available. attack particularly prevalent people utilize wireless internet. shared wireless suc...

java - Log Factory error -

java - Log Factory error - i using hibernate on eclipse , continually next error message when seek compile: build.xml:39: java.lang.noclassdeffounderror: org/apache/commons/logging/logfactory i have commons-logging.jar file within libs folder, , here classpath file: <?xml version="1.0" encoding="utf-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.jre_container"> <attributes> <attribute name="owner.project.facets" value="java"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimetarget/apache tomcat v6.0"> <attributes> <attribute name="owner.project.facets" value="jst.web...

windows - Set up local SMTP and POP3 for testing mail send and receive loop -

windows - Set up local SMTP and POP3 for testing mail send and receive loop - i have alternate smtp , pop3 servers on local machine, for testing code sends mails , waits response, when i'm offline. gprs rates in sa quite prohibitive, seek , avoid them possible. have test smtp address instead of routine google one, , smtp server must able send mail service local pop3 server, mail service client can retrieve mail. how can go on windows 7 home premium? i'm assuming programme sends email can specify smtp server address. if so, need install own personal mailserver , configure programme utilize localhost (127.0.0.1) smtp server. (when personal, mean in sense want not have heavy scheme requirements.) years ago (before broadband , gmail) used surgemail (from http://netwinsite.com/surgemail/) on home computer (it free 5 users) but there loads or others, illustration http://www.hmailserver.com or mercury 32 (from http://www.pmail.com/overviews/ovw_mercwin.ht...

How can we access notifications of other application in android? -

How can we access notifications of other application in android? - is there way acess notifications of other applications bluetooth notifications should opened programatically? for detecting missed calls see: show toast on missed phone call in android application for sms detection see: android sms notification you might read in android developer docs on intents (specifically on utilize in broadcasting) , broadcastreceiver. android notifications

PlayFramework HTTPS routes only in prod mode, HTTP in dev mode -

PlayFramework HTTPS routes only in prod mode, HTTP in dev mode - i routes https when in production mode, http in development mode. right now, way i'm aware of creating https routes using: @@{controller.action().secure()} , hard-codes them https. is possible in routes or application.conf setting? the easy way alter way works dev prod mode, leaving play in http only, , securing whole site in prod mode fronting http server nginx, lighttp or apache. this approach means application stays same in both modes, , configuration done @ higher layer application. this approach mean entire site become https, don't see beingness bad thing, in fact may give users little more confidence in security of entire site. playframework

matlab - How to add white noise process term for a couple of ODEs, assuming the Gaussian distribution? -

matlab - How to add white noise process term for a couple of ODEs, assuming the Gaussian distribution? - this question has confused me several days. while referred senior students, cannot give reply. we have 10 odes, each noise term should added. noise defined follows. since find cannot upload picture, formula below maybe not clear. in order understand, can either read explanation or go address: plos one. find description of equations straight above support information in address the white noise term epislon_i(t) assumed gaussian distribution. epislon_i(t) means equation i , , @ t timepoint, value of noise. the auto-correlation of noise given: (eq.1) where delta(t) dirac delta function , diffusion matrix d defined (eq.2) our problem focuses on how explain dirac delta function in diffusion matrix. since property of dirac delta function delta(0) = inf , delta(t) = 0 if t neq 0 , don't know how calculate epislon if seek sqrt of 2d(x, t)delta(t-t') . ass...

How To Put Data In 2D Array from Dataset Using Loop C#? -

How To Put Data In 2D Array from Dataset Using Loop C#? - i trying set info in 2d array getting error add together value 0,0 position 1,0 position , on please create right int count = output.tables[0].rows.count; string[,] terms = new string[count,2]; (int runs = 0; runs < count; runs++) { terms[0,runs] =output.tables[0].rows[runs][0].tostring(); terms[0,runs] =output.tables[0].rows[runs][2].tostring(); } hopes help.. terms[runs,0] =output.tables[0].rows[runs][0].tostring(); terms[runs,1] =output.tables[0].rows[runs][2].tostring(); c#

c# - Entry Point of a DLL -

c# - Entry Point of a DLL - i've c# .net wpf application, need register something(basically kernel of ninject ioc pattern) has been used bll , dal layer. i want know entry point or dll set code(kernel registration). for wpf section, utilize app.xaml.cs , wcf section utilize global.asax.cs entry point of these things. standalone dlls , entry point. one approach that, add together static class in dll fulfil purpose , app.xaml.cs phone call method of bll , register kernels. seems more workaround approach. please guide me more point , logical. container configuration done in composite root of application (the point code called first time). said, in case of wpf app.xaml.cs. here register components of layers. preferably have ui code in assembly app.xaml. way creation of spplication separated execution of code. i suggest read mark seemans book described in detail. c# .net wpf wcf ninject

flash - How can i get the number of the place in an array (AS3)? -

flash - How can i get the number of the place in an array (AS3)? - if have array this: var myarray:array = ["apple","orange","strawberry"]; then want order number of orange, 1, out. there way that? if want index of "orange" this: trace(myarray.indexof("orange")); // returns 1 arrays flash actionscript-3

caching - How can caches be defeated? -

caching - How can caches be defeated? - i have question on assignment week, , don't understand how caches can defeated, or how can show assembly program.. can point me in right direction? show, assembly programme examples, how 2 different caches (associative , direct mapping) can defeated. explain why occurs , how can fixed. same programs used defeat caches same? note: homework. don't reply question me, won't help me understand material. a cache there increment performance. defeating cache means finding pattern of memory accesses decreases performance (in presence of cache) rather increases it. bear in mind cache limited in size (smaller main memory, instance) typically defeating cache involves filling throws away info you're access, before access it. caching assembly cpu-cache

c# - Why is BindingListCollectionView sealed? -

c# - Why is BindingListCollectionView sealed? - i have extension icollectionview interface allows me handle multi-selection ( imultiselectcollectionview ). want provide implementation compatible bindinglistcollectionview class sealed. know why design decision made? sealing class denotes safeguard derived class might dramatically alter basic behavior of original one. anyway, don't know what's real meaning sealing class. c# .net wpf icollectionview

Installing MySQL-Python on Mac OSX 10.6 64-bit Intel (Snow Leopard) -

Installing MySQL-Python on Mac OSX 10.6 64-bit Intel (Snow Leopard) - been trying install mysql-python no luck. there plenty of guides out there, many appear incomplete , come own slew of errors. i can't find formal documentation on operating systems supported each version of mysql-python. @ moment, i'm trying install version 1.2.3 on 64-bit mac running osx 10.6. the latest error i've received: python 2.6.1 (r261:67515, aug 2 2010, 20:10:18) [gcc 4.2.1 (apple inc. build 5646)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import mysqldb traceback (most recent phone call last): file "<stdin>", line 1, in <module> file "build/bdist.macosx-10.6-universal/egg/mysqldb/__init__.py", line 19, in <module> file "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module> file "build/bdist.macosx-10.6-universal...

certificate - Openning an SSL web-browser connection in HtmlUnit library -

certificate - Openning an SSL web-browser connection in HtmlUnit library - i've searched through web couple hours on issue, , none of answers found didn't fit problem, here's me, asking first-ever question in sof. so, i'm trying open web-browser java programme using htmlunit library. web site need connect requires ssl connection, , certificate stored in usb key. ikey2023 product. the scheme used work(i did not write it), 1 of certificates in usb key expired, automatically moved on next 1 (there 4 certificates in total), , stopped working. it giving me javax.net.ssl.sslpeerunverifiedexception: peer not authenticated error. i'm home , forgot exact name of method, remember following. browser instance created, using ie8 browser.setwebconnection method called. method, according api, internal api. make connection website passing url parameter it's throwing exception @ step 3. some more details. little details might wrong i'm tyring descri...