Search Results

Search found 131 results on 6 pages for 'phill duffy'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • php : is this if condition correct?

    - by phill
    I have the following if condition statement if ( (strlen($data[70])>0) || ( (remove19((trim($data[29])) == '7135556666')) && isLongDistance($data[8])) ) where $data is a recordset from a database. My goal is to include all rows where $data[70] isn't blank, and also include rows where $data[29] = 713555666 && $data[8] isLongDistance = TRUE My question is, if isLongDistance($data[8]) returns false, will it still return the row since $data[70] is not blank? thanks in advance

    Read the article

  • Perl latin-9? Unicode - need to add support

    - by Phill Pafford
    I have an application that is being expanded to the UK and I will need to add support for Latin-9 Unicode. I have done some Googling but found nothing solid as to what is involved in the process. Any tips? Here is some code (Just the bits for Unicode stuff) use Unicode::String qw(utf8 latin1 utf16); # How to call $encoded_txt = $self->unicode_encode($item->{value}); # Function part sub unicode_encode { shift() if ref($_[0]); my $toencode = shift(); return undef unless defined($toencode); Unicode::String->stringify_as("utf8"); my $unicode_str = Unicode::String->new(); # encode Perl UTF-8 string into latin1 Unicode::String # - currently only Basic Latin and Latin 1 Supplement # are supported here due to issues with Unicode::String . $unicode_str->latin1( $toencode ); ... Any help would be great and thanks.

    Read the article

  • Java Servlet connecting to SQL Server tutorial?

    - by phill
    Can anyone recommend a tutorial on how to write a Java Servlet which connects to MS SQL server and manages data? I'm trying to write something which pulls products out of one database and inserts them into a stored procedure located on another database. Thanks in advance.

    Read the article

  • Why am I getting an error when return TRUE/FALSE to type Boolean?

    - by phill
    I wrote the following code: import java.lang.*; import DB.*; private Boolean validateInvoice(String i) { int count = 0; try { //check how many rowsets ResultSet c = connection.DBquery("select count(*) from Invce i,cust c where tranid like '"+i+"' and i.key = c.key "); while (c.next()) { System.out.println("rowcount : " + c.getInt(1)); count = c.getInt(1); } if (count > 0 ) { return TRUE; } else { return FALSE; } //end if } catch(Exception e){e.printStackTrace();return FALSE;} } The errors I'm getting are: i.java:195: cannot find symbol symbol : variable TRUE location: class changei.iTable return TRUE; i.java:197: cannot find symbol symbol : variable TRUE location: class changei.iTable return FALSE; i.java:201:: cannot find symbol symbol : variable FALSE location: class changei.iTable catch(Exception e){e.printStackTrace();return FALSE;} The Connection class comes from the DB package i created. Is the return TRUE/FALSE correct since the function is a Boolean return type?

    Read the article

  • vb6 ADODB TSQL procedure call quit working after database migration

    - by phill
    This code was once working on sql server 2005. Now isolated in a visual basic 6 sub routine using ADODB to connect to a sql server 2008 database it throws an error saying: "Login failed for user 'admin' " I have since verified the connection string does work if i replace the body of this sub with the alternative code below this sub. When I run the small program with the button, it stops where it is marked below the asterisk line. Any ideas? thanks in advance. Private Sub Command1_Click() Dim cSQLConn As New ADODB.Connection Dim cmdGetInvoices As New ADODB.Command Dim myRs As New ADODB.Recordset Dim dStartDateIn As Date dStartDateIn = "2010/05/01" cSQLConn.ConnectionString = "Provider=sqloledb;" _ & "SERVER=NET-BRAIN;" _ & "Database=DB_app;" _ & "User Id=admin;" _ & "Password=mudslinger;" cSQLConn.Open cmdGetInvoices.CommandTimeout = 0 sProc = "GetUnconvertedInvoices" 'On Error GoTo GetUnconvertedInvoices_Err With cmdGetInvoices .CommandType = adCmdStoredProc .CommandText = "_sp_cwm5_GetUnCvtdInv" .Name = "_sp_cwm5_GetUnCvtdInv" Set oParm1 = .CreateParameter("@StartDate", adDate, adParamInput) .Parameters.Append oParm1 oParm1.Value = dStartDateIn .ActiveConnection = cSQLConn End With With myRs .CursorLocation = adUseClient .LockType = adLockBatchOptimistic .CursorType = adOpenKeyset '.CursorType = adOpenStatic .CacheSize = 5000 '***************************Debug stops here .Open cmdGetInvoices End With If myRs.State = adStateOpen Then Set GetUnconvertedInvoices = myRs Else Set GetUnconvertedInvoices = Nothing End If End Sub Here is the code which validates the connection string is working. Dim cSQLConn As New ADODB.Connection Dim cmdGetInvoices As New ADODB.Command Dim myRs As New ADODB.Recordset cSQLConn.ConnectionString = "Provider=sqloledb;" _ & "SERVER=NET-BRAIN;" _ & "Database=DB_app;" _ & "User Id=admin;" _ & "Password=mudslinger;" cSQLConn.Open cmdGetInvoices.CommandTimeout = 0 sProc = "GetUnconvertedInvoices" With cmdGetInvoices .ActiveConnection = cSQLConn .CommandText = "SELECT top 5 * FROM tarInvoice;" .CommandType = adCmdText End With With myRs .CursorLocation = adUseClient .LockType = adLockBatchOptimistic '.CursorType = adOpenKeyset .CursorType = adOpenStatic '.CacheSize = 5000 .Open cmdGetInvoices End With If myRs.EOF = False Then myRs.MoveFirst Do MsgBox "Record " & myRs.AbsolutePosition & " " & _ myRs.Fields(0).Name & "=" & myRs.Fields(0) & " " & _ myRs.Fields(1).Name & "=" & myRs.Fields(1) myRs.MoveNext Loop Until myRs.EOF = True End If

    Read the article

  • How can I print the cookie_jar values in Perl's WWW::Mechanize?

    - by Phill Pafford
    How can I print the values of the cookie/cookie_jar being set? Trying: ##my $cookie_jar=HTTP::Cookies->new(file => "cookie.jar",autosave=>1,ignore_discard=>1); my $cookie_jar=HTTP::Cookies->new(); ## Would like it to be in memory my $agent = WWW::Mechanize->new(cookie_jar => $cookie_jar); ##my $agent = WWW::Mechanize->new(); ##my $agent = WWW::Mechanize->new(autocheck => 1); ##$agent->cookie_jar( {} ); # we need cookies ##$agent->cookie_jar(HTTP::Cookies->new); print "Set Cookie Jar?\n"; print $agent->cookie_jar->as_string(); print "\n"; $agent->get($url); // url is a https site Not too much luck with any of these, what am I doing wrong?

    Read the article

  • VBScript: how to set values from recordset to string

    - by phill
    This is probably a beginner question, but how do you set a recordset to a string variable? Here is my code: Function getOffice (strname, uname) strEmail = uname WScript.Echo "email: " & strEmail Dim objRoot : Set objRoot = GetObject("LDAP://RootDSE") Dim objDomain : Set objDomain = GetObject("LDAP://" & objRoot.Get("defaultNamingContext")) Dim cn : Set cn = CreateObject("ADODB.Connection") Dim cmd : Set cmd = CreateObject("ADODB.Command") cn.Provider = "ADsDSOObject" cn.Open "Active Directory Provider" Set cmd.ActiveConnection = cn cmd.CommandText = "SELECT physicalDeliveryOfficeName FROM '" & objDomain.ADsPath & "' WHERE mail='" & strEmail & "'" cmd.Properties("Page Size") = 1 cmd.Properties("Timeout") = 300 cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE Dim objRS : Set objRS = cmd.Execute WScript.Echo objRS.Fields(0) Set cmd = Nothing Set cn = Nothing Set objDomain = Nothing Set objRoot = Nothing Dim arStore Set getOffice = objRS.Fields(0) Set objRS = Nothing End function When I try to run the function, it throws an error "vbscript runtime error: Type mismatch" I presume this means it can't set the string variable with a recordset value. How do I fix this problem?

    Read the article

  • vb.net : is it possible to connect to sql server 2008 via odbc but not through vb.net code?

    - by phill
    I'm supporting an old vb.net program whose database it connected to was moved from SQL Server 2005 to SQL Server 2008. Is there a setting on SQL Server 2008 which will allow ODBC connections to access the database but not allow VB.NET to connect to it programmatically? the error i keep receiving in the app is: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) however I can connect to it when I create a system dsn to the sql server instance and through VS2005's Tools Connect to Database. Here is the code I'm using to connect: dim strC as string strC = "data source=bob; database=subscribers; user id=bobuser; password=passme" dim connection as New SqlClient.SqlConnection(strC) try connection.open() catch ex as Exception msgbox(ex.message) end try connection.Close()

    Read the article

  • java jsp : connecting to sql server tutorial?

    - by phill
    Can anyone recommend a tutorial on how to write a java servlet which connects to ms sql server and manages data? I'm trying to write something which pulls products out of one database and inserts them into a stored procedure located on another database. thanks in advance

    Read the article

  • .Net in HTML tp return true if reader object not null, otherwise return false

    - by Phill Healey
    I'm using a DataList to show some data from the database and populating the fields on the html side. I now have a requirement to change the visibility of a panel based on whether or not a db field has data or not. I need to be able to show the panel if the relevant data field has content, and hide it if it doesn't. Eg: <asp:Panel ID="pnlNew" runat="server" Style="margin:0; padding:0; width:42px; height:18px; bottom:5px; right:10px; float:right; position:relative; background:url(../_imgVideoBadge.png) no-repeat;" Visible='<%# Eval("cheese") != null %>' ToolTip="available"></asp:Panel> Obviously this doesn't work in terms of the visible property. But hopefully it gives an idea of what I'm trying to achieve. Any help would be greatly appreciated. I've seen examples previously of doing something along the lines of: a ?? b:c How could this be applied to the above requirement?? Thanks in advance.

    Read the article

  • Salesforce/PHP - outbound messages (SOAP) - memory limit issue? DOMDocument::loadXML() issue?

    - by Phill Pafford
    I'm using Salesforce to send outbound messages (via SOAP) to another server. The server can process about 8 messages at a time, but will not send back the ACK file if the SOAP request contains more than 8 messages. SF can send up to 100 outbound messages in 1 SOAP request and I think this is causing a memory issue with PHP. If I process the outbound messages 1 by 1 they all go through fine, I can even do 8 at a time with no issues. But larger sets are not working. ERROR in SF: org.xml.sax.SAXParseException: Premature end of file Looking in the HTTP error logs I see that the incoming SOAP message looks to be getting cut of which throws a PHP warning stating: DOMDocument::loadXML() ... Premature end of data in tag ... PHP Fatal error: Call to a member function getAttribute() on a non-object This leads me to believe that PHP is having a memory issue and can not parse the incoming message due to it's size. I was thinking I could just set: ini_set('memory_limit', '64M'); // This has done nothing to fix the problem But would this be the correct approach? Is there a way I could set this to increase with the incoming SOAP request dynamically? UPDATE: Adding some code $data = fopen('php://input','rb'); $headers = getallheaders(); $content_length = $headers['Content-Length']; $buffer_length = 1000; $fread_length = $content_length + $buffer_length; $content = fread($data,$fread_length); /** * Parse values from soap string into DOM XML */ $dom = new DOMDocument(); $dom->loadXML($content); ....

    Read the article

  • jQuery UI Calendar displays too large, would like the demo size???

    - by Phill Pafford
    So I downloaded a custom themed UI for jQuery and added the calendar control to my sight (Example: link text). In the example it shows/displays the size I would like but on my webpage it's about twice the size. why??? I do have a ton of other CSS but I don't have control over the look and feel of the page (Can't touch current CSS, MEH!!). Is there a way to get the demo look on my site? I think this is the code that jQuery UI has that might be complicating things /* Component containers ----------------------------------*/ .ui-widget { font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 1.1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #B9C4CE; background: #ffffff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #616161; } .ui-widget-content a { color: #616161; } .ui-widget-header { border: 1px solid #467AA7; background: #467AA7 url(../images/ui-bg_highlight-soft_75_467AA7_1x100.png) 50% 50% repeat-x; color: #fff; font-weight: bold; } .ui-widget-header a { color: #fff; } It's part of the Custom UI CSS

    Read the article

  • Is it possible to auto generate Getter/Setter from Array Values in PHP?

    - by Phill Pafford
    So I have a couple of arrays $array_1 = Array('one','two','three'); $array_2 = Array('red','blue','green'); Is there a dynamic way to create the Setters and Getters for an array with single value entries? So the class would be something like: class xFromArray() { } So the above if I passed $array_1 it would generate something like this: private $one; setOne($x) { $one = $x; } getOne() { return $one; } if I passed $array_2 it would generate something like this: private $red; setRed($x) { $red = $x; } getRed() { return $red; } So I would call it somehow like this? (My best guess but doesn't seem that this would work) $xFromArray = new xFromArray; foreach($array_1 as $key=>$data) { $xFromArray->create_function(set.ucfirst($data)($data)); echo $xFromArray->create_function(get.ucfirst($data)); }

    Read the article

  • Parallel programming patterns for C#?

    - by VoidDweller
    With Intel's launch of a Hexa-Core processor for the desktop, it looks like we can no longer wait for Microsoft to make many-core programming "easy". I just order a copy of Joe Duffy's book Concurrent Programming on Windows. This looks like a great place to start, though, I am hoping some of you who have been targeting multi/many core systems would point me to some good resources that have or would have helped on your projects?

    Read the article

  • LINQ Query Problem

    - by Ritz
    I want to use this in my application but I'm getting an error for GetByLatest().Cast<IRss>(); Please suggest a solution IList<IRss> news = new Trytable().GetByLatest().Cast<IRss>(); return new RssResult(news, "William Duffy - Glasgow Based ASP.NET Web Developer", "The latest news on ASP.NET, C# and ASP.NET MVC ");

    Read the article

  • Query Problem.Please help

    - by Ritz
    hello all, i want to use this in my application but i m getting an error for GetByLatest().Cast(); Please suggest me a solution IList news = new Trytable().GetByLatest().Cast(); return new RssResult(news, "William Duffy - Glasgow Based ASP.NET Web Developer", "The latest news on ASP.NET, C# and ASP.NET MVC "); Thanks Ritz

    Read the article

  • Welcome to the Red Gate BI Tools Team blog!

    - by BI Tools Team
    Welcome to the first ever post on the brand new Red Gate Business Intelligence Tools Team blog! About the team Nick Sutherland (product manager): After many years as a software developer and project manager, Nick took an MBA and turned to product marketing. SSAS Compare is his second lean startup product (the first being SQL Connect). Follow him on Twitter. David Pond (developer): Before he joined Red Gate in 2011, David made monitoring systems for Goodyear. Follow him on Twitter. Jonathan Watts (tester): Jonathan became a tester after finishing his media degree and joining Xerox. He joined Red Gate in 2004. Follow him on Twitter. James Duffy (technical author): After a spell as a writer in the video game industry, James lived briefly in Tokyo before returning to the UK to start at Red Gate. What we're working on We launched a beta of our first tool, SSAS Compare, last month. It works like SQL Compare but for SSAS cubes, letting you deploy just the changes you want. It's completely free (for now), so check it out. We're still working on it, and we're eager to hear what you think. We hope SSAS Compare will be the first of several tools Red Gate develops for BI professionals, so keep an eye out for more from us in the future. Why we need you This is your chance to help influence the course of SSAS Compare and our future BI tools. If you're a business intelligence specialist, we want to hear about the problems you face so we can build tools that solve them. What do you want to see? Tell us! We'll be posting more about SSAS Compare, business intelligence and our journey into BI in the coming days and weeks. Stay tuned!

    Read the article

  • Welcome to the Red Gate BI Tools Team blog!

    - by Red Gate Software BI Tools Team
    Welcome to the first ever post on the brand new Red Gate Business Intelligence Tools Team blog! About the team Nick Sutherland (product manager): After many years as a software developer and project manager, Nick took an MBA and turned to product marketing. SSAS Compare is his second lean startup product (the first being SQL Connect). Follow him on Twitter. David Pond (developer): Before he joined Red Gate in 2011, David made monitoring systems for Goodyear. Follow him on Twitter. Jonathan Watts (tester): Jonathan became a tester after finishing his media degree and joining Xerox. He joined Red Gate in 2004. Follow him on Twitter. James Duffy (technical author): After a spell as a writer in the video game industry, James lived briefly in Tokyo before returning to the UK to start at Red Gate. What we’re working on We launched a beta of our first tool, SSAS Compare, last month. It works like SQL Compare but for SSAS cubes, letting you deploy just the changes you want. It’s completely free (for now), so check it out. We’re still working on it, and we’re eager to hear what you think. We hope SSAS Compare will be the first of several tools Red Gate develops for BI professionals, so keep an eye out for more from us in the future. Why we need you This is your chance to help influence the course of SSAS Compare and our future BI tools. If you’re a business intelligence specialist, we want to hear about the problems you face so we can build tools that solve them. What do you want to see? Tell us! We’ll be posting more about SSAS Compare, business intelligence and our journey into BI in the coming days and weeks. Stay tuned!

    Read the article

  • Welcome to the Red Gate BI Tools Team blog!

    - by BI Tools Team
    Welcome to the first ever post on the brand new Red Gate Business Intelligence Tools Team blog! About the team Nick Sutherland (product manager): After many years as a software developer and project manager, Nick took an MBA and turned to product marketing. SSAS Compare is his second lean startup product (the first being SQL Connect). Follow him on Twitter. David Pond (developer): Before he joined Red Gate in 2011, David made monitoring systems for Goodyear. Follow him on Twitter. Jonathan Watts (tester): Jonathan became a tester after finishing his media degree and joining Xerox. He joined Red Gate in 2004. Follow him on Twitter. James Duffy (technical author): After a spell as a writer in the video game industry, James lived briefly in Tokyo before returning to the UK to start at Red Gate. What we're working on We launched a beta of our first tool, SSAS Compare, last month. It works like SQL Compare but for SSAS cubes, letting you deploy just the changes you want. It's completely free (for now), so check it out. We're still working on it, and we're eager to hear what you think. We hope SSAS Compare will be the first of several tools Red Gate develops for BI professionals, so keep an eye out for more from us in the future. Why we need you This is your chance to help influence the course of SSAS Compare and our future BI tools. If you're a business intelligence specialist, we want to hear about the problems you face so we can build tools that solve them. What do you want to see? Tell us! We'll be posting more about SSAS Compare, business intelligence and our journey into BI in the coming days and weeks. Stay tuned!

    Read the article

  • How do I get Java to use the serial port in Linux?

    - by Phillip Gibb
    We make use of a java application that manages a pinpad via the serial port. This works perfectly on windows with the Sun Comm.jar, the supplied dll and the properties file. Now we are attempting to use this solution on Linux (actually it does run on various other flavours of linux out in the field) - with Ubuntu server mode. After much attempts - blood, sweat and almost tears we have this scenario: Java version 1.4.2_17 Linux - Ubuntu Comm libs - Comm3 supplied by sun with the default driver specified An external comm test shows the comm ports: /dev/ttyS0 and /dev/ttyS1 But the java application says unable to open port /dev/ttyS1 (using the RXRT files produces invalid port errors) Has anyone been able to use java 1.4.2 on linux for serial port communication and found a solution that I could apply in my scenario? greatly appreciated Phill

    Read the article

  • .NET or Windows Synchronization Primitives Performance Specifications

    - by ovanes
    Hello *, I am currently writing a scientific article, where I need to be very exact with citation. Can someone point me to either MSDN, MSDN article, some published article source or a book, where I can find performance comparison of Windows or .NET Synchronization primitives. I know that these are in the descending performance order: Interlocked API, Critical Section, .NET lock-statement, Monitor, Mutex, EventWaitHandle, Semaphore. Many Thanks, Ovanes P.S. I found a great book: Concurrent Programming on Windows by Joe Duffy. This book is written by one of the head concurrency developers for .NET Framework and is simply brilliant with lots of explanations, how things work or were implemented.

    Read the article

  • Subterranean IL: Volatile

    - by Simon Cooper
    This time, we'll be having a look at the volatile. prefix instruction, and one of the differences between volatile in IL and C#. The volatile. prefix volatile is a tricky one, as there's varying levels of documentation on it. From what I can see, it has two effects: It prevents caching of the load or store value; rather than reading or writing to a cached version of the memory location (say, the processor register or cache), it forces the value to be loaded or stored at the 'actual' memory location, so it is then immediately visible to other threads. It forces a memory barrier at the prefixed instruction. This ensures instructions don't get re-ordered around the volatile instruction. This is slightly more complicated than it first seems, and only seems to matter on certain architectures. For more details, Joe Duffy has a blog post going into the details. For this post, I'll be concentrating on the first aspect of volatile. Caching field accesses To demonstrate this, I created a simple multithreaded IL program. It boils down to the following code: .class public Holder { .field public static class Holder holder .field public bool stop .method public static specialname void .cctor() { newobj instance void Holder::.ctor() stsfld class Holder Holder::holder ret }}.method private static void Main() { .entrypoint // Thread t = new Thread(new ThreadStart(DoWork)) // t.Start() // Thread.Sleep(2000) // Console.WriteLine("Stopping thread...") ldsfld class Holder Holder::holder ldc.i4.1 stfld bool Holder::stop call instance void [mscorlib]System.Threading.Thread::Join() ret}.method private static void DoWork() { ldsfld class Holder Holder::holder // while (!Holder.holder.stop) {} DoWork: dup ldfld bool Holder::stop brfalse DoWork pop ret} If you compile and run this code, you'll find that the call to Thread.Join() never returns - the DoWork spinlock is reading a cached version of Holder.stop, which is never being updated with the new value set by the Main method. Adding volatile to the ldfld fixes this: dupvolatile.ldfld bool Holder::stopbrfalse DoWork The volatile ldfld forces the field access to read direct from heap memory, which is then updated by the main thread, rather than using a cached copy. volatile in C# This highlights one of the differences between IL and C#. In IL, volatile only applies to the prefixed instruction, whereas in C#, volatile is specified on a field to indicate that all accesses to that field should be volatile (interestingly, there's no mention of the 'no caching' aspect of volatile in the C# spec; it only focuses on the memory barrier aspect). Furthermore, this information needs to be stored within the assembly somehow, as such a field might be accessed directly from outside the assembly, but there's no concept of a 'volatile field' in IL! How this information is stored with the field will be the subject of my next post.

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >