Posts

Showing posts from April, 2015

Android Selector Drawable doesnt work with attributes -

i using attr create selector drawable project once change theme colors, dont have make change in drawable file. using following libs: compile 'com.android.support:appcompat-v7:+' compile 'com.android.support:cardview-v7:+' compile 'com.android.support:design:22.2.0' here source code drawable: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?attr/colorprimary" android:state_enabled="true" android:state_window_focused="false"/> <item android:drawable="?attr/colorprimarydark" android:state_pressed="true"/> <item android:drawable="@android:color/darker_gray" android:state_enabled="false"/> <item android:drawable="?attr/colorprimary"/> </selector> in same code, if replace attributes colors defined in colors

ajax - reset jquery variable to initial -

i'm creating ajax post load wordpress project. when scroll down page, page number increased 1 each time. want. actual problem: when select category drop down, want reset page variable 1. following code set page number 1 instance called, , when scroll down page increased previous number not 1. for ex: when open link , inspect in firebug... - see pagenumber variable set 1. - scroll down page , changed 2. when go , select category filter posts, , - inspect page number in firebug showing 1, right. - if scroll down page pagenumber changed 3 not 2. this problem... // ajaxloop.js jquery(function($){ var $grid = $('.post-area').masonry({ itemselector: '.post-area .box', }); var page = 1; // initialization var loading = true; var $window = $(window); var $content = $("body.blog #main"); var load_posts = function( page = 1, cat = '', year = '', orderby = '' ){ // if filter applied , page 1 if((

java - How to loop and get the specific value of the json object ,how can i use that json object to get the other entity present in that json object? -

