Posts

windows forms designer - C# Null reference exception and StreamReader -

i getting null reference exception when reading data txt file. public class appointments : list<appointment> { appointment appointment; public appointments() { } public bool load(string filename) { string appointmentdata = string.empty; using (streamreader reader = new streamreader(filename)) { while((appointmentdata = reader.readline()) != null) { appointmentdata = reader.readline(); //**this null ref. exception thrown** (line below) if(appointmentdata[0] == 'r') { appointment = new recurringappointment(appointmentdata); } else { appointment = new appointment(appointmentda...

java - ebean run ddl only if the database does not exist -

if have ddl.generate , ddl.run set true , drop database when restart app. if add ddl.createonly=true , throw out exception when create ebean server instance. question: is there anyway me "please create database if not exist, or don't if database created"? please create database if not exist no there not.

winforms - C# How to Move A Circle Along a Rectangle Path -

i need move point along rectangle path @ command of button. want start @ upper right corner of rectangle path, not sure how go way around path , stop @ original point. screen refreshes @ speed provided user in input box. thank in advance! using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.timers; namespace assignment_2 { public partial class form1 : form { private const int formwidth = 1280; private const int formheight = 720; private const int ball_a_radius = 10; private const int horizontaladjustment = 8; private const double ball_a_distance_moved_per_refresh = 1.6; private double ball_a_real_coord_x = 515; private double ball_a_real_coord_y = 40; private int ball_a_int_coord_x; private int ball_a_int_coord_y; privat...

javascript - Regex matching specific url -

i'm trying test if url wildcard @ end matches one. ^http?://(?:www\\.)?lichess\\.org/?.* is regex, want match http://en.lichess.org/e2kwzt0y , after .org/ should random. sorry inconvenience. try this: /(http:\/\/en\.lichess\.org\/)((?:[a-z][a-z0-9_]*))/i like this: var string = 'http://en.lichess.org/e2kwzt0y'; var match = string.match(/(http:\/\/en\.lichess\.org\/)((?:[a-z][a-z0-9_]*))/i); if(match && match.length){ console.log('match found'); }

jquery - Need help adding caption with arrow over a div on mouseover event -

regarding hover effect, pelase check site http://www.rokivo.com/ i want such effect include headings,buttons , div in mysite. thanks in advance <div class="col-xs-12"> <a href="enquiry.html"><h3 class="orange2 pull-right contact-head">enquiry<br/><i class="fa fa-arrow-right black arrow4 pull-left"></i></h3></a> </div> i used jquery add css transition class on mouseenter , remove class on mouseleave looks odd. want similar effect in referral url above. it sounds didn't want have arrow sliding infinitely removed infinite added longer arrow ( fa-long-arrow-right ) since mentioned "long arrow" in comments. i added forwards arrow stay @ end position of animation , not go beginning. animation-fill-mode .contact-head{ font-size:17px !important; padding:15px !important; border:2px solid #555 !important; border-bottom:5px solid #ffc000 !important; ...

javascript - Drawling normal distribution curve with mean and standard deviation in JS -

i have api when hit gives me mean , standard deviation. want generate mean distribution curve based on above 2 values. how can using javascript(d3.js). want curve generated different values of mean , sigma. mean fitting curve should generated irrespective of mean , sigma api. there equations calculating normal distribution given mean , standard deviation. wikipedia page normal distribution shows density function, want. so you'll want generate function based on mean , variance (standard deviation squared) returned api, generate points using function , chart them using d3.js.

Missing END - Mysql Stored Procedure -

i used writing in tsql , mysql taking adjusting think getting of it. have 1 stored procedure not budge, have read , re-read 100 times, read can find on error , still no luck. on line 11 , end of statement: create temporary table returnavalrooms (roomid int); i error "missing end" though @ beginning of query. have checked , double checked declared , set appropriate ; can't figure out why getting error. below full copy of stored procedure. create procedure `get_availrooms` (in startdate datetime, in enddate datetime, in roomtype int) begin declare pstartdate datetime; declare penddate datetime; declare proomtype int; set pstartdate = startdate; set penddate = enddate; set proomtype = roomtype; create temporary table avaliablenowrooms (select idrooms rooms roomnextavail < pstartdate , roomtypeid = proomtype); create temporary table returnavalrooms (roomid int); declare availrooms cursor select * avaliableno...