Search Results

Search found 3380 results on 136 pages for 'tim b james'.

Page 90/136 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Best way to determine variable type and treat each one differently in F#

    - by James Black
    I have a function that will create a select where clause, but right now everything has to be a string. I would like to look at the variable passed in and determine what type it is and then treat it properly. For example, numeric values don't have single quotes around them, option type will either be null or have some value and boolean will actually be zero or one. member self.BuildSelectWhereQuery (oldUser:'a) = let properties = List.zip oldUser.ToSqlValuesList sqlColumnList let init = false, new StringBuilder() let anyChange, (formatted:StringBuilder) = properties |> Seq.fold (fun (anyChange, sb) (oldVal, name) -> match(anyChange) with | true -> true, sb.AppendFormat(" AND {0} = '{1}'", name, oldVal) | _ -> true, sb.AppendFormat("{0} = '{1}'", name, oldVal) ) init formatted.ToString() Here is one entity: type CityType() = inherit BaseType() let mutable name = "" let mutable stateId = 0 member this.Name with get() = name and set restnameval=name <- restnameval member this.StateId with get() = stateId and set stateidval=stateId <- stateidval override this.ToSqlValuesList = [this.Name; this.StateId.ToString()] So, if name was some other value besides a string, or stateId can be optional, then I have two changes to make: How do I modify ToSqlValuesList to have the variable so I can tell the variable type? How do I change my select function to handle this? I am thinking that I need a new function does the processing, but what is the best FP way to do this, rather than using something like typeof?

    Read the article

  • Building a simple cart using object orientated PHP

    - by James
    I've built basic shopping carts with PHP before but in an attempt to get my feet wet with OOP, I'd like to try using that method. I come from a design background but do understand some basics of OOP but would like to see a tutorial or something simple I could base this on. The site is small and the cart functionality required is very standard. Can anyone offer a link to a decent tutorial or article on building a Cart with PHP OOP, a quick google didn't turn up anything decent.

    Read the article

  • Visual Studio breaks, and steps, but sometimes steps out

    - by James Wilkins
    Something very odd is going on. It's been going on for some time, but I've just ignored it up to now. I have both a Silverlight and WCF service in my solution, which shares .CS file between them (one project has a link to the file, which exists in the other project). While debugging the Silverlight app, pressing the F10 key steps through code as normal, and when I get to a method call which exists in the shared file (between the projects), and Press F11, it simply skips the method instead of stepping into it (and yes, the "Just My Code" option is not checked). If I put a breakpoint in the method I'm trying to get into, it works fine (as in the debugger will break on the line), but as soon as I step (F10) it exits the method (and with F11 [step into] also). Ok, on first thought, you might think it's to do with the link, but no, it isn't. I tried removing the link and using a copy instead, but the same thing happens. And no, it's not the debug symbols, I looked into that already. The method I'm trying to step through is static, and is in a non-static partial class, in a file shared by both projects. My guess: The same types and static methods exist in the WCF and Silverlight ... would the debugger get confused?

    Read the article

  • Can I get debug symbols for flash player? Or any other way to get support for flash?

    - by Tim
    The company I am working for has a flash component (using flex and cs4) that crashes intermittently in chrome, FF and IE. (so far only win32 platforms) I submitted a bug report to Adobe but have not heard anything back from them. Their support process seems like a black hole. WE can get a dump from Flash using these steps but after submitting the bug we got no help at all. We loaded this into MS visual studio but can;t get decent stack information because there are no symbols for the flash stuff. Microsoft and other companies provide symbols to help with debugging and we would like to get that from adobe. Is there any way to make progress on this? Does anyone know where to get flash symbols or how else we can make progress? It is hard to debug the process if the container just dies. the binary is flash10c.ocx I just spent a painful hour on the phone with adobe folks - and the final answer from one of them (I spoke to about 8 people) was that they do not have a per incident purchase plan for developer support for flash. I find that hard to believe. Does anyone know how to get support for Flash?

    Read the article

  • How to obtain specific Excel object library without the corresponding Office version installed.

    - by james-h-l
    I am developing a Excel automation app that read and write to Excel spreadsheet. I have Office 2007 installed on my machine. I therefore can reference the Excel 12.0 Object Library and the Excel 5.0 Object Library. I don't want to use Excel 5.0 because it's really quite old and poorly documented. Therefore I'm referencing Excel 12.0. However the target machine have Office 2003 installed and therefore only have Excel 11.0. So when I compile my program it crashes on the target machine since the referenced library are different. I was wondering is there a way I could obtain the Excel 11.0 without installing Office 03? I tried to find answers from msdn and microsoft support page but couldn't find anything? This is quite strange since it could also happen in the future where developers has newer editions of Office than clients?

    Read the article

  • Regular expressions and matching URLs with metacharacters

    - by James P.
    I'm having trouble finding a regular expression that matches the following String. Korben;http://feeds.feedburner.com/KorbensBlog-UpgradeYourMind?format=xml;1 One problem is escaping the question mark. Java's pattern matcher doesn't seem to accept \? as a valid escape sequence but it also fails to work with the tester at myregexp.com. Here's what I have so far: ([a-zA-Z0-9])+;http://([a-zA-Z0-9./-]+);[0-9]+ Any suggestions? Edit: The original intent was to match all URLs that could be found after the first semi colon.

    Read the article

  • C / JSON Library in popular Linux distros?

    - by Tim Post
    I have a program written in C that has to input and output JSON over a local domain socket. I've found several C / JSON libraries that 'almost work' through searches. Prior to taking one of the libraries that I found .. I want to be sure that I'm not over-looking a library that is commonly found on modern Linux distros. I'd also really appreciate links to libraries that you use. Most likely, I'll just drop it in tree, unless I realize that I've over looked something widely distributed. I am tagging this as subjective because the answer that I select is the one linking to a library that works for me, that does not mean its the 'best' library. I want to take an existing array and easily convert it to a buffer that can be sent, or take a buffer and easily convert it into an allocated array. Thanks in advance!

    Read the article

  • Carbon, LSUIElement, and showing a window

    - by James Turner
    I have a Carbon LSUIElement application, which runs in the background (possibly with an icon in the menubar, depending on a pref) and occasionally needs to show a dialog to the user - sometimes in response to a user event, but sometimes in response to a background task failing or similar. (I'm using Qt 4.5, so the application is Carbon based; With Qt 4.6 things will be Cocoa based, but it sounds as if the problem may exist there too). The problem is that when I open a window, and show it, it doesn't get brought to the front. I assume this is an artefect of being an LSUIElement app. Qt uses SelectWindow in Carbon, and [makeKeyAndOrderFront] in Cocoa, to bring a window (and the app) to the front. To work around the problem, I tried going direct to the window server: (the first few steps are to get the WindowID, this will be simpler with Qt-Cocoa, since I can use NSWindow:nativeWindow) WindowRef ref = HIViewGetWindow((HIViewRef) aWidget->winId()); CGSWindow wid = GetNativeWindowFromWindowRef(ref); CGSConnection cid =_CGSDefaultConnection(); CGSOrderWindow(cid, wid, 1 /* above everything */, 0 /* NULL */); This works, sort of - the window comes to the front, but it's not highlighted or keyboard focused. Are there additional steps to fix those issues, or is there a simpler solution to the whole problem?

    Read the article

  • Should I Use Anchor, Button Or Form Submit For "Follow" Feature In Rails

    - by James
    I am developing an application in Rails 3 using a nosql database. I am trying to add a "Follow" feature similar to twitter or github. In terms of markup, I have determined that there are three ways to do this. 1) Use a regular anchor. (Github Uses This Method) <a href="/users/follow?target=Joe">Follow</a> 2) Use a button. (Twitter Uses This Method) <button href="/friendships/create/">Follow</button> 3) Use a form with a submit button. (Has some advantages for me, but I haven't see anyone do it yet.) <form method="post" id="connection_new" class="connection_new" action="/users/follow"> <input type="hidden" value="60d7b563355243796dd8496e17d36329" name="target" id="target"> <input type="submit" value="Follow" name="commit" id="connection_submit"> </form> Since I want to store the user_id in the database and not the username, options 1 and 2 will force me to do a database query to get the actual user_id, whereas option 3 will allow me to store the user_id in a hidden form field so that I don't have to do any database lookups. I can just get the id from the params hash on form submission. I have successfully got each of these methods working, but I would like to know what is the best way to do this. Which way is more semantic, secure, better for spiders, etc...? Is there a reason both twitter and github don't use forms to do this? Any guidance would be appreciated. I am leaning towards using the form method since then I don't have to query the db to get the id of the user, but I am worried that there must be a reason the big guys are just using anchors or buttons for this. I am a newb so go easy on me if I am totally missing something. Thanks!

    Read the article

  • how to deploy jboss app over the internet

    - by james mccvoy
    I am using JBOSS 7 AS. I am deploying the projects via the linux box by the cmd like so bin/standalone.sh -b [ipaddress] This works fine only when i am on the network, however it doesn't work when i'm outside the network or over the internet. How do i launch it so people can access it over the internet? I tried this but it doesnt work. bin/standalone.sh -b 0.0.0.0 It says: Google Chrome could not load the webpage because took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection.

    Read the article

  • Swing object: first setText() gets "stuck" when using Mac Java SE 6

    - by Tim
    Hi there, I am a Java newbie trying to maintain an application that works fine under J2SE 5.0 (32- and 64-bit) but has a very specific problem when run under Java SE 6 64-bit: [Tims-MPB:~] tlynch% java -version java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03-226) Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-92, mixed mode) The application is cross-platform and reportedly works correctly on Java SE 6 under Windows, though I haven't been able to verify that myself. The program uses a JTextField for some text entry and a JLabel to indicate the text to be entered. The first time the showDialog() method is called to set the label text and display the dialog, it works correctly, but subsequent calls all result in the display of the label from the initial invocation rather than the one most recently specified via setText(). public void showDialog(String msgText) { System.out.println("set ChatDialog: " + msgText); jLabel1.setText(msgText); jLabel1.repaint(); // I added this; it didn't help System.out.println("get ChatDialog: " + jLabel1.getText()); super.setVisible(true); } [the full text of the class is provided below] The added printlns validate that expected text is passed to the label's setText() method and is confirmed by retrieving it using getText(), but what shows up on the screen/GUI is always the text from the very first time the method was called for the object. A similar issue is observed with a JTextArea used to label another dialog box. These problem are consistent across multiple Mac systems running Java SE 6 under OS 10.5.x and 10.6.x, but they are never observed when one reverts to J2SE 5.0. If there is some background information pertinent to this problem that I have omitted, please let me know. Any insights or advice appreciated. package gui; import java.awt.*; import java.awt.event.KeyEvent; import javax.swing.*; // Referenced classes of package gui: // MyJPanel, ChatDialog_jTextField1_keyAdapter, WarWindow public class ChatDialog extends JDialog { public ChatDialog(JFrame parent, WarWindow w) { super(parent, true); text = ""; borderLayout1 = new BorderLayout(); jPanel1 = new MyJPanel(); borderLayout2 = new BorderLayout(); jPanel2 = new MyJPanel(); jPanel3 = new MyJPanel(); jLabel1 = new JLabel(); jTextField1 = new JTextField(); warWindow = w; try { jbInit(); } catch(Exception exception) { System.out.println("Problem with ChatDialog init"); exception.printStackTrace(); } return; } public String getText() { return text; } void jTextField1_keyPressed(KeyEvent e) { int id = e.getKeyCode(); switch(id) { case 10: // '\n' text = jTextField1.getText(); setVisible(false); break; } } private void jbInit() throws Exception { setLocation(232, 450); setSize(560, 60); setModal(true); setResizable(false); setUndecorated(true); getContentPane().setLayout(borderLayout1); jPanel1.setLayout(borderLayout2); jPanel2.setMinimumSize(new Dimension(10, 20)); jPanel2.setPreferredSize(new Dimension(10, 20)); jLabel1.setPreferredSize(new Dimension(380, 15)); jLabel1.setHorizontalAlignment(0); jLabel1.setText("Chat Message"); jTextField1.setPreferredSize(new Dimension(520, 21)); jTextField1.setRequestFocusEnabled(false); jTextField1.addKeyListener(new ChatDialog_jTextField1_keyAdapter(this)); getContentPane().add(jPanel1, "Center"); jPanel1.add(jPanel2, "North"); jPanel2.add(jLabel1, null); jPanel1.add(jPanel3, "Center"); jPanel3.add(jTextField1, null); } public void setVisible(boolean b) { jTextField1.setText(""); super.setVisible(b); } public void showDialog(String msgText) { System.out.println("set ChatDialog: " + msgText); jLabel1.setText(msgText); jLabel1.repaint(); // I added this; it didn't help System.out.println("get ChatDialog: " + jLabel1.getText()); super.setVisible(true); } void this_keyPressed(KeyEvent e) { int id = e.getKeyCode(); switch(id) { case 10: // '\n' System.exit(88); break; } } BorderLayout borderLayout1; BorderLayout borderLayout2; JLabel jLabel1; JPanel jPanel1; JPanel jPanel2; JPanel jPanel3; JTextField jTextField1; String text; WarWindow warWindow; }

    Read the article

  • Is there a generic way of dealing with varying connection strings in C#?

    - by James Wiseman
    I have an application that needs to connect to a SQL database, and execute a SQL Agent Job. The connection string I am trying to access is stored in the registry, which is easily enough pulled out. This appliction is to be run on multiple computers, and I cannot guarantee the format of this connection string being consistent across these computers. Two that I have pulled out for example are: Data Source=Server1;Initial Catalog=DB1;Integrated Security=SSPI; Data Source=Server2;Initial Catalog=DB1;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False; I can use an object of type System.Data.SqlClient.SqlConnection to connect to the database with the first connection string, howevever, I get the following error when I pass the second to it: keyword not supported: 'provider' Similarly, I can use the an object of type System.Data.OleDb.OleDbConnection to connect to the database with the second connection string, howevever, I get the following error when I pass the first to it: An OLEDB Provider was not specified in the ConnectionString' I can solve this by scanning the string for 'Provider' and doing the connect conditionally, however I can't help but feel that there is a better way of doing this, and handle the connection strings in a more generic fashion. Does anyone have any suggestions?

    Read the article

  • Background Image w/Quartz Drawing

    - by James
    I'm using Quartz to do some basic drawing. I recently decided I wanted a background image for my app. So I went into my XIB file and added a UIImageView and set the background, looks good. However, when I run it, the Z-Index of the image is above my drawing. I googled a bit and found that you can do Layout Send to Back in IB...but that option is grayed out to me when I have my UIImageView selected. Is there an easy way to move this UIImageView permanently to the background? Is there perhaps an alternate method to doing this that I should consider? Thanks

    Read the article

  • Find all ways to insert zeroes into a bit pattern

    - by James
    I've been struggling to wrap my head around this for some reason. I have 15 bits that represent a number. The bits must match a pattern. The pattern is defined in the way the bits start out: they are in the most flush-right representation of that pattern. So say the pattern is 1 4 1. The bits will be: 000000010111101 So the general rule is, take each number in the pattern, create that many bits (1, 4 or 1 in this case) and then have at least one space separating them. So if it's 1 2 6 1 (it will be random): 001011011111101 Starting with the flush-right version, I want to generate every single possible number that meets that pattern. The # of bits will be stored in a variable. So for a simple case, assume it's 5 bits and the initial bit pattern is: 00101. I want to generate: 00101 01001 01010 10001 10010 10100 I'm trying to do this in Objective-C, but anything resembling C would be fine. I just can't seem to come up with a good recursive algorithm for this. It makes sense in the above example, but when I start getting into 12431 and having to keep track of everything it breaks down.

    Read the article

  • How can one prevent page breaks between Tables in SQL Reporting Services 2005?

    - by James
    I've been developing an SSRS 2005 report (a form letter) that contains two tables. The first "table" uses DataSet "A" to populate address fields on letterhead. The second table uses DataSet "B" to display a basic list of records that pertain to the addressed party. Even though the two tables are within the same page and all PageBreak* properties are set to "False", SSRS renders the report as two pages. How can I force both tables to render in series, without any forced page breaks?

    Read the article

  • Exception calling UpdateModel - Value cannot be null or empty

    - by James Alexander
    This is probably something silly I'm missing but I'm definitely lost. I'm using .NET 4 RC and VS 2010. This is also my first attempt to use UpdateModel in .NET 4, but every time I call it, I get an exception saying Value cannont be null or empty. I've got a simple ViewModel called LogOnModel: [MetadataType(typeof(LogOnModelMD))] public class LogOnModel { public string Username { get; set; } public string Password { get; set; } public class LogOnModelMD { [StringLength(3), Required] public object Username { get; set; } [StringLength(3), Required] public object Password { get; set; } } } My view uses the new strongly typed helpers in MVC2 to generate a textbox for username and one for the password. When I look at FormCollection in my controller method, I see values for both coming through. And last but not least, here's are post controller methods: // POST: /LogOn/ [HttpPost] public ActionResult Index(FormCollection form) { var lm = new LogOnModel(); UpdateModel(lm, form); var aservice = new AuthenticationService(); if (!aservice.AuthenticateLocal(lm.Username, lm.Password)) { ModelState.AddModelError("User", "The username or password submitted is invalid, please try again."); return View(lm); } return Redirect("~/Home"); } Can someone please lend some insight into why UpdateModel would be throwing this exception? Thanks!

    Read the article

  • Rails time zone selector: intelligently selecting a default

    - by Tim Sullivan
    When signing up for an account on one of my apps, we need to store the time zone is in. We're using the time zone selector, which is fine, but I'd like to set the default value to something that it likely the user's current time zone. Is there an easy way, either on the server or using JavaScript, to set the time zone selector to the time zone the user is currently in?

    Read the article

  • Regex for Searching for Text Not Preceeded By a Specific String

    - by James
    Hi, I am working on a web site with several other developers and we have had problems where people commit JavaScript code with AJAX calls that use URL's relative to the site root. An example would be /Home/Index which will not work if the site is hosted in a virtual directory. To get round the problem we use a $.url() method to convert it to a full path, e.g. $("#container").load($.url("/Home/Index")) I am trying to write a unit test that will search each JavaScript file and find places where the $.url method is not being used. The only problem is that I cannot seem to write a regex expression to do this. I have tried the following: (?!\$\.url\()"(/\w*)+" But this does not work. I cannot find a way to say that I don't want the $.url in front. Does anyone know if this is possible? Note that I need regular expressions that are compatible with .NET Thanks.

    Read the article

  • Fast serarch of 2 dimensional array

    - by Tim
    I need a method of quickly searching a large 2 dimensional array. I extract the array from Excel, so 1 dimension represents the rows and the second the columns. I wish to obtain a list of the rows where the columns match certain criteria. I need to know the row number (or index of the array). For example, if I extract a range from excel. I may need to find all rows where column A =”dog” and column B = 7 and column J “a”. I only know which columns and which value to find at run time, so I can’t hard code the column index. I could use a simple loop, but is this efficient ? I need to run it several thousand times, searching for different criteria each time. For r As Integer = 0 To UBound(myArray, 0) - 1 match = True For c = 0 To UBound(myArray, 1) - 1 If not doesValueMeetCriteria(myarray(r,c) then match = False Exit For End If Next If match Then addRowToMatchedRows(r) Next The doesValueMeetCriteria function is a simple function that checks the value of the array element against the query requirement. e.g. Column A = dog etc. Is it more effiecent to create a datatable from the array and use the .select method ? Can I use Linq in some way ? Perhaps some form of dictionary or hashtable ? Or is the simple loop the most effiecent ? Your suggestions are most welcome.

    Read the article

  • Android which button index from array was pressed

    - by Tim Wayne
    How do I set up a OnClickListener to simply tell me which index button was pressed from an array of buttons. I can change text and color of these buttons using the array. I set them up like this. TButton[1] = (Button)findViewById(R.id.Button01); TButton[2] = (Button)findViewById(R.id.Button02); TButton[3] = (Button)findViewById(R.id.Button03); up to 36.

    Read the article

  • Can I package my Eclipse extension so the right version is automatically installed?

    - by James
    Is there a way to build an Eclipse Update Site so that Eclipse 3.3 will install one version of my plug-in while Eclipse 3.4 will install another version? Background: I've become responsible for an Eclipse extension that has half a dozen plug-ins which depend on a "support" plug-in, and the support plug-in needs to be one version for Eclipse 3.3 and a different version for Eclipse 3.4/3.5. I currently have two separate features, "extension for 3.3" and "extension for 3.4+" but I'd like to not bother my users with this detail.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >