Posts

C# how do I read an mdb(MS Access) file then pass in the retrieved columns selected in an array for later use? -

how read mdb file pass in retrieved columns selected in array? basically, trying retrieve items match 2 specified criteria columns save last column in array. i have printed results correct per 2 criterias them being qdc , qpl when printing them how save last row later use in array. var list = new list<mydata>(); while (true) { while (reader.read()) { var data = new mydata { columnone = reader.getstring(0), columntwo = reader.getstring(1), columnthree = reader.getstring(2), columnfour = reader.getstring(3), columnfive = reader.getstring(4), }; list.add(data); console.writeline(""); foreach (var row in list) { console.writeline("start here"); console.writeline(row.columnone); console.writeline(row.columntwo); console.writeline(row.columnt...

javascript - onScroll event called multiple times -

i want load more content when user scrolls webpage. tried using onscroll event javascript getting called multiple times jquery .scroll() method called multiple times. how handle this? browser issue? note: calling onscroll = "function()" on body tag of html. load content while scrolling: http://www.webresourcesdepot.com/load-content-while-scrolling-with-jquery/

read eval print loop - How do I access scala documentation from the repl? -

first of built in docs, , own code. specifically, want information similar how in python can call help() on method or object information on object printed repl. scaladocs generated html, don't want them appearing in repl window. might want load docs in browser repl, however. can creating own method (this 1 takes instance; have take instance of class[a] instead, if prefer): def viewdoc[a](a: a) { val name = a.asinstanceof[anyref].getclass.getname val url = "http://www.scala-lang.org/api/current/index.html#"+name val pb = new processbuilder("firefox",url) val p = pb.start p.waitfor } if want extra-clever, parse name point web browser @ javadocs java classes , scaladocs scala classes , wherever have documentation classes. want use local source, file:///my/path/to/docs/index.html# instead of api web. used can try out scala> viewdoc(some(1))

MySQL Conditional Select -

i've been trying night following query work: select user.username, user.email, user.id, user.last_mail, us.24hr wine_users user, wine_subscriptions sub, wine_user_settings user.id = sub.user_id , us.id = user.id , sub.wine1 = 'yes' , user.receive_mail = 'yes' , if(24hr = 'yes') user.last_mail >= date_sub (user.last_mail interval 1 day) basically, have 3 tables, containing username ( wine_users ), subscriptions ( wine_subscriptions ) , user settings( user_settings ) what want select users have either selected no in us.24hr or have selected yes in us.24hr (stored enum 'yes' 'no' in us.24hr) , have not received e-mail in last 24 hours (this stored timestamp in user.lastmail) any stop me tearing out own brain through left nostril! :) thanks :) seb wow! guys great! :) tried of suggestions, return following error: 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near ...

objective c - Get XML from NSWebView -

i have nswebview in there loaded xml data. cannot stringbyevaluatingjavascriptfromstring because javascript doesn't want work xml. how hell supposed it? why annoying difficult simple? creating xml url won't work. how xml nswebview nsstring? do need use webview? i'd suggest grabbing data itself: nsstring *content = [nsstring stringwithcontentsofurl:[nsurl urlwithstring:@"example.com"]];

How do I track changes of an instance variable outside of the class in Ruby? -

i new ruby , building program works interactive orchard, user input type of tree want grow , give commands water, prune, pick , harvest tree. the problem having when try have program ask commands until tree dies occurs @ height. height defined in instance variable inside class, , can't seem figure out how have program track variable outside of class, keeps prompting command until value achieved. the below code start , end of code, not middle parts seem working fine. each of commands @ bottom work once, program ends. appreciated. class orangetree def initialize name @name = name @height = 0 @branches = 0 @winter = false @orangesontree = 0 @orangesinbasket = 0 @timeofyear = 0 puts @name + 'just sprouted! him?' end puts 'welcome orchard! grow today?' reply = gets.chomp while reply != 'oranges' puts 'i sorry, not have kind of tree, try again' gets.chomp end oranges = orangetree.new 'woody ' while orangetree |@height| <= 61 ...

c# - How can I know if a non-required RenderSection exists? -

@* omitted code.. *@ @renderbody() @rendersection("sidebar", required: false) is there way know in omitted code part if rendersection sidebar exists or not? @if (issectiondefined("sidebar")) { @rendersection("sidebar") } else { <div>some default content</div> }