Search Results

Search found 710 results on 29 pages for 'frank thornton'.

Page 17/29 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How many ways a java Program can end ?

    - by Frank
    I know use System.exit(0) can end a java program, for instance, if I have a JFrame window, it will close and end the program, but I wonder how many other ways, can it be closed and the program be ended ? Including when an error occurs, will the program be shut down and the JFrame be closed ?

    Read the article

  • Are there any inversion of control frameworks for javascript?

    - by Frank Schwieterman
    Are there any inversion of control frameworks for javascript? The closest answer available on stackoverflow that I could find is here: http://stackoverflow.com/questions/619701/wiring-code-in-javascript . It looks like a great start, but I thought I'd be able to find something with a longer development history. I've only used Castle Windsor myself, and I am really missing it in web-client land.

    Read the article

  • Requested operation requires an OLE DB Session object... - Connecting Excel to SQL server via ADO

    - by Frank V
    I'm attempting to take Excel 2003 and connect it to SQL Server 2000 to run a few dynamicly generated SQL Queries which ultimately filling certain cells. I'm attempting to do this via VBA via ADO (I've tried 2.8 to 2.0) but I'm getting an error while setting the ActiveConnection variable which is inside the ADODB.Connection object. I need to resolve this pretty quick... Requested operation requires an OLE DB Session object, which is not supported by the current provider. I'm honestly not sure what this error means and right now I don't care. How can get this connection to succeed so that I can run my queries? Here is my VB code: Dim SQL As String, RetValue As String SQL = " select top 1 DateTimeValue from SrcTable where x='value' " 'Not the real SQL RetValue = "" Dim RS As ADODB.Recordset Dim Con As New ADODB.Connection Dim Cmd As New ADODB.Command Con.ConnectionString = "Provider=sqloledb;DRIVER=SQL Server;Data Source=Server\Instance;Initial Catalog=MyDB_DC;User Id=<UserName>;Password=<Password>;" Con.CommandTimeout = (60 * 30) Set Cmd.ActiveConnection = Con ''Error occurs here. ' I'm not sure if the rest is right. I've just coded it. Can't get past the line above. Cmd.CommandText = SQL Cmd.CommandType = adCmdText Con.Open Set RS = Cmd.Execute() If Not RS.EOF Then RetValue = RS(0).Value Debug.Print "RetValue is: " & RetValue End If Con.Close I imagine something is wrong with the connection string but I've tried over a dozen variations. Now I'm just shooting in the dark.... Note/Update: To make matters more confusing, if I Google for the error quote above, I get a lot of hits back but nothing seems relevant or I'm not sure what information is relevant.... I've got the VBA code in "Sheet1" under "Microsoft Excel Objects." I've done this before but usually put things in a module. Could this make a difference?

    Read the article

  • stub webserver for integration testing

    - by Frank Schwieterman
    I have some integration tests where I want to verify certain requires are made against a third-[arty webserver. I was thinking I would replace the third-party server with a stub server that simply logs calls made to it. The calls do not need to succeed, but I do need a record of the requests made (mainly just the path+querystring). I was considering just using IIS for this. I could 1) set up an empty site, 2) modify the system's host file to redirect requests to that site 3) parse the log file at the end of each test. This is problematic as for IIS the log files are not written to immediately, and the files are written to continuosly. I'll need to locate the file, read the contents before the test, wait a nondeterministic amount of time after the test, read the update contents, etc. Can someone think of a simpler way?

    Read the article

  • Consolidate loan, purchase & sale tables into one transaction table.

    - by Frank Computer
    INFORMIX-SE with ISQL 7.3: I have separate tables for Loan, Purchase & Sales transactions. Each tables rows are joined to their respective customer rows by: customer.id [serial] = loan.foreign_id [integer]; = purchase.foreign_id [integer]; = sale.foreign_id [integer]; I would like to consolidate the three tables into one table called "transaction", where a column: transaction.trx_type char(1) {L=Loan, P=Purchase, S=Sale} identifies the transaction type. Each transaction will be assigned a unique transaction number [serial]. Is this a good idea or is it better to keep them in separate tables? Storage space is not a concern, I think it would be easier programming & user-wise to have all types of transactions under one table, whenever possible. This implies denormalization.

    Read the article

  • Get real image width and height with Javascript in Safari/Chrome?

    - by Frank Bannister
    I am creating a jQuery plugin. How do I get real image width and height with Javascript in Safari? Following works with Firefox 3, IE7 and Opera 9: var pic = $("img") // need to remove these in of case img-element has set width and height pic.removeAttr("width"); pic.removeAttr("height"); var pic_real_width = pic.width(); var pic_real_height = pic.height(); But in Webkit browsers like Safari and Google Chrome values are 0... Doing this on server side is not an option.

    Read the article

  • XDocument.Parse fails due to resolution error, how to disable resolution

    - by Frank Krueger
    I am trying to parse the contents of http://feeds.feedburner.com/riabiz using XDocument.Parse(string) (because it gets cached in a DB.) However, it keeps failing with the below stack trace when it tries to resolve some URIs in that XML. I don't care about validation or any of that XML nonsense, I just want the structure parsed. How can I use XDocument without this URI resolution? System.ArgumentException: The specified path is not of a legal form (empty). at System.IO.Path.InsecureGetFullPath (System.String path) [0x00000] in :0 at System.IO.Path.GetFullPath (System.String path) [0x00000] in :0 at System.Xml.XmlResolver.ResolveUri (System.Uri baseUri, System.String relativeUri) [0x00000] in :0 at System.Xml.XmlUrlResolver.ResolveUri (System.Uri baseUri, System.String relativeUri) [0x00000] in :0 at Mono.Xml2.XmlTextReader.ReadStartTag () [0x00000] in :0 at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in :0 at Mono.Xml2.XmlTextReader.Read () [0x00000] in :0 at System.Xml.XmlTextReader.Read () [0x00000] in :0 at Mono.Xml.XmlFilterReader.Read () [0x00000] in :0 at Mono.Xml.XmlFilterReader.Read () [0x00000] in :0 at System.Xml.XmlReader.ReadEndElement () [0x00000] in :0 at System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions options) [0x00000] in :0 at System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions options) [0x00000] in :0 ...

    Read the article

  • Including tax in total sale price.

    - by Frank Computer
    INFORMIX-SQL 7.3 Perform Screen: Suppose I have a customer who wants to pay a $100 (7% tax included), what logic can I use so that when the cashier clerk enters $100 in the tax included sale amount, it will calculate the sale price and tax so that it adds up to $100. I have the folllowing 3 field tags in my perform screen: sprice = transaction.sale_price; stax = transaction.sale_tax; stotal = transaction.sale_total; after editadd of transaction.sale_price ? ? ?

    Read the article

  • PHP GD - How can I modify my Thumbnail Creator to crop portrait images from the center?

    - by frank
    Here is my current code: $image = 'img.jpg'; $source = imagecreatefromjpeg($image); list($origWidth, $origHeight) = getimagesize($image); $imgH = 75; $imgW = $origWidth / $origHeight * $imgH; $thumb = imagecreatetruecolor($imgW, $imgH); imagecopyresampled($thumb, $source, 0, 0, 0, 0, $imgW, $imgH, $origWidth, $origHeight); This allows me to output an image with a fixed height of 75 pixels. What I would like to do is have a constant image size of 99x75 pixels. Portrait images that don't fit into this will be cropped from the center (so the center of the original remains the center of the thumbnail - if that makes sense). How can I do this?

    Read the article

  • How do you get the ethernet address using Java?

    - by Frank Krueger
    I would like to retrieve the ethernet address of the network interface that is used to access a particular website. How can this be done in Java? Solution Note that the accepted solution of getHardwareAddress is only available in Java 6. There does not seem to be a solution for Java 5 aside from executing i(f|p)confing.

    Read the article

  • Replacement for Azure SDK Powershell commandlets for deployments

    - by Frank Rosario
    Hi, We've run into an issue with the New-Deployment Azure Powershell commandlet timing out; we've put in a bug report with MS. While they gave us an explanation for it (the path and timeout threshold used to upload through commandlets is different then what's used by the web portal); they don't have a fix for us. We need to get this running so we can automate our build deployments, so we're looking into developing a custom commandlet to replace New-Deployment using the Azure SDK; hoping this path will not have the timeout issues the commandlet did. But before we go down that route; are there any other scriptable tools I can use to replace the New-Deployment functionality? I looked at Cloudberry for Windows Azure; but that doesn't have a scriptable interface yet. Any constructive input is greatly appreciated.

    Read the article

  • Django "Page not found" error page shows only one of two expected urls

    - by Frank V
    I'm working with Django, admittedly for the first time doing anything real. The URL config looks like the following: urlpatterns = patterns('my_site.core_prototype.views', (r'^newpost/$', 'newPost'), (r'^$', 'NewPostAndDisplayList'), # capture nothing... #more here... - perhaps the perma-links? ) This is in an app's url.py which is loaded from the project's url.py via: urlpatterns = patterns('', # only app for now. (r'^$', include('my_site.core_prototype.urls')), ) The problem is, when I receive a 404 attempting to utilize newpost, the error page only shows the ^$ -- it seems to ignore the newpost pattern... I'm sure the solution is probably stupid-simple but right now I'm missing it. Can someone help get me on the right track...

    Read the article

  • Replicating Java's DecimalFormat in C#

    - by Frank Krueger
    I am trying to replicate a subset of Java's DecimalFormat class. Below is what I've come up with. Does this look right to everyone? public class DecimalFormat : NumberFormat { int _maximumFractionDigits; int _minimumFractionDigits; string _format; void RebuildFormat () { _format = "{0:0."; _format += new string ('0', _minimumFractionDigits); if (_maximumFractionDigits > _minimumFractionDigits) { _format += new string ('#', _maximumFractionDigits - _minimumFractionDigits); } _format += "}"; } public override string format (object value) { return string.Format (_format, value); } public override void setMaximumFractionDigits (int n) { _maximumFractionDigits = n; RebuildFormat (); } public override void setMinimumFractionDigits (int n) { _minimumFractionDigits = n; RebuildFormat (); } public override void setGroupingUsed (bool g) { } public static NumberFormat getInstance () { return new DecimalFormat (); } }

    Read the article

  • JSON.Net: deserializing polymorphic types without specifying the assembly

    - by Frank Schwieterman
    I see that using JSON.Net, I can decode polymorphic objects if a $type attribute specifies the specific type of the JSON object. In all the examples I've seen, $type includes the namespace. Is it possible to make this work including just a simple typename without the assembly? I'd be happy to specify a default assembly to the JsonSerializer if thats possible I am able to deserialize the JSON using: public class SingleAssemblyJsonTypeBinder : SerializationBinder { private readonly Assembly _assembly; private Dictionary _typesBySimpleName = new Dictionary(StringComparer.OrdinalIgnoreCase); private Dictionary _simpleNameByType = new Dictionary(); public SingleAssemblyJsonTypeBinder(Assembly assembly) { _assembly = assembly; _typesBySimpleName = new Dictionary<string, Type>(); foreach (var type in _assembly.GetTypes().Where(t => t.IsPublic)) { if (_typesBySimpleName.ContainsKey(type.Name)) throw new InvalidOperationException("Cannot user PolymorphicBinder on a namespace where multiple public types have same name."); _typesBySimpleName[type.Name] = type; _simpleNameByType[type] = type.Name; } } public override Type BindToType(string assemblyName, string typeName) { Type result; if (_typesBySimpleName.TryGetValue(typeName.Trim(), out result)) return result; return null; } public override void BindToName(Type serializedType, out string assemblyName, out string typeName) { string name; if (_simpleNameByType.TryGetValue(serializedType, out name)) { typeName = name; assemblyName = null;// _assembly.FullName; } else { typeName = null; assemblyName = null; } } } ... public static JsonSerializerSettings GetJsonSerializationSettings() { var settings = new JsonSerializerSettings(); settings.Binder = new SingleAssemblyJsonTypeBinder(typeof(MvcApplication).Assembly); settings.TypeNameHandling = TypeNameHandling.Objects; return settings; } .... var serializer = JsonSerializer.Create(settings); I haven't been able to make this work with MVC though, I'm configuring json deserialization per the code below in Application_Start, and the object is deserialized, but using the base type one. GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.Binder = new SingleAssemblyJsonTypeBinder(this.GetType().Assembly); GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.TypeNameHandling = TypeNameHandling.All; GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple;

    Read the article

  • How can I serialize the values of checked checkboxes in an iFrame into a hidden form field on clicki

    - by Frank Bailey
    I have an iFrame like so: <iframe width="100%" frameborder="0" height="470" allowtransparency="true" name="productframe" id="productframe" style="border-bottom:1px solid #eee"></iframe> The iframe contains several line items drawn from a sql server db, and I can check any of the checkboxes I want to perform a task with - in this case delete them. I have a button in the parent document that says "Delete selected", and I'd like to be able to click this button and populate a hidden field in my parent page with the values of the selected checkboxes in the child iframe. My checkboxes look like this: <input id="Checkbox1" type="checkbox" value="47" title="Select this row" name="selectItem"/> I have an instance of jquery on my parent page so I can make use of jquery selectors, I just have no clue as to the syntax needed to do this. Thanks in advance to anyone who can help me on this.

    Read the article

  • How to get a JTextField event that started a pop up menu in Java ?

    - by Frank
    I have a JTextField that represents a day, such as "Sunday", when I left mouse click on it, it changes background color, when I right mouse click on it, a pop up menu comes up, after I click on a menu item, such as "1st of month", it gets the value, closes the menu and then change the bgcolor, my code looks like this : JTextField dayHeading=new JTextField("Su"); ...... final JPopupMenu Pmenu; JMenuItem menuItem; Pmenu=new JPopupMenu(); menuItem=new JMenuItem("1st of month"); Pmenu.add(menuItem); menuItem=new JMenuItem("2nd of month"); Pmenu.add(menuItem); ...... menuItem.addMouseListener(new MouseAdapter() { public void mouseReleased(final MouseEvent e) { System.out.println(((JMenuItem)e.getComponent()).getText()); onHeadingClicked(e); // Error : java.lang.ClassCastException: javax.swing.JMenuItem cannot be cast to javax.swing.JTextField // How to get the orininal JTextField event that started this pop up menu, so I can pass it onto onHeadingClicked() ? } }); ...... dayHeading.setEditable(false); dayHeading.setFocusable(false); dayHeading.addMouseListener(new MouseAdapter() { public void mouseReleased(final MouseEvent evt) { if (SwingUtilities.isLeftMouseButton(evt)) onHeadingClicked(evt); else if (SwingUtilities.isRightMouseButton(evt)) Pmenu.show(evt.getComponent(),evt.getX(),evt.getY()); } }); ...... void onHeadingClicked(final java.awt.event.MouseEvent evt) { final javax.swing.JTextField fld=(javax.swing.JTextField) evt.getSource(); ... } My question is : in the menuItem.addMouseListener section, how to get the orininal JTextField event that started this pop up menu, so I can pass it onto onHeadingClicked() ?

    Read the article

  • Kernighan & Ritchie word count example program in a functional language

    - by Frank
    I have been reading a little bit about functional programming on the web lately and I think I got a basic idea about the concepts behind it. I'm curious how everyday programming problems which involve some kind of state are solved in a pure functional programing language. For example: how would the word count program from the book 'The C programming Language' be implemented in a pure functional language? Any contributions are welcome as long as the solution is in a pure functional style. Here's the word count C code from the book: #include <stdio.h> #define IN 1 /* inside a word */ #define OUT 0 /* outside a word */ /* count lines, words, and characters in input */ main() { int c, nl, nw, nc, state; state = OUT; nl = nw = nc = 0; while ((c = getchar()) != EOF) { ++nc; if (c == '\n') ++nl; if (c == ' ' || c == '\n' || c = '\t') state = OUT; else if (state == OUT) { state = IN; ++nw; } } printf("%d %d %d\n", nl, nw, nc); }

    Read the article

  • What does Indy's HandleRedirect do?

    - by Robert Frank
    I'm having some trouble reading files with Indy from a site that has WordPress installed. It appears that the site is configured to redirect all hits to sitename/com/wordpress. Can I use HandleRedirect to turn that off so I can read files from the root folder? What is the normal setting for this property? Any downsides to using it for this purpose? (Edit: it appears that my problem may be caused by Windows cacheing of a file I've accessed before through Indy. I'm using fIDHTTP.Request.CacheControl := 'no-cache'; is that adequate?

    Read the article

  • Printing a field with additional dots in haskell

    - by Frank Kluyt
    I'm writing a function called printField. This function takes an int and a string as arguments and then then prints a field like this "Derp..." with this: printField 7 "Derp". When the field consists of digits the output should be "...3456". The function I wrote looks like this: printField :: Int -> String -> String printField x y = if isDigit y then concat(replicate n ".") ++ y else y ++ concat(replicate n ".") where n = x - length y This obviously isn't working. The error I get from GHC is: Couldn't match type `[Char]' with `Char' Expected type: Char Actual type: String In the first argument of `isDigit', namely `y' In the expression: isDigit y In the expression: if isDigit y then concat (replicate n ".") ++ y else y ++ concat (replicate n ".") I can't get it to work :(. Can anyone help me out? Please keep in mind that I'm new to Haskell and functional programming in general.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >