Posts

Showing posts from March, 2012

oop - Javascript OO / jQuery.class() plug in causing problems -

i'm working code uses jquery plugin give class style inheritance( http://v3.javascriptmvc.com/docs/jquery.class.html#&who=jquery.class ). it's causing me lot of problems. in particular, class evaluated before called. when try do: $.class.extend('mountain',{ //@static init: function() { this.elev = new google.maps.elevationservice(); } }); i can't because code run before google maps loads, leading undefined error. hoping attach listener google maps load event , call mountain.inti(), while can original class runs before i've load event, still causing error. any advice? perhaps diagnosis wrong? running in meteor, though i'm not sure if that's relevant...

marionette - Better to call child view method directly from parent, or by initiating a trigger? -

i've got complex backbone/marionette app , i'm venting things out parent elements . when need trigger things in children parent elements though, it's little unclear me how should doing this. easiest thing call method on child parent, but, wonder if "cheating" in case (and perhaps causing memory leak issues or something?) , i'm curious "right" way. here's jsfiddle of extremely simplified contrived version of code. a gist of same contrived example in require based app . <header> <h4>a subview/view trigger event loop playground</h4> <p>open console , click button</p> </header> <article id="main"> </article> <script type="text/html" id="mysubview"> <button type="button" id="button">click me</button> </script> <script type="text/html" id="myview"> <div id="myregion"

python - Reverse Z Axis on matplotlib 3D Plot -

Image
how 1 reverse order on z axis of 3d plot (i.e. negative up, , positive down)? following code produces cone base pointing downward; there command (like ax.reverse_zlim3d(true) or something?) can used change tick order? the following code plots cone base pointing downward. reverse z-axis order plots base pointing up, ice cream cone, -1 @ top of graph instead of bottom. from matplotlib import pyplot p mpl_toolkits.mplot3d import axes3d # @unusedimport import numpy np math import pi, cos, sin z = np.arange(0, 1, 0.02) theta = np.arange(0, 2 * pi + pi / 50, pi / 50) fig = p.figure() axes1 = fig.add_subplot(111, projection='3d') zval in z: x = zval * np.array([cos(q) q in theta]) y = zval * np.array([sin(q) q in theta]) axes1.plot(x, y, -zval, 'b-') axes1.set_xlabel("x label") axes1.set_ylabel("y label") axes1.set_zlabel("z label") p.show() use invert_zaxis method of axes3d : from matplotlib import pyplo

ios - Can an OpenGLES 2.0 framebuffer be bound to a texture and a renderbuffer at the same time? -

brad larson provides great code here , here 'rendering scene texture-backed framebuffer', it's not clear whether same framebuffer use rest of drawing. if attach renderbuffer framebuffer, can framebuffer render texture same call? sounds might bit confused fbo usage. if need it, should started: apple developer - drawing offscreen . this too. renderbuffer can bind fbo (framebuffer object). fbo create when don't want rendering displayed immediately, want read rendering result or perform additional rendering it. way fbos work in opengl es 2.0, have 1 color attachment point available (gl_color_attachment0 - fragment shader output variable gl_fragcolor connected attachment point), , can have 1 texture or renderbuffer attached it. answer last question, cannot have fbo simultaneously write color renderbuffer , texture. as first part of question, depends whether using fbo or default framebuffer. chances behavior you're looking this: bind fbo render t

python - pygame.error Unsupported image format -

running python 3.3.0 pygame '1.9.2pre', following tutorial, new python, cant see i've gone wrong, looks same on tutorial, 4 years old. help! i error - unsupported image format both. i've tried jpg , png, version spec says supports them both. bif ="bg.jpg" mif ="man.jpg" import pygame, sys pygame.locals import * pygame.init() screen = pygame.display.set_mode((1100,750),0,32) background = pygame.image.load(bif).convert() mouse_c = pygame.image.load(mif).convert_alpha() running = true while running: event in pygame.event.get(): if event.type == quit: pygame.quit() running = false sys.exit() break screen.blit(background,(0,0)) x,y = pygame.mouse.get_pos() x -= mouse_r.get_width()/2 y -= mouse_r.get_height()/2 screen.blit(mouse_r,(x,y)) pygame.display.update() i assume pygame window not shutting due error in code. can exit python shell exit pygame

node.js - Inaccessible module error in TypeScript declaration file -

c:/node/typescript experiment/node_modules/.bin/tsc.cmd" --sourcemap mongoose.d.ts --module commonjs c:/node/typescript experiment/d.ts/mongoose.d.ts(96,35): error ts2049: parameter 'res' of exported function using inaccessible module c:/node/typescript experiment/d.ts/mongoose.d.ts(97,54): error ts2049: parameter 'res' of exported function using inaccessible module this error, i've included source code well, ///<reference path='definitelytyped/node/node.d.ts' /> export = m; declare module m { export interface mongoose { constructor(); set (key: string, value: string): mongoose; (key: string): string; createconnection(uri?: string, options?: any): connection; connect(any): mongoose; disconnect(fn: (err?: any) => void ): mongoose; model(name: string, schema?: schema, collection?: string, skipinit?: boolean): model; modelnames(): string[]; plugin(fn: (any) =

sql - logic behind deletion of duplicate rows? -

what logic behind deletion of duplicate rows? got know query used delete duplicate rows. delete tvsemp e rowid>(select min(rowid) tvsemp m e.ename=m.ename); here when divided subquery i.e first select min(m.rowid) tvsemp e, tvsemp m e.ename=m.ename; result rowid min(m.rowid) ___________________ aaaeduaabaaakiqaap then outer query select ename tvsemp emp rowid>'aaaeduaabaaakiqaap' getting n-1 results(except 1 eliminated using '>' sin) my doubt if 2 combined getting exact table without duplicate why this? are asking if first query work? delete tvsemp e rowid>(select min(rowid) tvsemp m e.ename=m.ename); the answer "yes". as how works, subquery correlated subquery , means references outer query. oracle executes subquery each row of tvsemp e , , e.ename = m.ename in subquery limits subquery's results rows ename equals ename in outer query's current row. getting n - 1 results want: if there 4 rows name chay ,

Is Twitter Bootstrap 3's .container going to have left and right padding? -

the bootstrap website , examples show .container having padding-left , padding-right of 15px. yet, rc2 .container has no padding. customization, bug, or intentional? this has been fixed in final release of bootstrap 3.

javascript - Grid column renderer tooltip using meta.tdAttr -

i have been trying add tooltip pops when hover on cell in ext.grid.panel. however, parameter "meta" renderer function column not have tdattr property! renderer : function(value, meta, record, row, col) { if (value == 1 && record.data.state === 'accepted') { meta.tdcls = 'green'; console.log('value',value); console.log('meta',meta); console.log('meta.tdattr',meta.tdattr); console.log('meta.style',meta.style); meta.tdattr = 'data-qtip="' + value + '"'; return record.data.id; } else if (value == 1 && record.data.state === 'initial version') { meta.tdcls = 'white'; return record.data.id; } else if (value == 1) { meta.tdcls = 'red'; return record.data.id; } else { return ''; } } sample console output: value 1 meta object {tdcls: "

php - SimpleXMLElement Cast As String Not Behaving As String -

ok, i'm using simplexml parse rss feeds, , many feeds contain embedded html, i'd able isolate image addresses contained in embedded html. sounds easy enough task, i'm running issue parsing data simplexmlelement objects. here's relevant code. for($i = 0; $i < count($articles); $i++) { foreach($articles[$i] $feeddeet) { $str = (string)$feeddeet; $result = strpos($str, '"'); if($result === false) { echo 'there apparently no quotes in string: '.$str; } $explodedstring = explode('"', $str); echo "<br>"; if($explodedstring[0] == $str) { echo 'explodedstring equal str. apparently, once again, string contains no quotes.'; } echo "<hr>"; } } in situation, $articles array of simplexmlelement objects each representing rss article, , containing many child simplexmlelement objects representing pro

sublimetext3 - How can I minify html, css, js/jquery and ruby code inside Sublime Text 3? -

running windows 7. best sublime text 3 plugin this, , maybe beautify code well. you may have found now, ran across same need , have tried out 2 plugins: minifier , clientside . clientside has more features linting , beautifying compatible st2 (according package control page), whereas minifier should compatible st3.

ios - App crashes on iPad simulator -

i building universal app. app working fine iphone 5 , iphone 4(different storyboard) crashes when trying run ipad 6.1 this error: -[accounttableviewcontroller topviewcontroller]: unrecognized selector sent instance 0xab52620 2013-08-19 21:13:35.527 [6871:c07] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[accounttableviewcontroller topviewcontroller]: unrecognized selector sent instance 0xab52620' *** first throw call stack: (0x2131012 0x1c26e7e 0x21bc4bd 0x2120bbc 0x212094e 0x2c1a 0xb68157 0xb68747 0xb6994b 0xb7acb5 0xb7bbeb 0xb6d698 0x2b10df9 0x2b10ad0 0x20a6bf5 0x20a6962 0x20d7bb6 0x20d6f44 0x20d6e1b 0xb6917a 0xb6affc 0x252d 0x2455) libc++abi.dylib: terminate called throwing exception you calling uinavigationcontroller method topviewcontroller on uitableview instance accounttableviewcontroller . without code, it's little difficult more specific, maybe want calling method on uitableview 's nav

python - How does __contains__ work for ndarrays? -

>>> x = numpy.array([[1, 2], ... [3, 4], ... [5, 6]]) >>> [1, 7] in x true >>> [1, 2] in x true >>> [1, 6] in x true >>> [2, 6] in x true >>> [3, 6] in x true >>> [2, 3] in x false >>> [2, 1] in x false >>> [1, 2, 3] in x false >>> [1, 3, 5] in x false i have no idea how __contains__ works ndarrays. couldn't find relevant documentation when looked it. how work? , documented anywhere? seems numpy 's __contains__ doing 2-d case: def __contains__(self, item): row in self: if any(item_value == row_value item_value, row_value in zip(item, row)): return true return false [1,7] works because 0 th element of first row matches 0 th element of [1,7] . same [1,2] etc. [2,6] , 6 matches 6 in last row. [2,3] , none of elements match row @ same index. [1, 2, 3] trivial since shapes don't match. see this more,

objective c - Converting string to NSDate -

this question has answer here: getting date [nsdate date] off few hours 3 answers i trying use nsdateformatter convert following string nsdate: 2013-08-19 7:00 am . however, following nsdate created: 2013-08-19 04:00:00 +0000 . hour wrong. my code below. don't know doing incorrectly. nsdateformatter *dateformatter = [nsdateformatter new]; [dateformatter settimezone:[nstimezone systemtimezone]]; [dateformatter setdateformat:@"yyyy-mm-dd hh:mm a"]; nsstring *string = @"2013-08-19 7:00 am"; nsdate *datefromstring = [dateformatter datefromstring:string]; you're attempting use 24-hour format hours and am/pm indicator, , won't work. change line: [dateformatter setdateformat:@"yyyy-mm-dd hh:mm a"]; to this: [dateformatter setdateformat:@"yyyy-mm-dd hh:mm a"]; and you'll find code works.

Javascript - is there any hard limit (or performance impact) for namespace nesting? -

i'm trying learn bit more javascript apart typical var x = function(){...} constructs, gone namespaces. in php, work namespaces avoid collisions , organize constants, classes , functions. far, i've done basic namespacing this: var helpers = { strings: { add: function(a, b) { alert(a + ' plus ' + b + ' equals ' + (a + b)); }, msgbox: function(text) { alert(text); } } } so can write html blocks this: <button class="ui-button" type="button" onclick="helpers.strings.msgbox('hello, world!');"><img src="assets/images/alert.png" alt="alert">&nbsp;click me!</button> my questions are: is there practical/hard limit number of levels can nest namespaces within? is there performance impact associated level of nesting given function? can extend given namespace later in time? like... having core.js file , extending

angularjs - Get the argument value of a directive in a controller -

i create directive , use argument in controller: <body ng-app="tstapp"> <navigationbar tst="hello"> </navigationbar> </body> for create directive , controller: navigationbar = {}; navigationbar.directives = {}; navigationbar.controllers = {}; navigationbar.directives.navigationbar = function () { return { restrict: 'e', scope: { t1: '@tst', t2: '=tst', t3: '&tst' }, templateurl: "common/navigation_bar/navigation_bar.tpl.html", controller: "navigationbarcontroller" } }; navigationbar.controllers.navigationbarcontroller = function ($scope, api) { console.log($scope); console.log($scope.t1); console.log($scope.t2); console.log($scope.t3); }; testapp.directive(navigationbar.directives); testapp.controller(navigationbar.controllers); in console got this: scope {$id: &qu

oracle - sqlplus fails to start. wants *.msb files -

installed sqlplus oracle downloads. unpacked both files instantclient-basic-linux.x64-12.1.0.1.0.zip instantclient-sqlplus-linux.x64-12.1.0.1.0.zip sqlplus fails start error: error 6 initializing sql*plus sp2-0667: message file sp1.msb not found sp2-0750: may need set oracle_home oracle software directory i assume don't have install whole oracle server sql client run. , basic-linux zip deemed need run oci apps sqlplus is. where these .msb files? you may need set oracle_home oracle software directory you need set oracle_home wherever you've unzippd files: export oracle_home=/path/to/instantclient you want add path, , might need add ld_library_path. instructions tell do .

vim - NERDTree with su/root access -

i came across nerdtree plugin vim seems amazing working files using ssh. there many files in var/www/html directory readonly/requires su permissions open. :nerdtree isn't working sudo vim. any workarounds?

javascript - Pause/Stop or remove HTML5 video on window resize -

i have responsive html banner has video (utilizing video tag) inside of it. unit responsive entire thing scale , video. have breakpoint setup turns on new divs when window closed below 820px. accomplished via @media (max-width:820px) { //css here } i'd include either javascript of jquery removes or pauses video when size reached video doesn't continue play out of sight. simple: .ad_div2 { display:none; } where video element lives hides div can still hear video playing in background. i've tried couple of things not sure i'm setting right. <script> var parent=document.getelementbyid("div1"); var child=document.getelementbyid("p1"); parent.removechild(child); </script> (with appropriate id names) , within @media tag isn't doing - maybe i've placed in wrong area or it's not quite need. any would, always, appreciated. thanks! you need add listener on window resize event. $(function() {

common lisp - slimv + vim : slimv ignores vim tab settings -

i'm using vim 7.3 slimv edit *.lisp files. unfortunately, slimv pretty ignores vim indentation settings causes mess time time. want use tabs indenting , have following lines in vimrc: set tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab let g:paredit_mode = 0 slimv ignores settings , insist on using spaces indentation, 2 spaces per indent. managed fix "tab" behavior (so no longer inserts 2 spaces instead of tab) commenting out setlocal expandtab in vim\vimfiles\indent\lisp.vim , however, i'm not quite sure how fix autoindentation when insert new line in middle of lisp form. in scenario slimv again ignores settings , aligns new line using spaces instead of tabs, 2 spaces per indentation level. as far can tell, indentation handled in function! slimvindent( lnum ) located in `vim/vimfiles/ftplugin/slimv.vim", i'm not quite sure how fix function (and doesn't seem have configurable settings anywhere). how can fix tab behavior in slimv? has u

Unsolved: Android audio recording using example from Google -

i'm learning how record audio using http://developer.android.com/guide/topics/media/audio-capture.html#example everything works fine, want switch: mfilename = environment.getexternalstoragedirectory().getabsolutepath(); mfilename += "/audiorecordtest.3gp"; to mfilename = getfilesdir().getabsolutepath(); mfilename += "/audiorecordtest.3gp"; but error 08-19 15:51:44.212: e/mediaplayer(6654): error (1, -2147483648) 08-19 15:51:44.212: e/audiorecordtest(6654): prepare() failed i tried log new code (to make sure i'm using valid path). note: this works on samsung galaxy, doesn't work on nexus one. want work on 2.x, 3.x, , 4.x update: added log in startrecording(): mrecorder.setoutputfile(mfilename); log.e("log", mfilename); the output of log is: 08-22 12:28:40.112: e/log(9666): /data/data/com.example.testrecorder/files/audiorecordtest.3gp tried logging exception: private void startplaying() { mpl

python 2.7 - modifying apache ports.conf via fabric script -

i automating deploy of site requires me add listen port ports.conf. right ok me replace existing 1 new sites added able modify file. have seen examples of creating backup of file , writing-out modified file in python. seems me of way there and, python-wise, i'm sure can figure out rest. (making sure change hasn't been made, etc.) however, i'm not sure doing in fabric. how go executing block of python code remotely? if need add line configuration file (and nothing if it's there), can use append function in fabric.contrib.files . example: from fabric.contrib.files import append append('/etc/apache2/ports.conf', 'listen 1234', use_sudo=true) see http://docs.fabfile.org/en/1.7/api/contrib/files.html#fabric.contrib.files.append

java - Receiving Data On Sinatra Server -

i able send data sinatra server (strings) i'm not sure how receive in sinatra code. help? java client (what i'm using send data) code: private static void contactserver() { try { string text = "this text please work"; socket sock = new socket("localhost", 4567); outputstream os = sock.getoutputstream(); url url = new url("http://localhost:4567/hello"); printwriter writer = new printwriter(os); writer.flush(); writer.write(text); url.openstream(); system.out.println("done"); string strtemp = ""; /*while(null != (strtemp = br.readline())){ system.out.println(strtemp); }*/ } catch (exception e) { e.printstacktrace(); } } that's not going work. sinatra's server understands , speaks language called the http protocol , sending string: "this text please work" through

python - Google App Engine Efficient Data store Read/Write Operation to Save Quota -

i've created google app engine apps using python.the application deals lot of user names. it has got database 50k usernames. each user name has unique hash value. stored in data store. when app user submit user name. application first checks if username exist in db. if new user name, application calculate new hash new name , store name , hash in datastore. if user name exist in datastore, retrieve old hash data store. sample code: class names(db.model): name = db.stringproperty(required=true) hash = db.stringproperty(required=true) username = "debasish" user_db = db.gqlquery("select * names name=:1", username) user = user_db.get() if user == none: #doesn't exist in db..so calculate new hash name , store in db e = names(name=username,hash="badasdbashdbhasbdasbdbjasbdjbasjdbasbdbasjdbjasbd") e.put() else: #retrieve old hash. self.response.out.write('{"name":"'+user.name+'",&

Google Apps with own SMTP server and local emails -

currently we're using google's smtp send emails our webserver registered users. because of restrictions (500 mails per day) that's no longer feasible. therefore set postfix on our machine , reconfigured webapps use one. now, postfix delivers emails going our own emails addresses (*@gibbonsfive.de) locally , not google apps anymore. on top, won't deliver email mailing lists configured on google server because says user / alias not exist. there way make work following way: google apps our email adresses, including google's smtp server (working) webapps using our own smtp (working) , emails send user our own domain (*@gibbonsfive.de) not delivered locally (does not work) our setup: bind-config domain: ... ns in 78.46.106.246 ns1.rollernet.us. in 208.79.240.3 ns2.rollernet.us. in 208.79.241.3 @ in mx 10 aspmx.l.google.com. @ in mx

WP site, ASP.net Web API ApiController -

we building our public facing website on wordpress , on linux server. user logging wordpress site oauth2. our data , api going built on asp.net mvc4 server. have couple of problems need resolve , trying figure out secure way authenticate on iis server. 1. need authenticate wordpress. 2. need associate customer numbers login 1 above. 3. somehow need able use associated customer number , of authentication allow iis server service requested api. some thoughts store kind of uuid each customer number , store on wp , iis server , when request comes in iis confirm passed uuid matches issued wp server in step 2 above. concern though uuid compromised/forged @ later time , uuid used make calls api on iis server. what best way implement security on iis server allows customer login on wordpress server? i'm using custom http authentication module in iis, when need consume web api wp, follow approach: build petition custom authentication rules (example: can use custom http heade

python - Problems with Matrix Multiplication -

i'm having troubles when comes multiplying 2 matrices. attributeerror appears when i'm trying perform addition part traceback (most recent call last): file "matrixclass.py", line 189, in <module> main() file "matrixclass.py", line 184, in main mat.multiplymatrixes(mat1,mat2) file "matrixclass.py", line 176, in multiplymatrixes self[i][j] += (m1[i][k])*(m2[k][j]) attributeerror: matrix instance has no attribute '__getitem__' i tried saving new matrix in instance called example m3 thought better use self instead. here's code: def multiplymatrices(self,m1,m2): if m1.getrows() == m2.getcolumns() , m1.getcolumns() == m2.getrows(): self.setrows() self.setcolumns() in range(m1.getrows()): j in range(m2.getcolumns()): k in range(m1.getcolumns()): self[i][j] += (m1[i][k])*(m2[k][j]) i created instance of self in main() , before c

Join 2 integers (integral and decimal part) to a double in C# -

consider following code: int integralpart = 123; int decimalpart = 12345; // double desireddouble = 123.12345; i create double 2 ints, shown in example. i know can use double.parse(integralpart.tostring() + "." + decimalpart.tostring()) , getting exceptions if application isn't using english default language. from wording alone, i'd suggest wanted use decimal s: int integralpart = 123; int decimalpart = 12345; decimal result = decimalpart; while (result>=1m) result/=10m; // caveat: see below result+=integralpart; oops. , there big ambiguity problem others have mentioned. likely, you'd need replace while fixed scale: result = integralpart + decimalpart / 1000000m; // fixed scale factor

javascript - AJAX post from within iFrame to refresh parent page -

i have js function called in iframe performs post server , suppose refresh parent page of iframe. when click button on third party site, hidden div rendered iframe. once make submit post, want refresh page (3rd party) page. so current setup website (which third party , have no control on code), this: body div div div table tr my iframe .... so code attached jquery ajax post call such: ..... xhtml.append("}).done(function() { alert('im here'); window.location.reload(false);});"); xhtml.append("}"); ..... i'd prefer not showing code - can confirm done callback post called correctly , page appear "refresh" - should treating first entered page, iframe closed. how fresh reload of page/css/etc? figured work, appears doesn't. --edit-- i realized adding reload(true) reload server on initial request. however, other content renders (to view hidden div) doesn't appear reload correctly. leaves hidden div

javascript - Filtering AJAX returned data and performing .each on selected elements within -

lets have 4 tabs within nothing in them until clicked (lazy load concept). when: tab1 clicked: data inserted tab via ajax. tab2 clicked: data inserted tab via ajax. etc. the data that's being returned consists of: <ul class="elements"> <li> <div>stuff</div> <ul class="comments"> ...initially empty </ul> </li> </ul> now in success function i'm calling function gets comments associated li children of parent ul.elements , i'm having trouble. so after elements loaded tab, have function needs doctoring: function loadcomments(data) { $newdata = $(data).filter('ul.elements'); $newdata.find('ul.comments').each(function() { var commentshome = $(this); $.ajax({ url: '/myfeed.aspx', type: 'post', datatype: 'html', data: { "xfd" : "getcomments', }, success: function(data) { commentshome.ht

c++ - Can I pass a subset of a matrix into another function in MKL? -

i trying optimize lot of matrix calculations in mkl requires me allocate large blocks of memory using : double* test_matrix = (double*)mkl_malloc(n * sizeof(double), 64) . recently, have been finding lot of memory allocation errors popping - hard replicate , harder debug. worried there internal header data mkl puts heap not accounting using current method. is there "official" way of passing subset of mkl matrix function? passing copy increase overhead much. giving reference of matrix subset this: double* = (double*)mkl_malloc(4 * 4 * sizeof(double), 64); double* b = (double*)mkl_malloc(4 * 4 * sizeof(double), 64); double* c = (double*)mkl_malloc(2 * 2 * sizeof(double), 64); ... fill in values , b ... cblas_dgemm(cblasrowmajor, cblasnotrans, cblasnotrans, 2, 2, 2, 1, &a[2], 4, &b[2], 4, 0, c, 2); cout << "result is: " << c[0] << c[1] << c[2] << c[3] << endl; what did official way referen

c++ - How would I portably implement aligned stack storage in C++03? -

in c++03 code, how portably implement unsigned char[sizeof(t)] buffer has same size , alignment of given type t ? for example: template<class t> void test() { unsigned char buffer[sizeof(t)]; // <----- how ensure aligned? if (some_condition()) { t *const obj = new(buffer) t(); // ... obj->~t(); } else { /* use 'buffer' else */ } } is possible, or forced use compiler extensions in order implement this? in guru of week #28 column, herb sutter uses union it's less robust boost's efforts. boost's aligned_storage solves gory details you. if @ implementation, you'll see uses mscv's __alignof or gcc's __alignof__ template: type_with_alignment . from own codebase, once used (derived gotw link above): #if defined(_msc_full_ver) && (_msc_full_ver >= 150020706) # pragma warning(push) # pragma warning(disable: 4371) #endif // #if (defined(_msc_full_ver) && (

android - Ignore touches in overlay view -

i have layout pretty simple - has 2 views: list view , fully-covering "overlay" view; below example: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <listview android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/listview"/> <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <imageview android:layout_width="360dp" android:layout_height="270dp" android:id="@+id/imageview" android:layout_centerinparent="true" android:background

vb.net - ObjectListView cell contents changing Issue -

i wanted pragmatically change content of cell. have tried this private structure items dim id integer dim name string end structure dim objitem items private sub additem() objitem.id = 1 objitem.name = "name" objectlistview.addobject(objitem) end sub private sub changeitem() objitem.name = "myname" objectlistview.refreshobject(objitem) end sum additem() method working fine. changeitem() method doesn't work. what's wrong code

maven - "scala: unreachable code" but no line number or hints? -

running maven , intellij idea both give me similar terse error. here interesting part of maven output: [info] compiling 138 source files ... [error] error: unreachable code [error] 1 error found [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ not getting line number, method names or class names out of error, , i'm not sure in code has been introduced. apart going on previous source code commits, or iteratively commenting out large sections of code, how work out problem is? maybe there compiler flag more verbose error? update i did work out error was--a match/case 1 of case options unreachable. found via trial , error, revealed more specific error after commenting parts of code. unfortunately, following did not help: i tried adding -verbose option scala-maven-plugin : <groupid>net.alchim31.maven</groupid> <artifacti

java - findViewById must be void but can't make it void -

i trying use findviewbyid in code, must void, wrong? don't want have method clickbutton if take out, says must void. there way can without changing in code? import android.os.bundle; import android.app.activity; import android.app.notificationmanager; import android.view.menu; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.togglebutton; public class loginworker extends activity implements onclicklistener{ button login; edittext user, pass; togglebutton repass; textview invail; private boolean savelogin = false; public void clickbutton() { login = (button) findviewbyid(r.id.bloginf); user = (edittext) findviewbyid(r.id.usernametf); pass = (edittext) findviewbyid(r.id.passwordtf); invail = (textview) findviewbyid(r.id.invalidinfo); repass = (togglebutton) findviewbyid(r.id.reme

Regex Exact Number of Characters -

how limit number of characters (alpha or numeric or anything) example have (x can character) name.xxx-xxx-xxxxxx-name name.xxxxxxx-name i want exclude of first format , thought should like name.{7}*-name i want 7 characters between . , - you don't want 7 characters. want 7 non-dash characters name\.[^-]{7}-name

jasper reports - How to slide up text fields in summary band when one is empty? -

i have jasperreports report invoice. @ bottom of invoice in summary band, have few fields summed invoice details. standard stuff. 1 of fields "account balance", lists outstanding balance on account can add "amount due today" last line of summary section. however, accounts don't have outstanding balance i'd skip line on invoices, move below text fields up. how can accomplish this? using latest version of jasperreports , use groovy engine. i'm thinking somehow programmatically change position of elements, or perhaps use subreport summary? as far understood, "line" "account balance" simple text field? set option "remove line when blank" , possibly "blank when null" remove field if it´s empty. the following elements should have "float" setting, israel mentioned.

Posting a form via PHP over email -

i'm after little advice. has asked if can form system use. @ moment user fills out form (large on 150 fields) when submitting validated jquery , php shows form on confirmation page. @ point user asked print off form , give client. data not stored anywhere. have been asked if can adapt email form , that's need advice. form @ moment formatted css , said has on 150 fields. client wants exact report emailed need covert every line of code there 650 odd lines php can emailed? code mix of html, javascript php echoing values , of course css stylesheets attached. i suppose asking there easier / better / quicker way of emailing whole page values? thanks help. if want email what's on confirmation page, @fred -ii-'s suggestion might work. since have php code forming output page, use output buffer , contents prior flush ing page. see php's output control functions . keep in mind there no sanitizing or verifying of data way! if kind of error message or invalid

How to reuse my xml relative layout in android -

hi have m file relative layout , contains 9 image buttons. reuse layout multiple times changing names , id's. able gridview problem want use same customs design have using relative layout. can 1 how it. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <imagebutton android:id="@+id/day0" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_aligntop="@+id/day1" android:layout_marginleft="14dp" android:scaletype="fitxy" android:src="@drawable/day0" /> <imagebutton android:id="@+id/day3" android:layout_width="wrap_content" android:layout_height="wrap_content&

validation - Spring @Validated Causing HTTP 400 -

when add @validate annotaion method signature in controller, http 400 description, "the request sent client syntactically incorrect ().". have idea why? good code public modelandview startaccountsubmittal( accountcredential accountcred, httpservletresponse response) throws messagingexception { bad code public modelandview startaccountsubmittal( @validated(value={accountstates.submitted.class}) accountcredential accountcred, httpservletresponse response, bindingresult result) throws messagingexception { thanks in advance, joe the uncaught exception had configured not catching error. added exception handler controller , able details. had few fields trying validate, contained nulls, required values. caused http 400. turning on exception handler helped exception , stacktrace. modified code , added groups, added new groups object , controller. works planned.

c# - Why when I use RegularExpression as DataAnnotation is not recognizing the leading zeros? -

i have field in entity have regularexpression dataannotation: @"^\$?([0-9]{6})(.[0-9]){0,1}?$" and works fine, except when use zeros before number. ex. - 123456.1 work - 012345.1 not work if same validation regex.ismatch says ok. how can force mvc keep leading zeroes when validation? at end used string variable , worked: ^\$?([0-9]{6})(\.[0-9])?$ i followed @sinsedrix , @michelle advice

html - Javascript: Page load time -

how calculate time takes load page , display it? using snippet got online , modified display preference. there better way calculate time takes page load? note: ladezeit date time in german. <!--begin_loadtime--> <script type="text/javascript"> ladestart = new date(); function ladezeit() { current = new date(); dtime = current.gettime() - ladestart.gettime(); loadtime = dtime/1000 +" seconds page load time."; document.getelementbyid("ladezeit-anzeige").innerhtml = loadtime; } </script> <body onload="ladezeit()"> <div id="ladezeit-anzeige" style="position: absolute; top: 5px; left: 10px;"></div> <!--end_loadtime--> page load speed depends on many factors, includes time takes load external files, such css, js, images, , etc , how fast webserver responds. using on page javascript commands detect page load speed flawed doesn't count how fast server responds , e