this question has answer here: how loop through json array? 7 answers i using java. i have pasted below response reference. need loop below json array response. i can able full response. but, need access device type first example:devicetype=android , using device type need id of particular device type example: id=16. response: { "bannerconfigurations": [ { "id": 16, "partnerid": 69, "appid": "28470216", "affiliatedata": "", "status": true, "devicetype": "ios", "dayshidden": 15, "daysreminder": 30 }, { "id": 161, "partnerid": 69, "appid": "com.android.news", "affiliatedata": "", "status&qu

delphi - How can I send data between 2 applications using SendMessage? -

i have 2 applications- manager code: procedure tform1.copydata(var msg: twmcopydata); var smsg: string; begin if isiconic(application.handle) application.restore; smsg := pwidechar(msg.copydatastruct.lpdata); caption := caption+'#'+smsg; msg.result := 123; end; procedure tform1.button1click(sender: tobject); const wm_my_message = wm_user + 1; var h: hwnd; begin caption := 'x'; h := findwindow('tform1', 'client'); if not iswindow(h) exit; caption := caption+'@'; sendmessage(h, wm_my_message, 123, 321); end; and client with: procedure tform1.wndproc(var message: tmessage); const wm_my_message = wm_user + 1; var datastruct: copydatastruct; s: string; h: hwnd; begin inherited; if message.msg <> wm_my_message exit; h := findwindow('tform1', 'manager'); if not iswindow(h) exit; message.result := 123; s := edit2.text + '@' + edit1.text; datastruct.dwdata := 0;

jquery - What's the best way to add a delay and transition of overlay DIV being shown? -

i'm not @ js, please bear me. i've got portion of code makes overlay appear on site when menu hovered over. $('#menu-main-menu > .menu-parent-item').hover( // when hovered function() { $('#overlay').css('display','block'); }, // when not hovered function() { $('#overlay').css('display','none'); } ); the overlay div shown instantly when mouse hovers on menu. menu items have nice css fade come in, i'd apply either smooth transition, or delay overlay div. can added code, or better being performed css transition also? use fadein / fadeout duration like $('#menu-main-menu > .menu-parent-item').hover( // when hovered function() { $('#overlay').fadein(1000); }, // when not hovered function() { $('#overlay').fadeout(1000); } ); alternately, can

scala - scalatest "A stack" should "do something" -- wtf? How is should a method of string? -

i'm starting out scala here , i'm finding of syntax confusing. example scalatest main page class examplespec extends flatspec matchers { "a stack" should "pop values in last-in-first-out order" in {...} } as read means "should" method of string "a stack"? if right, how happen? doesn't seem work scala prompt scala> class examplespec { | "a stack" should "pop values" | } <console>:9: error: value should not member of string "a stack" should "pop values" if "should" not method of string "a stack" in above snippet how read snippet correctly? "should" , how relate string? clues? this commonly known pimp library enrich library pattern can extend other libraries (in case scala strings) our own methods using implicit conversions. the way works flatspec mixes in trait called shouldverb has following implicit conver

apache pig - Pig is storing the data in Temporary Directory instead of actual directory -

below pig command ( local mode ) saving file in temporary directory in expecting same stored in actual directory. thoughts? store c '/user/hue/pigbasic1' using pigstorage('*'); hadoop fs -cat /user/hue/pigbasic1/_temporary/0/task_local1045577955_0002_r_000000/part-r-00000; thanks in advance

jquery - Images tremble on animate -

i wrote little script animate elements of list on mousewheel scroll html <div id="scroll"> <ul> <li style="background-image: url('http://i.imgur.com/egmfpfq.jpg')"></li> <li style="background-image: url('http://i.imgur.com/qjmcv5g.jpg')"></li> <li style="background-image: url('http://i.imgur.com/egmfpfq.jpg')"></li> <li style="background-image: url('http://i.imgur.com/qjmcv5g.jpg')"></li> <li style="background-image: url('http://i.imgur.com/egmfpfq.jpg')"></li> </ul> </div> jquery $.fn.scroll = function () { var $this = $(this); var $list = $(this).find('ul'); var $lis = $list.find('li'); var count = $lis.length; var direction, currentslideposition; $this.addclass('scroll'); $list.addclass('slides-list'); $lis.ad

java - How to use Timer and SwingWorker in an Eclipse Plugin? -

i'm developing eclipse plugin contribute gui view. the view updated informations versioning system when user selects folder or file in workspace. in order avoid collecting data everytime user goes through project subfolders , files, need wait 3 seconds in order sure file or folder 1 of interest. i'm doing using swing timer. this ok small amount of data, large amount of data gui blocks, waiting timer execute update function. i know kind of task can use swingworker can't figure out how delay task , restart delay when needed. can give me solution on how correctly solve problem ? here current code: public void resettimerifneeded() { if(timer.isrunning()) timer.restart(); else timer.start(); } public void timer() { selectiontimer = new timer(3000, new actionlistener() { @override public void actionperformed(actionevent arg0) { // todo auto-generated met

GWT DataGrid column width issue after removing columns -

in our gwt application create datagrid , fill n columns. @ specific conditions need remove couple columns datagrid. when so, have problem column widths shifted previous amount of columns resulting datagrid doesn't take full proper width. checking html code of datagrid, have found out after removing column datagrid, colgroup element of table contains col elements matching previous old amount of columns. colgroup element breaking layout. resetting column width, datagrid width, calling datagrid.redraw() don't this. there workarounds or solutions? this known issue , , couple of (partial) workarounds have been proposed in issue tracker. issue had been diagnosed knowledge no 1 took stab @ turning patch, reason it's still not fixed 4 years later (put differently: no 1 seems care enough it) note: issue tracker being moved github given imminent shutdown of google code hosting. if read , link above doesn't work, try searching issues in github project

c# - html <pre></pre> page layout blocks links -

i taking document html page show user .net libraries' help. using loadhtml method under htmlagilitypack. when use method fill html, not show tab(ascii=09) characters right. use like: doc.loadhtml("<pre>" + pcontent + "</pre>"); but when can not add picture links or pictures html page. before use "< pre >", user able add links. code below running behind. string text = string.format(@"<img src='{0}' />", thepicturelink); my problem want make page both added links(pictures) , looks proper tab character. not find solution in here, msdn, socialmsdn, codeproject or google. have solution problem? thank helps. best regards.

c# - ASP:Literal not within context when placed in ItemTemplate of Repeater -

i have asp.net page behaving differently peers , can't seem find out why. sadly cannot post lot of code business reasons, , know limit users' ability assist. i have 1 page have hidden , checkbox , other unimportant things. something like: <asp:repeater id="goodrepeater" runat="server" onitemdatabound="goodrepeater_onitemdatabound"> <itemtemplate> <asp:literal id="lithappyliteral" runat="server" /> <!-- other junk doesn't matter --> </itemtemplate> </asp:repeater> on page however, have same setup, reason whenever put inside itemtemplate, drops out of context , can no longer reached code-behind. ex: <asp:repeater id="repeaterthatmakesmesad" runat="server" onitemdatabound="repeaterthatmakesmesad_onitemdatabound"> <itemtemplate> <asp:literal id="litsadliteral" runat="server" /> <!--

mongodb - Mongoose Import Json Export with IDs -

i want import unit tests fixed limited subset of actual database. exported database mongo shell mydata.json. want read array of json files db, keeping ids. 1st: fail on reading json export, how fix this? if !db? mongoose.connect(configdb.url,{auth:{authdb:configdb.authdb}}, (err)-> if (err) console.log(err) ) db = mongoose.connection db.on('error', console.error.bind(console, 'connection error:')) db.once('open', () -> console.log "database established" #delete data , seed new data somemodel = require(applicationdir + 'node/models/some.model.js') somemodel.remove({}, (err) -> console.log('collection somes removed seeding new one') fs.readfile(__dirname + '/../../mongo/seed-for-test/somes.json','utf-8', (err,filedata) -> console.log typeof filedata filedata = json.parse(filedata) console.log filedata.length # new somemodel

wordpress - How I can remove the Save button in the PDF viewer? -

i'm trying remove or block save button on browser pdf viewer on page made in wordpress, try fix using embed when increasing size of display returns , save button appears. i try work line of code. <embed src = "http: //localhost/transferencias/wp-content/uploads/2014/12/zona200.pdf" type = "application / pdf" width = "100%" height = "100%"> but did not work, maybe know wordpress plugin allows me block buttons. thanks time. you can control pdf plugin passing parameters on query string. adobe has documentation on parameters used open pdf files . can hide toolbars, scrollbars, set zoom levels etc. documentation rather old, should still valid. using link above, set src to <embed src = "http: //localhost/transferencias/wp-content/uploads/2014/12/zona200.pdf#toolbar=0" type = "application / pdf" width = "100%" height = "100%"> to disable toolbar (and hide save button). pl

scala - When to use monads from scalaz? -

i'd create simple wrapper computations. built-in scala monads ( traversablelike ) seems sufficient me. , have syntax sugar. point of view scala collection traits accidental monads. , there intended monads provided scalaz library. what uses cases benefit complex type classed monads of scalaz? functionality unfeasible built-in monads , indicate need scalaz? some clarification. this question not holy war inheritance vs type classes. question infrastructure provides scalaz. not library type classes approach, mentioned library. complicates things. have bunch of utility classes have no matches in scala collection library. because collection library, not monadic. question additional functionality provided scalaz. in cases matter? first point terminology: it's useful shorthand things " option monad", " option has monad instance" or " option monadic" clearer. it's potentially little confusing scalaz provides bunch of monads—what

"Unicode Error "unicodeescape" codec can't decode bytes... Cannot open text files in Python 3 -

i using python 3.1, on windows 7 machines. russian default system language, , utf-8 default encoding. looking @ answer previous question , have attempting using "codecs" module give me little luck. here's few examples: >>> g = codecs.open("c:\users\eric\desktop\beeline.txt", "r", encoding="utf-8") syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-4: truncated \uxxxxxxxx escape (<pyshell#39>, line 1) >>> g = codecs.open("c:\users\eric\desktop\site.txt", "r", encoding="utf-8") syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-4: truncated \uxxxxxxxx escape (<pyshell#40>, line 1) >>> g = codecs.open("c:\python31\notes.txt", "r", encoding="utf-8") syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 11-12: malf

voltrb - How do i implement a live clock? -

i have been playing round volt few days , love simple bindings allows. trying show 'live clock' on page using time.now. have tried binding time.now various collections within controller didn't quite work (i had refresh page new time show up, beating purpose). there way achieve without use of javascript? right don't have bindings on time done yet. on todo list, @ moment you'll have manually update it. in lib file, require in controller `require '{component_name}/lib/{file}' class time def live dep = volt::dependency.new dep.depend volt::timers.client_set_timeout(1000) dep.changed! end self end end then in controller, can call .live on time instance instance of time class reactively update. let me know if works. :-)

How do I invoke a MobileFirst Platform Adapter using PUT? -

Image
this similar question asked here , question not answered problem is. customer.xml <?xml version="1.0" encoding="utf-8"?> <wl:adapter name="customer" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:wl="http://www.ibm.com/mfp/integration" xmlns:http="http://www.ibm.com/mfp/integration/http"> <displayname>customer</displayname> <description>customer</description> <connectivity> <connectionpolicy xsi:type="http:httpconnectionpolicytype"> <protocol>https</protocol> <domain>kenatibm.cloudant.com</domain> <port>443</port> </connectionpolicy> </connectivity> <procedure name="addcustomer"> </procedure> </wl:adapter> customer-impl.js function addcustomer(param1) { var input = { meth

java - LWJGL wglGetCurrentContext exception -

i starting learn lwjgl, i'm having problem it. error line glcontext.createfromcurrent(); , can't figure out how fix it. first step using lwjgl wrote own code creating display, error popped up. later copied demonstration code lwjgl web page, have same error. , full error is: hello lwjgl 3.0.0a! exception in thread "main" java.lang.unsatisfiedlinkerror: org.lwjgl.opengl.wgl.wglgetcurrentcontext()j @ org.lwjgl.opengl.wgl.wglgetcurrentcontext(native method) @ org.lwjgl.opengl.glcontextwindows.createfromcurrent(glcontextwindows.java:59) @ org.lwjgl.opengl.glcontext.createfromcurrent(glcontext.java:36) @ main.loop(main.java:97) @ main.run(main.java:26) @ main.main(main.java:117) as left out interesting half of exception message guess didn't set path lwjgl right: system.setproperty("org.lwjgl.librarypath", new file("pathtonatives").getabsolutepath()); for further reference see here

mysql - PHP to return "simple" array using mysqlli -

i trying list or emails in "simple" array mysql database, can use them in phpmailer emailing. getting multidimensional array, rather array: $query = "select distinct `emailaddress` `emails` `jobid` = 1"; $result = $conn->query($query); if (!$result) { printf("query failed: %s\n", $mysqli->error); exit; } while($row = $result->fetch_row()) { $rows[]=$row; } $result->close(); $conn->close(); var_dump($rows); // return array(2) { [0]=> array(1) { [0]=> string(24) "abc@abc.com" } [1]=> array(1) { [0]=> string(17) "hello@gmail.com" } } //this how array should $myv = array("abc@abc.com","hello@gmail.com"); var_dump($myv); //this array need have: array(2) { [0]=> string(11) "abc@abc.com" [1]=> string(11) "hello@g.com" } many thanks! do fetch_assoc while($row = $result->fetch_assoc()) { $rows[]=$row['emailaddress']; }

java - Using external ACR1222L to get NDEF Messages w/ nfctools OR nxpnfclib -

i'm trying read nfc cards using acs acr1222l external reader connected android device. there doesn't appear lot of documentation available allow me perform nfc communication using ndef messages. there basic example of how use either 'nxpnfclib' or 'nfctools' translate messages basic communication? end goal able to: 1) perform rats select specific aid. 2) perform binary read application on card receive ~128 byte payload. i have both mifare classic , ntag213 cards available. i able read state change using acs library no idea there tag information, construct appropriate tag type , perform communication.

Adaptive Bitrate streaming in ios -

i trying implement adaptive bitrate streaming in ios. have m3u8 url has around 8-10 other url according bandwidth. question how implement in ios. have specific player automatically change bandwidth or have manual it. if manually how it? ios devices support hls natively, apple's adaptive bit rate streaming protocol. you can find date info specific codecs etc supported here : https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/frequentlyaskedquestions/frequentlyaskedquestions.html

polymorphism - polymorphic methods that return different class types in Swift? -

i have collection of heterogeneous object types (common superclass). per element, want fetch class type instantiate. in objectivec, did this: @implementation commonclass - (class) secondaryannotationclass { return [mkannotationview class]; // abstract implementation, return default class } @end @implementation subclassfoo - (class) secondaryannotationclass { return [fooannotationview class]; // specific annotation class } @end @implementation subclassbar - (class) secondaryannotationclass { return [barannotationview class]; // specific annotation class } @end so do recreate in swift? think it's following, haven't yet done right thing make compiler take easy red dots away. class commonclass { var secondaryannotationclass:type { return mkannotationview.self // abstract implementation, return default class } } class subclassfoo:commonclass { var secondaryannotationclass:type { return fooannotationview.self // specific annotation cl

ruby on rails - Fill a table with a foreign key by default values -

i hope me that. have 2 table, want them related : create_table "personals", force: :cascade |t| t.string "trigramme" t.string "nom" t.string "prenom" t.string "poste" t.text "bio" t.integer "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end and create_table "users", force: :cascade |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.datetime "creat

html - how to target an external div in javascript -

i have situation: <div id="first"> <div> <p>text</p> </div> </div> <div id="second"> <div> <button class="button">click</button> </div> </div> ... <div id="first"> ... </div> <div id="second"> ... </div> ... and on, structure repeats. this structure created dynamically can't use specific class nor id first div. i need retrieve text in first div when hit button in second div. (note: need pure javascript solution, not jquery solution) thanks assuming have event handler button click, event handler: function buttonclickhandler(e) { var first = this.parentnode.parentnode.previoussibling; var paragraphs = first.getelementsbytagname("p"); var text = paragraphs[0].textcontent; } if have common , known class names on the divs marked first , second, can make javascript code more

What do these JavaScript bitwise operators do? -

x <<= y (x = x << y) x >>= y (x = x >> y) x >>>= y (x = x >>> y) x &= y (x = x & y) x ^= y (x = x ^ y) x |= y (x = x | y) what these different operators do? <<, >> bit shift left , right, respectively. if imagine left operand binary sequence of bits, shifting left or right number of bits indicated right operand. &, ^, | these bitwise and , xor , , or , respectively. can think of & , | counterparts && , || , except treat operands bit vectors, , perform logical operations on each of bits. there no ^^ operator, operation "xor" or " exclusive or ". can think of "a xor b" "a or b, not both".

yield - Scala Comprehension Errors -

i working on of exercism.io exercises. current 1 working on scala dna exercise. here code , errors receiving: for reference, dna instantiated strand string. dna can call count (which counts strand single nucleotide passed) , nucletidecounts counts of respective occurrences of each nucleotide in strand , returns map[char,int] . class dna(strand:string) { def count(nucleotide:char): int = { strand.count(_ == nucleotide) } def nucleotidecounts = ( { n <- strand c <- count(n) } yield (n, c) ).tomap } the errors receiving are: error:(10, 17) value map not member of int c <- count(n) ^ error:(12, 5) cannot prove char <:< (t, u). ).tomap ^ error:(12, 5) not enough arguments method tomap: (implicit ev: <:<[char,(t, u)])scala.collection.immutable.map[t,u]. unspecified value parameter ev. ).tomap ^ i quite new scala, enlightenment on why these errors occurring ,

c# - Asp.net mvc won't take the razor parameter -

i'm developing on school project has gone great far problem has arrived. i have method in homecontroller: [httppost] public actionresult getseatsinshow(int showid) { ... return view(realseatlist); } in view use razor parse parameter controller , controller should return result in address this: http://localhost:1499/home/getseatsinshow/236 that if on other controller method called shows on following url: http://localhost:1499/home/shows/1 but on getseatsinshow method need place ?showid= snippet right under: http://localhost:1499/home/getseatsinshow/?showid=236 my razor actionlink looks this: @html.actionlink("vælg", "getseatsinshow", new { id = item.id }) can't seem find problem aftersome show method works fine same results 1 doesn't work. you have few options. you're passing parameter id, not showid, whereas controller expects parameter named showid. result, updating anonymous type

regex - Remove trailing and leading spaces and extra internal whitespace with one gsub call -

i know can remove trailing , leading spaces gsub("^\\s+|\\s+$", "", x) and can remove internal spaces with gsub("\\s+"," ",x) i can combine these 1 function, wondering if there way 1 use of gsub function trim <- function (x) { x <- gsub("^\\s+|\\s+$|", "", x) gsub("\\s+", " ", x) } teststring<- " test. " trim(teststring) here option: gsub("^ +| +$|( ) +", "\\1", teststring) # frank's input, , agstudy's style we use capturing group make sure multiple internal spaces replaced single space. change " " \\s if expect non-space whitespace want remove.

html - Positioning a background image in an element with an offset from the bottom -

Image
is there way set background fixed center, , bottom, not flush bottom of element, rather 100px bottom of element? (of course bg image visible in div bounds) this have far, don't know how bump image 100px bottom. background: url("/path/to/bg.jpg") no-repeat fixed center bottom #fff; (no javascript answers please) very simple: background-color: #fff; background-image: url("/path/to/bg.jpg"); background-repeat: no-repeat; background-position: center bottom 100px; /* answer */ ref: http://www.w3.org/tr/css3-background/#the-background-position more read: https://developer.mozilla.org/en-us/docs/web/css/background-position

wordpress query with lastname from title -

i have list hundreds of people , full name (first last) in title. there method query these posts in alphabetic order using last name (second word) title? i found http://ms-studio.net/tutorials/sorting-titles-by-last-name-in-wordpress/ cant understand how work in wp query <?php function posts_orderby_lastname ($orderby_statement) { $orderby_statement = "right(post_title, locate(' ', reverse(post_title)) - 1) asc"; return $orderby_statement; } add_filter( 'posts_orderby' , 'posts_orderby_lastname' ); ?> <?php $the_query = new wp_query( 'post_type=person&posts_per_page=100' ); while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h4><?php the_title(); ?></h4> <?php endwhile; remove_filter( 'posts_orderby' , 'posts_orderby_lastname' ); wp_reset_query(); ?>

Java construct one instance of Certain Class from another instance -

this question has answer here: how private variable accessible? 5 answers i java beginner. test code this: public class test { private string a; private string b; public test(string a, string b){ this.a = a; this.b = b; } public test(test another){ this.a = another.a;//my question comes here this.b = another.b; } public string geta(){ return a; } public string getb(){ return b; } } my question why test another can access private variable directly using . , rather using geta() or getb() method. the tutorial tells me private variable can not accessed directly . private variables cannot accessed different class, here in same class.

windows - Win7 Virtualbox is giving this error when trying to launch a vm: Error loading 'crypt32.dll': 1790 -

i installed virtual box 4.3.28 in windows 7 box, tried open imported vm , got error below. i've seen posts 1/2 year ago stating problem windows security fix, not have fix installed , have installed supposed cure it, no avail. kb3004394 not on system older fixes aren't helping me ( not see offending kb file installed on machine) vagrant laravel box, guest machine entered invalid state https://www.virtualbox.org/ticket/13677 error seeing: 1618.161c: supr3hardenedscreenimage/ldrloaddll: cache hit (unknown status -22900 (0xffffa68c)) on \device\harddiskvolume1\windows\system32\crypt32.dll 1618.161c: error (rc=0): 1618.161c: supr3hardenedscreenimage/ldrloaddll: cached rc=unknown status -22900 (0xffffa68c) fimage=1 fprotect=0x0 faccess=0x0 chits=8 \device\harddiskvolume1\windows\system32\crypt32.dll 1618.161c: error (rc=0): 1618.161c: supr3hardenedmonitor_ldrloaddll: rejecting 'c:\windows\system32\crypt32.dll' (c:\windows\system32\crypt32.dll): rcnt=0xc000

MS Access programmatically edit a datasheet cell value -

i'm validating datasheet programmatically because it's not possible "normal" way (linked tables). "normal" way tell user entered badness punish them msgbox popups - want display message in label on form (this works) , change background color of offending cell. can change cell colors through conditional formatting (this works), set rules highlight cells leading spaces. so last piece of puzzle change value of offending cells leading space gets highlighted via conditional formatting. part isn't working. when change value of cell, nothing happens. feel if datasheet needs told update new values. here's have far: private sub form_beforeupdate(cancel integer) dim isvalid boolean isvalid = mydatasheetrow_isvalid() ' if page valid, don't cancel update cancel = not isvalid end sub private function mydatasheetrow_isvalid() boolean ' validate our data cannot validated in gui due way linked tables work mydatasheetro

swift - Start the transition after 5 seconds -

hello how make transition let transitiontype = sktransition.crossfadewithduration (2.0) started after 5 seconds? my code: let nextlevel = level2(size: size) nextlevel.scalemode = scalemode let transitiontype = sktransition.crossfadewithduration(2.0) view?.presentscene(nextlevel,transition: transitiontype) you use skaction.waitforduration combined skaction.runblock in skaction sequence : let wait = skaction.waitforduration(5) let action = skaction.runblock { view?.presentscene(nextlevel, transition: transitiontype) } self.runaction(skaction.sequence([wait, action]))

sql - How to get colDate row for every colA where max(denseRank) - 1 -

i trying solve following: cola coldate denserank ------------------------------- 2015-06-10 1 2015-06-09 2 b 2015-06-10 1 b 2015-06-09 2 b 2015-06-08 3 and want result a 2015-06-10 1 b 2015-06-09 2 is possible query or can through t-sql? can example of solution? thank in advance... how this? (should work sql server 2005+) select cola, coldate, denserank ( select cola, coldate, denserank, row_number() on (partition cola order denserank desc) rn yourtable ) x x.rn = 2 edit: changed use row_number() instead of rank() . also, didn't specify, assuming given value of cola , can't have duplicate denserank values.

reactjs - Do I have to call super.componentDidUpdate in React? -

in subclass of react.component , have call super.componentdidupdate componentdidupdate method? or done automatically? (i trying call there error message cannot read property call of undefined ) you not, can see in base class extending, here , has no componentdidupdate , calling super method doesn't make sense. instead of having method present, , have nothing, react instead checks if method exists. can see here .

c# - ValidationResults on TryValidateObject is null -

i trying head around data annotations. here's class: public class video { [required] public string title {get; set; } public list<validationresult> validationresults { get; set; } public bool isvalid() { var context = new validationcontext(this, null, null); return validator.tryvalidateobject(this, context, this.validationresults); } } if create object of type video without setting title, isvalid returns false (correct!), validationresults of objects null. aren't suppose contain validationresult error message saying video required or something? to fix issue, validateallproperties parameter needs set true . e.g. validator.tryvalidateobject(model, validationcontext, validationresults, true)

html - Make divs inside table cells the same height without javascript -

i make 2 divs contained in table cells in shared row both have height of taller div. without js. here fiddle simplified example: http://jsfiddle.net/lem53dn7/1/ here code fiddle: html <table> <tr> <td> <div>small content</div> </td> <td> <div>this longer content wrap. want other div same height one.</div> </td> </tr> </table> css table{ width: 200px; table-layout: fixed; } div { border: 1px solid black; } add following properties div rule: height: 100%; display: inline-block; updated fiddle.

java - Using a ResultSet after executing two different queries with statement.executeQuery() -

this question has answer here: invalid state, resultset object closed 1 answer given code below: //connection stuff resultset rs = statement.executequery(query1); statement.executequery(query2); while(rs.next){ //code } is result set rs still valid though second statement has been executed? i know when close statement result set isn't valid longer, here code executing query , not storing in result set. presuming statement statement , javadoc : by default, 1 resultset object per statement object can open @ same time. therefore, if reading of 1 resultset object interleaved reading of another, each must have been generated different statement objects. execution methods in statement interface implicitly close statment's current resultset object if open 1 exists. the posted code unsafe - second call executequer

three.js - how do I apply the stereo effect to a video mapped sphere?` -

assuming assets linked properly. using oculusrifteffect.js or stereoeffect.js - how can make html file cardboard compatible? gist link below https://gist.github.com/4d9e4c81a6b13874ed52.git please advise exactly trying do? "stereo effect" isn't descriptive. assuming have stereo video files (one left eye, 1 right eye) you'd play them in left sphere (seen left eye), , right sphere right eye. spheres offset interpupillary distance (ipd) - 55mm. (it'd whatever stereo videos offset by). so, might ask - happens when turn around? ipd goes negative. when or down? goes zero. welcome stereo video. note there ways around this, you're not going them gopro without lot of special processing. @ best can sync idp direction averaged lens separation video streams, you'll stitching errors. equirectangular format (i.e square video) isn't best, you'll wrong answer @ poles. not using sphere how evolve (but it's simplest solution till better one)

javascript - BackboneJS : where to declare the function inside a view? -

i'm starting learn backbonejs. here code : var todoitem = backbone.model.extend({}); var todoitem = new todoitem({ description: 'pick milk', status: 'incomplete', id: 1 }); var todoview = backbone.view.extend({ render: function() { var html = '<h3>' + this.model.get('description') + '</h3>'; $(this.el).html(html); } }); var todoview = new todoview({ model: todoitem }); todoview.render(); console.log(todoview.el); but error : uncaught typeerror: expecting function in instanceof check, got undefined _.extend._setelement @ backbone.js:1233 _.extend.setelement @ backbone.js:1222 _.extend._ensureelement @ backbone.js:1302 backbone.view @ backbone.js:1170 child @ backbone.js:1831 (anonymous function) @ (index):28 what doing wrongly ? don't understand need create function it's waiting for. in backbone.js, _setelement used set this.$el , this

html - Nav menu "pulled left" using Bootstrap: submenu also pulled left -

i trying make navigation bar drop down menus. i've created navigation bar , used bootstraps "pull-left" class move left. dropdown menu have created using jquery moved left since html code contained in div marked "pull-left" have googled , tried out stuff few hours, couldn't quite find solution. the html navigation bar <div id = "nav"> <div class = "container" > <div class = "pull-left "> <img class = "logo-image" src = "logo2.png" /> </div> <ul class = "pull-left"> <li class "logo"><a href = "#">home</a></li> <li><a href = "#">about</a></li> <li> <a href = "#">projects</a> <ul> <li>&l

jsp - Using JSF as view technology of Spring MVC -

i implementing small spring mvc poc, , use jsf view technology since people in company used j2ee primefaces environment. does spring mvc 3 support jsf, or jsp? have read multiple articles mixing two. my need create appealing ui. there simple way using spring mvc jsp view technology? our application uses schedules/calendars in multiples pages. it's time management app you're making conceptual mistake. jsf not view technology. jsf mvc framework. spring mvc, albeit have both different ideology; jsf component based mvc , spring mvc request based mvc. full competitors. cannot mix them. should choose 1 or other. instead, jsp , facelets true view technologies. since java ee 6 (december 2009), jsp deprecated , replaced facelets (xhtml) default view technology jsf. you can use spring mvc jsp view technology . can use spring mvc facelets view technology (and many others ). can not use spring mvc jsf components let alone jsf component libraries primefaces. not makin

linux - How to Stop Node.js on Ubuntu and log out without stopping -

this question has answer here: how run node.js app background service? 23 answers i put node application on ubuntu server. started program using nodejs index.js now gives me "listening on *:3000" the problem ssh'd ubuntu server, cursor stuck under "listening" line. 1) how can close ssh session , leave node running? should have started node different user? 2) once close ssh session , node still running. how can stop node once ssh server? 3) ssh server , start run nodejs file, want other simple work unrelated sites on same server. since cursor stuck after "listening" line, how can go doing else? i suggest use screen program. screen terminal multiplexer, allows user access multiple separate terminal sessions inside single terminal window or remote terminal session (such when using ssh). it can started typing

Is it bad practice to dynamically create a variable from array to read a $_GET method in php -

going through php class file @ work found interesting snippet. script dynamically creating variable, dynamically checking if there active $_get[''] variable it's creating , if there it's loading $_get data , if it's not it's writing n/a variable it's dynamically creating. script continues on switch function same logic it's case breaks. 1.) safe? 2.) can attacked? 3.) there easier way this? 4.) why this? $switch_types = array("id","type","page"); foreach ($switch_types $key => $value) { $$value = $value; if(isset($_get[$$value])){ $$value = $_get[$$value]; } else{ $$value = "n/a"; } } this long-winded way write: $id = isset($_get['id']) ? $_get['id'] : 'n/a'; $type = isset($_get['type']) ? $_get['type'] : 'n/a'; $page = isset($_get['page']) ? $_get['page'] : 'n/a'; it

java - How to notify when a Camel seda queue is complete? -

the use case have zip file containing many csv files. each line in each file sent seda queue processing. problem i'm having i'd know when every line has been processed seda queue perform other work. i'm not sure how approach this. currently, i'm investigating using polling test when seda queue empty, produce false results if lines processed faster arrive. code i have class unzips zip file , reads each file inputstream . each line in file sent producer in turn sent seda queue. @component public class csvprocessor { @resource(name = "csvlineproducer") producertemplate producer; public void process(inputstream flatfilestream) throws ioexception { if (flatfilestream==null) return; try { lineiterator = ioutils.lineiterator(flatfilestream, "utf-8"); while (it.hasnext()) { final string recordline = it.nextline(); this.producer.send(new processor() {

javascript - How to style div with jQuery? -

<c:foreach items="${list}" var="item"> <div class="block" id="${item.id}" style="background: black"></div> </c:foreach> is possible style div depends on current item.id avoiding jsp <c:choose> <c:when test="${ item.num == 0}"> inside div when first load page? item.num can 1 or 0. need this: if(item.num==0){ style="background: black" }else{ style="background: transparant" } why not use ternary operator? no need jquery here... <c:foreach items="${list}" var="item"> <div class="block" id="${item.id}" style="background: ${item.num==0?'black':'white'}"></div> </c:foreach> update if want correctly, try avoid inline styles , add css class instead. can define styles in separate file. <c:foreach items="${list}" var="

javascript - How to find the number of positive and negative numbers are there on an input field? -

my question there 3 input text field , button, whatever user enters , press button, alert should how many negative numbers , how many positive numbers on text field? here working example code explained below. if want enter number in each of text field , click button tells number of positive , negative numbered entered here code, you html code, <input id="one" type="text"/> <input id="two" type="text"/> <input id="three" type="text"/> <input type="button" onclick="check();" value="check"> now can write script follows, function check(){ //converting values integer var x = parseint(document.getelementbyid("one").value); var y = parseint(document.getelementbyid("two").value); var z = parseint(document.getelementbyid("three").value); //initializing positive , negative count 0 var poscount = 0;

r - Use value in new variable name -

i trying build loop step through each site, site calculate frequencies of response, , put results in new data frame. after loop want able combine of site data frames like: site genus freq 1 50 1 b 30 1 c 20 2 70 2 b 10 2 c 20 but need names (of vectors, dataframes) change each time through loop. think can using sitenum variable, how insert new variable names? way tried (below) treats part of string, doesn't insert value name. i feel want use placeholder %, don't know how variable names. > sitenum <- 1 > (site in coralsites){ > csub_sitenum <- subset(dfrmc, site==coralsites[sitenum]) > cgrfreq_sitenum <- numeric(length(coralgenera)) > (genus in coralgenera){ > cgrfreq_sitenum[genusnum] <- mean(dfrmc$genus == coralgenera[genusnum])*100 > genusnum <- genusnum + 1 > } > names(cgrfreq_sitenum)

c++ - VS2013 integration with Intel Fortran Compiler -

i have several c++ codes develop in vs2013 professional. today, installed intel fortan compiler (composer xe2013 sp1), , none of c++ projects load. when open solution, see: myprojectname (load failed) the project requires user input. reload project more information if reload project, popup error reads: parameter "path" cannot null. any suggestions on how solve without reinstalling vs? thanks! a google search on error message tends suggest may if project on network drive. recommended solution right click on project (in solution explorer), select reload project, , respond prompts.

java - IME_ACTION_DONE seems to destroy the View.OnKeyListener on Android -

i have edittext view on relativelayout , , can capture soft input keyboard keycode keycode_enter (int 66) . key listener: myedittext.setonkeylistener(new view.onkeylistener() { @override public boolean onkey(view v, int keycode, keyevent event) { log.d("softinput", "key received!"); } }); the problem soft keyboard displays key labeled "next" , need display "done". when (successfully) change key "done" using api: myedittext.setimeoptions(editorinfo.ime_action_done); the key listener stops working , can no longer receive anything in key listener. logcat doesnt show anything. literally stops working. when remove above line of code, works again key displays "next". i guessing clearing other flag required notify keys, using editorinfo.ime_action_next works perfect, soft key, of course displays "next". anybody knows workaround this? or reasons why happens? thanks.

MYSQL Join table rows and use for php array -

i have multiple tables on specific database , each table similar each other. table: id series folder 1 naruto 670 2 naruto 671 3 naruto 672 each table has exact setup. series name changes. want pick 1 entry series row , highest number folder row. use data make php array , use json data. here code: 'select naruto.max(klasor), naruto.seri, one_piece.max(klasor), one_piece.seri, bleach.max(klasor), bleach.seri `naruto` inner join `one_piece` inner join `bleach on` limit 1' use group by clause like select id,series,max(folder) max_folder table1 group series

sorting - MySQL Order By Hierarchy -

i asked question previously two-layer tree , solution given worked perfectly. i have multi level tree (up 3, lets assume there more in future. my code looks this: select * fin_document finl left outer join fin_document finl2 on finl2.id = finl.parent_line_id order case when finl2.ordinal null finl.ordinal else concat(finl2.ordinal,'-',finl.ordinal) end lets assume similar tree before: (id) (item) (#) (parent_line_id) 1234 - car - 1 - null 0000 - boat - 2 - null 2222 - house - 4 - null 6545 - bike - 5 - null 6547 - wheels - 0 - 1234 4442 - bed - 1 - 2222 1474 - sink - 0 - 2222 9456 - tires - 0 - 6547 *new item, child of wheels 8975 - l.nuts - 1 - 6547 *new item, child of wheels oh , # column "ordinal" so how sort proper more 1 parent? the proper sort should like: (id) (item) (#) (parent_line_id) 1234 - car - 1 - null 6547 - wheels - 0 - 1234 9456 - tires - 0 -

r - Plotting with ggplot through calling another function -

i have function gets matrix 4 columns input. function plots boxplots using 2 columns of input matrix, fills them different color based on third column , plots points on each box based on fourth column show parameters. p1 <- ggplot(pl1, aes(x=factor(edge_n), y=get(make.names(y_label)), ymax=max(get(make.names(y_label)))*1.05))+ geom_boxplot(aes(fill=method), outlier.shape= na)+ theme(text = element_text(size=20), aspect.ratio=1)+ xlab("number of edges")+ ylab(y_label)+ scale_fill_manual(values=color_box)+ geom_point(aes(x=factor(edge_n), y=get(make.names(true_des)), ymax=max(get(make.names(true_des)))*1.05, color=method), position = position_dodge(width=0.75))+ scale_color_manual(values=color_pnt) finally @ end of function using print() function print on opened pdf. when run function line line works well, when call function function, not work , below error: error in make.names(true_des) : object 'true_des' not found actua