Search Results

Search found 1863 results on 75 pages for 'matt fordham'.

Page 41/75 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Regular Expression Help in .NET

    - by Matt H.
    I have a simple pattern I am trying to match, any characters captured between parenthesis at the end of an HTML paragraph. I am running into trouble any time there is additional parentheticals in that paragraph: i.e. If the input string is "..... (321)</p" i want to get the value (321) However, if the paragraph has this text: "... (123) (321)</p" my regex is returning "(123) (321)" (everything between the opening "(" and closing ")" I am using the regex pattern "\s(.+)</p" How can I grab the correct value (using VB.NET) This is what I'm doing so far: Dim reg As New Regex("\s\(.+\)</P>", RegexOptions.IgnoreCase) Dim matchC As MatchCollection = reg.Matches(su.Question) If matchC.Count > 0 Then Dim lastMatch As Match = matchC(matchC.Count - 1) Dim DesiredValue As String = lastMatch.Value End If

    Read the article

  • If I can ping my DB server, is my SQL Server connection guaranteed to work?

    - by Matt
    If I can ping my DB server, is my SQL Server connection guaranteed to work? I am using a default connection string in my code. My program runs fine locally but overseas sites are having issues and I am wondering if SQL might be using a TCP or UDP port that is still blocked. Here is the connection string "Data Source=xxxx.xxxx.com; Initial Catalog = xxxxx; User ID=xxxxx;password=xxxxx"

    Read the article

  • JPanel Appears Behind JMenuBar

    - by Matt H
    import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; @SuppressWarnings("serial") public class Main extends JFrame { final int FRAME_HEIGHT = 400; final int FRAME_WIDTH = 400; public static void main(String args[]) { new Main(); } public Main() { super("Game"); GameCanvas canvas = new GameCanvas(); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenuItem startMenuItem = new JMenuItem("Pause"); menuBar.add(fileMenu); fileMenu.add(startMenuItem); super.setVisible(true); super.setSize(FRAME_WIDTH, FRAME_WIDTH); super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); super.setJMenuBar(menuBar); } } import java.awt.Canvas; import java.awt.Graphics; import javax.swing.JPanel; @SuppressWarnings("serial") public class GameCanvas extends JPanel { public void paint(Graphics g) { g.drawString("hI", 0, 0); } } This code causes the string to appear behind the JMenuBar. To see the string, you must draw it at (0,10). I'm sure this must be something simple, so do you guys have any ideas?

    Read the article

  • Why does a function that takes IEnumerable<interface> not accept IEnumerable<class>?

    - by Matt Whitfield
    Say, for instance, I have a class: public class MyFoo : IMyBar { ... } Then, I would want to use the following code: List<MyFoo> classList = new List<MyFoo>(); classList.Add(new MyFoo(1)); classList.Add(new MyFoo(2)); classList.Add(new MyFoo(3)); List<IMyBar> interfaceList = new List<IMyBar>(classList); But this produces the error: `Argument '1': cannot convert from 'IEnumerable<MyFoo>' to 'IEnumerable<IMyBar>' Why is this? Since MyFoo implements IMyBar, one would expect that an IEnumerable of MyFoo could be treated as an IEnumerable of IMyBar. A mundane real-world example being producing a list of cars, and then being told that it wasn't a list of vehicles. It's only a minor annoyance, but if anyone can shed some light on this, I would be much obliged.

    Read the article

  • WPF ListView.CurrentChanged too fast for binding

    - by matt
    My case: MVVM ListView+Details(custom UserControl) List bound to MV.Items (IsSynchronizedWithCurrent=true) Details bound to MV.Items.Current MV.Items.Count == 100 about 0.2sec to read details (lazy mode) When I hold the down arrow on the list, very strange things happen: list items order change current changes in the random order CPU usage drastically increments and eventually all hangs. I've read some post that one should start the timer or run handler in the background, but I am not able to do that, since all the binding WPF does for me. Is there some way to instruct the binding in my DetailsControl, to wait a while before accepting CurrentItem? Or should I just resign from the clean solution and write custom code in my MV to handle that?

    Read the article

  • What should every programmer know?

    - by Matt Lacey
    Regardless of programming language(s) or operating system(s) used or the environment they develop for, what should every programmer know? Some background: I'm interested in becoming the best programmer I can. As part of this process I'm trying to understand what I don't know and would benefit me a lot if I did. While there are loads of lists around along the lines of "n things every [insert programming language] developer should know", I have yet to find anything similar which isn't limited to a specific language. I also expect this information to be of interest and benefit to others.

    Read the article

  • Grails validation problems with sets of data: only getting one error message for all errors in a set

    - by Matt
    Hi, I'm trying to validate a domain class that has a number of subsets. class IebeUser { ... static hasMany = [openUserAnswers:OpenUserAnswer, closedUserAnswers:ClosedUserAnswer] } class OpenUserAnswer { OpenQuestion openQuestion String text static belongsTo = [user:IebeUser] static constraints = { openQuestion(nullable:false) text(blank:false) } } class ClosedUserAnswer { ClosedQuestion closedQuestion ClosedAnswer answer static belongsTo = [user:IebeUser] static constraints = { closedQuestion(nullable:false) answer(nullable:false) } } A closed question has a set of predefined answers and an open question lets the user enter a freeform answer. All is well until I come to validate the object after entry in a form: params: [closedUserAnswers[0].answer.id:, closedUserAnswers[0]:[answer:[id:], answer.id:], password:dfgdfgdf, openUserAnswers[0].text:gdfgdfgdfg, openUserAnswers[0]:[text:gdfgdfgdfg], _isOptedOut:, create:Continue, username:gdfgdfggdf, email:[email protected], closedUserAnswers[1].answer.id:, closedUserAnswers[1]:[answer:[id:], answer.id:], openUserAnswers[1].text:, openUserAnswers[1]:[text:], firstName:dfgdf, lastName:gdfgdfgd, action:save, controller:main] The key bits being: closedUserAnswers[0].answer.id:, closedUserAnswers[0]:[answer:[id:] closedUserAnswers[1].answer.id:, closedUserAnswers[1]:[answer:[id:] openUserAnswers[1].text:, openUserAnswers[1]:[text:] In my tests I have two objects of type closedUserAnswers and two of openUserAnswers. But when I call validation on IebeUser I only get validation errors for the closedUserAnswers or the openUserAnswers as a whole. I don't get validation errors for each object with a problem which is what I need. I really need an error per instance. Does anyone know what I'm doing wrong? Even when I call the validate method against each closedUserAnswer/openUserAnswer I still only get one per type. Here are my errors. Sorry for all the code, but thought I'd include as much of the code as possible so that it makes sense. Field error in object 'uk.co.cascaid.iebe.IebeUser' on field 'openUserAnswers.text': rejected value []; codes [uk.co.cascaid.iebe.OpenUserAnswer.text.blank.error.uk.co.cascaid.iebe.IebeUser.openUserAnswers.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.error.openUserAnswers.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.error.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.error,openUserAnswer.text.blank.error.uk.co.cascaid.iebe.IebeUser.openUserAnswers.text,openUserAnswer.text.blank.error.openUserAnswers.text,openUserAnswer.text.blank.error.text,openUserAnswer.text.blank.error,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.uk.co.cascaid.iebe.IebeUser.openUserAnswers.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.openUserAnswers.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank.text,uk.co.cascaid.iebe.OpenUserAnswer.text.blank,openUserAnswer.text.blank.uk.co.cascaid.iebe.IebeUser.openUserAnswers.text,openUserAnswer.text.blank.openUserAnswers.text,openUserAnswer.text.blank.text,openUserAnswer.text.blank,blank.uk.co.cascaid.iebe.IebeUser.openUserAnswers.text,blank.openUserAnswers.text,blank.text,blank]; arguments [text,class uk.co.cascaid.iebe.OpenUserAnswer]; default message [Property [{0}] of class [{1}] cannot be blank] Field error in object 'uk.co.cascaid.iebe.IebeUser' on field 'closedUserAnswers.answer': rejected value [null]; codes [uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.error.uk.co.cascaid.iebe.IebeUser.closedUserAnswers.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.error.closedUserAnswers.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.error.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.error,closedUserAnswer.answer.nullable.error.uk.co.cascaid.iebe.IebeUser.closedUserAnswers.answer,closedUserAnswer.answer.nullable.error.closedUserAnswers.answer,closedUserAnswer.answer.nullable.error.answer,closedUserAnswer.answer.nullable.error,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.uk.co.cascaid.iebe.IebeUser.closedUserAnswers.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.closedUserAnswers.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable.answer,uk.co.cascaid.iebe.ClosedUserAnswer.answer.nullable,closedUserAnswer.answer.nullable.uk.co.cascaid.iebe.IebeUser.closedUserAnswers.answer,closedUserAnswer.answer.nullable.closedUserAnswers.answer,closedUserAnswer.answer.nullable.answer,closedUserAnswer.answer.nullable,nullable.uk.co.cascaid.iebe.IebeUser.closedUserAnswers.answer,nullable.closedUserAnswers.answer,nullable.answer,nullable]; arguments [answer,class uk.co.cascaid.iebe.ClosedUserAnswer]; default message [Property [{0}] of class [{1}] cannot be null]

    Read the article

  • Problems with Ajax Chat version .8.3

    - by Matt
    I am not sure why, but my Ajax Chatroom ever once in awhile (once time ever other day on average I'd say), displays an connection error 503. Now doing some digging apparently 503 is an error for exceeding max connections, and the typical fix is increasing your limit to something like 400 but my max connections is already set to 1500. That being said I would love some help on the issue as I cannot find any further info on it.

    Read the article

  • SQL where clause to work with Group by clause after performing a count()

    - by Matt
    Tried my usual references at w3schools and google. No luck I'm trying to produce the following results. QTY is a derived column | Position | QTY -------------------- 1 Clerk 2 2 Mgr 2 Here's what I'm not having luck with: SELECT Position, Count(position) AS 'QTY' FROM tblemployee Where ('QTY' != 1) GROUP BY Position I know that my Position is set up as varchar(255) Count produces a integer data and my where clasue is accurate so that leads me to believe that that Count() is jamming me up. Please throw up an example so I can reference later. Thanks for the help!

    Read the article

  • My PHP login no longer works

    - by Matt Clayton
    This page worked like a charm for years... enter the correspondng user id and password and you would be redirected to your directory. Now suddenly, all attempts to log in - valid or otherwise - result in the page remaining static... no message, no redirect, nothing. Nothing in the code has changed, it just plain doesn't work anymore. Could this be the result of some kind of change on the server side? Yeah, I know it's not super secure, but it was good enough for our purposes. I'm certainly open to better suggestions. I just need it to work... and keep working. Please be gentle! I know almost nothing of programming. Here is the page code: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <link href="ilium.css" rel="stylesheet" media="screen"> <title>Ilium: Client Login</title> </head> <body bgcolor="#bfbfcc" background="img/loginbg.gif"> <?php /* init vars */ $userExists = false; $userIndex = -1; $authenicated = false; /*********************************************** * edit this to add new users/password * * - add user/pass/directory to the array * * below: must be in same array index to work * ***********************************************/ $user = array('foo', 'bar'); $pass = array('foo', 'bar'); $directory = array('foo', 'bar'); // run user/pass check if data passed if (isset($username) && isset($password)) { // check if user name exists for ($i = 0; $i < count($user); $i++) { if ($user[$i] == $username) { $userExists = true; $userIndex = $i; break; } } // so user exists, now test password if ($userExists) { $message = $message . "Username Valid<br>\n"; if ($pass[$userIndex] == $password) { $authenicated = true; $link = "/incoming/clients050203/" . $directory[$userIndex] . "/"; $message = $message . "Password Valid - Redirecting to your folder...<br>\n"; } else { $message = $message . "Incorrect Password<br>\n"; } } else { $message = $message . "Incorrect User Name<br>\n"; } } ?> <?php // user has been authenicated - move them to the correct directory if ($authenicated) { echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=" . $link . "\">"; } ?> <img src="img/spacer.gif" alt="" width="1" height="112" border="0"> <form action="login.php" method="post"> <table width="496"> <tr> <td width="100"></td> <td colspan="4" width="469"><img src="img/please.gif" alt="" width="469" height="19" border="0"></td> </tr> <tr> <td width="100"><img src="img/spacer.gif" alt="" width="100" height="1" border="0"></td> <td width="227"> <img src="img/spacer.gif" alt="" width="227" height="1" border="0"><br> </td> <td align="right" valign="top" width="84"><input type="text" name="username" size="12"><br></td> <td width="43"><img src="img/spacer.gif" alt="" width="43" height="1" border="0"><br> <br> </td> <td align="right" valign="top" width="109"><input type="password" name="password" size="16"> <p><br> </p> </td> </tr> <tr> <td width="100"></td> <td valign="top" width="227"><div class="messages"><?=$message?></div></td> <td width="84"><br> </td> <td width="43"><br> </td> <td align="right" width="109"><input type="image" src="img/enter.gif" ALT="enter"><br> <br> <br> <br> <br> </td> </tr> </table> </form> </body> </html>

    Read the article

  • Can jQuery add commas while user typing numbers?

    - by Matt
    How would I go about dynamically adding commas as a user is entering numbers? Is there a good number formatter that would help? I have to add these numbers later so I eventually have to remove the commas down the line. But the screen needs to show the commas for better readability.

    Read the article

  • iPhone SDK reload UIView's content

    - by Matt S.
    I have two views, one view takes the whole screen, the second view covers only a little portion. What I want is for that second view to be on the first view (which I already have done), but the problem is, when I set values (in this case UILabel's) the label on the screen doesn't display that new value. I know for a fact the method gets called, but for some reason it won't change the label's value.

    Read the article

  • Android: Determine when app is being finalized

    - by Matt
    Hi all, I posted a question yesterday about determining when an app is being finalized vs destroyed for screen orientation change. Thanks to the answers I received I was able to resolve my problem with the screen orientation change. However, I am still running into a roadblock. This app I am working on logs into a website with an HttpClient. As long as the app remains in memory the HttpClient will retain the cookies from logging in. However, once it is killed, it would need to log in again. My question: How can I determine when the app is being killed from memory so I can set a boolean to false telling the app it has been removed from memory so the next time it starts it will read this and determine is must log in again? Or is it possible to serialize an HttpClient and put that in the savedInstanceState bundle? May extract the cookies from the client and put those in the savedInstanceState bundle? Is there something I'm completely missing here maybe? Any help or a point in the right direction is greatly appreciated because this one has me stumped. Thank you!

    Read the article

  • Avoiding display of Visual Studio Debugger when starting a new process from within java.exe

    - by Matt Sheppard
    How can I, from within a java program on windows, prevent a debugger window being displayed if a program I invoke crashes, and how can I detect the fact that it has crashed? Background I have a problem with a java application running on Windows which is launching an unreliable third party program by way of ProcessBuilder.start(). Specifically, if the external program crashes, the 'Visual Studio Just-In-time Debugger' window pops up asking if the user wants to debug the program. From the java application side, I'm happy to deal with the fact that under some circumstances, the third party program will crash, but I'd like to be able to detect and silently handle that situation from within the Java code without requiring any user interaction.

    Read the article

  • Numeric comparison difficulty in R

    - by Matt Parker
    I'm trying to compare two numbers in R as a part of a if-statement condition: (a-b) >= 0.5 In this particular instance, a = 0.58 and b = 0.08... and yet (a-b) >= 0.5 is false. I'm aware of the dangers of using == for exact number comparisons, and this seems related: (a - b) == 0.5) is false, while all.equal((a - b), 0.5) is true. The only solution I can think of is to have two conditions: (a-b) > 0.5 | all.equal((a-b), 0.5). This works, but is that really the only solution? Should I just swear off of the = family of comparison operators forever?

    Read the article

  • Problems finding classes in namespace

    - by Matt
    I am trying to find all of the types in the Models namespace within an ASP.NET MVC assembly from within a testing assembly. I was trying to use LINQ to find the relevant set for me but it is returning an empty set on me. I am sure it is some simple mistake, I am still relatively new to LINQ admittedly. var abstractViewModelType = typeof (AbstractViewModel); var baseAssembly = Assembly.GetAssembly(abstractViewModelType); var modelTypes = baseAssembly.GetTypes() .Where(assemblyType => (assemblyType.Namespace.EndsWith("Models") && assemblyType.Name != "AbstractViewModel")) .Select(assemblyType => assemblyType); foreach(var modelType in modelTypes) { //Assert some things } When I reach the foreach I receive a Null reference exception.

    Read the article

  • Non-Relational DBMS Design Resources

    - by Matt Luongo
    Hey guys, As a personal project, I'm looking to build a rudimentary DBMS. I've read the relevant sections in Elmasri & Navathe (5ed), but could use a more focused text. The rub is that I want to play with novel non-relational data models. While a lot of E&N was great- indexing implementation details in particular- the more advanced DBMS implementation was only targeted to a relational model. I could also use something a bit more practical and detail-oriented, with real-world recommendations. I'd like to defer staring at DBMS source for a while if I can. Any ideas?

    Read the article

  • Need to find latitude and longitude of postcodes and store into my database

    - by Matt
    Hey guys, Ive got a database full of UK Postcodes, now i'd like to be able to store the latitude and longitude of these specific postcodes along with the record with the database. Is there anyway that i can obtain this data free without violating any T&C's? I know i could do this using google maps api for each postcode, but i have way over 20,000 postcodes in this database and to get the lat and lng for each of these postcodes each time is not an option really. Thanks in advance, M

    Read the article

  • Windows Phone 7, MVVM, Silverlight and navigation best practice / patterns and strategies

    - by Matt F
    Whilst building a Windows Phone 7 app. using the MVVM pattern we've struggled to get to grips with a pattern or technique to centralise navigation logic that will fit with MVVM. To give an example, everytime the app. calls our web service we check that the logon token we've assigned the app. earlier hasn't expired. We always return some status to the phone from the web service and one of those might be Enum.AuthenticationExpired. If we receive that I'd imagine we'd alert the user and navigate back to the login screen. (this is one of many examples of status we might receive) Now, wanting to keep things DRY, that sort of logic feels like it should be in one place. Therein lies my question. How should I go about modelling navigation that relies on (essentially) switch or if statements to tell us where to navigate to next without repeating that in every view. Are there recognised patterns or techniques that someone could recommend? Thanks

    Read the article

  • Potential for SQL injection here?

    - by Matt Greer
    This may be a really dumb question but I figure why not... I am using RIA Services with Entity Framework as the back end. I have some places in my app where I accept user input and directly ask RIA Services (and in turn EF and in turn my database) questions using their data. Do any of these layers help prevent security issues or should I scrub my data myself? For example, whenever a new user registers with the app, I call this method: [Query] public IEnumerable<EmailVerificationResult> VerifyUserWithEmailToken(string token) { using (UserService userService = new UserService()) { // token came straight from the user, am I in trouble here passing it directly into // my DomainService, should I verify the data here (or in UserService)? User user = userService.GetUserByEmailVerificationToken(token); ... } } (and whether I should be rolling my own user verification system is another issue altogether, we are in the process of adopting MS's membership framework. I'm more interested in sql injection and RIA services in general)

    Read the article

  • Cross field validation in jsf h:datatable using p:calendar

    - by Matt Broekhuis
    I noticed this question was asked, but it has not been answered correctly. I have a datatable that has two columns start date and end date. Both contain primefaces p:calendar controls in them. I need to ensure that for each row that the date in column1 is not after the date in column2. I would like to tie this into the JSF validation framework, but I'm having trouble. i've tried marking the datatable rowStatePreserved="true" , this allows me to get the values, but something is still wrong as when it fails, all the values in the first row overwrite all the other values. What am I doing wrong, or should I be using a completely different strategy? xhtml code <h:form> <f:event type="postValidate" listener="#{bean.doCrossFieldValidation}"/> <p:dataTable id="eventDaysTable" value="#{course.courseSchedules}" var="_eventDay" styleClass="compactDataTable" > <p:column id="eventDayStartColumn"> <f:facet name="header"> Start </f:facet> <p:calendar id="startDate" required="true" value="#{_eventDay.startTime}" pattern="MM/dd/yyyy hh:mm a"/> </p:column> <p:column id="eventDayEndColumn"> <f:facet name="header"> End </f:facet> <p:calendar id="endDate" required="true" value="#{_eventDay.endTime}" pattern="MM/dd/yyyy hh:mm a"/> </p:column> </p:dataTable> </h:form> validationCode public void doCrossFieldValidation(ComponentSystemEvent cse) { UIData eventsDaysStable = (UIData) cse.getComponent().findComponent("eventDaysTable"); if (null != eventsDaysStable && eventsDaysStable.isRendered()) { Iterator<UIComponent> startDateCalendarIterator = eventsDaysStable.findComponent("eventDayStartColumn").getChildren().iterator(); Iterator<UIComponent> endDateCalendarIterator = eventsDaysStable.findComponent("eventDayEndColumn").getChildren().iterator(); while (startDateCalendarIterator.hasNext() && endDateCalendarIterator.hasNext()) { org.primefaces.component.calendar.Calendar startDateComponent = (org.primefaces.component.calendar.Calendar) startDateCalendarIterator.next(); org.primefaces.component.calendar.Calendar endDateComponent = (org.primefaces.component.calendar.Calendar) endDateCalendarIterator.next(); Date startDate = (Date) startDateComponent.getValue(); Date endDate = (Date) endDateComponent.getValue(); if (null != startDate && null != endDate && startDate.after(endDate)) { eventScheduleChronologyOk = false; startDateComponent.setValid(false); endDateComponent.setValid(false); } } if (!eventScheduleChronologyOk) { showErrorMessage(ProductManagementMessage.PRODUCT_SCHEDULE_OUT_OF_ORDER); } } }

    Read the article

  • PHP: require_once library -> failed to open stream

    - by matt
    I might be a bit confused and may need your help with this. I'm inside inc/newsletter.php and want to include a library that is inside lib/mailchimp-api-class How do I refer to this class file? I thought it should be … require_once '../lib/mailchimp-api-class/MCAPI.class.php'; However, this doesn't work …  Warning: require_once(../lib/mailchimp-api-class/MCAPI.class.php) [function.require- once]: failed to open stream: No such file or directory in /Users/myname/htdocs/wr/ wp-content/themes/mytheme/inc/newsletter.php on line 6

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >