Search Results

Search found 538 results on 22 pages for 'craig sanders'.

Page 4/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Else statement to show connection successful [closed]

    - by Craig Smith
    I am trying to write a script to test a database connection, at the moment it will only display text if the connection doesn't work, I am stuck with trying to create an else statement to display "Connection Successful" if it works. Here's my code so far. Any help appreciated :) <? $conn = @mysql_connect("localhost", "root", ""); if (!$conn) { die("Connection failed: " .mysql_error()); } ?>

    Read the article

  • Most Useful New Technology?

    - by Craig Ferguson
    I'm looking to take a sort of sabbatical, and I'd love to use it to learn a new technology. My question is this: What's the most useful "new" technology for a software engineer to use? Node.js, iOS programming, Android, something else? I'd prefer to stay away from anything too new or experimental, since those are, in my experience, rarely actually used in professional production environments (for better or worse). Does anyone happen to have stats on how many jobs there are for each new technology or have anecdotes about how fun each one is? I've been using python/Django, so that's out, and it's similar to Ruby so i don't think learning Ruby would be that useful to expanding my skills. Anyone have any other ideas?

    Read the article

  • Installed nvidia graphics driver (current, 8800GTX) has issues, how do I disable/uninstall it?

    - by Craig
    I installed the restricted nvidia graphics driver (current) on my computer, then restarted to finish the install. Upon reboot I got some prompt about there being an X server problem, It told me to try auto-fixing or something, none of its options worked, they all failed horribly and caused the computer to crash immediately on selecting any of them. I decided to re-install. Again I got in, downloaded updates, and installed the driver. This time upon boot the X-server immediately crashes and im brought to tty1. If I hit ctrl+alt+F7 I see a beige-background prompt says the usual about checking battery state, pulse audio etc., you see right before the x-server starts. According to X (if I do sudo startx) there are no displays, and the nvidia graphics driver is not working. First off, how do I set ubuntu back to the default driver (I have only a CLI right now -.-), then how do I install a more appropriate nvidia driver

    Read the article

  • How to track site visitors across several browser sessions or computers using Google Analytics?

    - by Craig
    If a site visitor clears cookies, uses various browsers or computers then Google Analytics will have a hard time detecting them as being by the same user. However since 95% of the site content is only available when logged in, so I should be able to identify multiple visits as the same user so long as they log in. How can I identify to Google that the visits are by the same user? (without breaking the Terms and Conditions)

    Read the article

  • Windows Phone 7 Networked Game

    - by Craig
    Im creating a multiplayer asteroids type game for the Windows Phone 7, 2 players can challenge each other over who will get the highest score. On each players phone the opponent is displayed and both go about shooting asteroids and enemies. In an assignment I have due I would like to talk about the packet design, what would be the least amount of info that I can send over the connection? Instead of constantly having to send each players position, asteroid position, bullet position and enemy position etc. Or would all that data constantly need to be sent?

    Read the article

  • About unit testing a function in the zend framework and unit testing in general

    - by sanders
    Hello people, I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works. I wanted to test the following function: public function getEventById($id) { return $this->getResource('Event')->getEventById($id); } So i wanted to test this function as follows: public function test_Event_Get_Event_By_Id_Returns_Event_Item() { $p = $this->_model->getEventById(42); $this->assertEquals(42, EventManager_Resource_Event_Item_Interface); $this->assertType('EventManager_Resource_Event_Item_Interface', $p); } But then I got the error: 1) EventTest::test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found for EventManager_Resource_Event /home/user/Public/ZendFramework-1.10.1/library/SF/Model/Abstract.php:101 /var/www/nrka2/application/modules/eventManager/models/Event.php:25 But then someone told me that i am currently unit testing and not doing an integration test. So i figured that i have to test the function getEventById on a different way. But I don't understand how. What this function does it just cals a resource and returns the event by id.

    Read the article

  • F# Powerpack's Metadata doesn't recognize FSharp.Core as an F# library

    - by Nathan Sanders
    Here's my test code to isolate the problem: open Microsoft.FSharp.Metadata [<EntryPoint>] let main args = let core = FSharpAssembly.FromFile @"C:\Program Files\FSharp-2.0.0.0\\bin\FSharp.Core.dll" let core2 = FSharpAssembly.FSharpLibrary let core3 = System.AppDomain.CurrentDomain.GetAssemblies() |> Seq.find (fun a -> a.FullName.Contains "Core") |> FSharpAssembly.FromAssembly core.Entities |> Seq.iter (printfn "%A") 0 All three lets should give me the same FSharpAssembly. Instead, all 3 throw an exception that FSharp.Core is not an F# assembly (details below, re-formatted for readability). Two more clues: Using the core3 method, I get the same error for the test F# assembly itself I don't get the error at FSI after doing #r "@C:\Program Files...\FSharp.Powerpack.Metadata.dll". Any ideas? I'm using Visual Studio 2008, F# 2.0 and F# Powerpack 2.0.0.0 (May 20, 2010) release on an oldish XP VM, I think it's updated to SP3 though. (I got the error this morning with Powerpack 1.9.9.9, so I upgraded to 2.0.0.0. I thought that if 1.9.9.9 doesn't recognise F#'s 2.0.0.0's assemblies, then maybe bugfixes in Powerpack 2.0.0.0 would help.) Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.FSharp.Metadata.AssemblyLoader' threw an exception. ---> System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-PowerPack-Metadata>.$Metadata' threw an exception. ---> System.ArgumentException: could not produce an FSharpAssembly object for the assembly 'FSharp.Core' because this is not an F# assembly Parameter name: name at Microsoft.FSharp.Metadata.AssemblyLoader.Add(String name,Assembly assembly) at <StartupCode$FSharp-PowerPack-Metadata>.$Metadata..cctor() --- End of inner exception stack trace --- at Microsoft.FSharp.Metadata.AssemblyLoader..cctor() --- End of inner exception stack trace --- at Microsoft.FSharp.Metadata.AssemblyLoader.Get(Assembly assembly) at Microsoft.FSharp.Metadata.FSharpAssembly.FromAssembly(Assembly assembly) at Program.main(String[] args) in C:\Documents an...\FSMetadataTest\Program.fs:line 11 Press any key to continue . . .

    Read the article

  • How to fix "could not find a base address that matches schema http"... in WCF

    - by Craig Shearer
    I'm trying to deploy a WCF service to my server, hosted in IIS. Naturally it works on my machine :) But when I deploy it, I get the following error: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Googling on this, I find that I have to put a serviceHostingEnvironment element into the web.config file: <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://mywebsiteurl"/> </baseAddressPrefixFilters> </serviceHostingEnvironment> But once I have done this, I get the following: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]. It seems it doesn't know what the base address is, but how do I specify it? Here's the relevant section of my web.config file: <system.serviceModel> <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://mywebsiteurl"/> </baseAddressPrefixFilters> </serviceHostingEnvironment> <behaviors> <serviceBehaviors> <behavior name="WcfPortalBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"> <readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"/> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal"> <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> </system.serviceModel> Can anybody shed some light on what's going on and how to fix it? Thanks! Craig

    Read the article

  • Parsec: backtracking not working

    - by Nathan Sanders
    I am trying to parse F# type syntax. I started writing an [F]Parsec grammar and ran into problems, so I simplified the grammar down to this: type ::= identifier | type -> type identifier ::= [A-Za-z0-9.`]+ After running into problems with FParsec, I switched to Parsec, since I have a full chapter of a book dedicated to explaining it. My code for this grammar is typeP = choice [identP, arrowP] identP = do id <- many1 (digit <|> letter <|> char '.' <|> char '`') -- more complicated code here later return id arrowP = do domain <- typeP string "->" range <- typeP return $ "("++domain++" -> "++range++")" run = parse (do t <- typeP eof return t) "F# type syntax" The problem is that Parsec doesn't backtrack by default, so > run "int" Right "int" -- works! > run "int->int" Left "F# type syntax" unexpected "-" expecting digit, letter, ".", "`" or end of input -- doesn't work! The first thing I tried was to reorder typeP: typeP = choice [arrowP, identP] But this just stack overflows because the grammar is left-recursive--typeP never gets to trying identP because it keeps trying arrowP over and over. Next I tried try in various places, for example: typeP = choice [try identP, arrowP] But nothing I do seems to change the basic behaviours of (1) stack overflow or (2) non-recognition of "-" following an identifier. My mistake is probably obvious to anybody who has successfully written a Parsec grammar. Can somebody point it out?

    Read the article

  • MySql BulkCopy/Insert from DataReader

    - by Sky Sanders
    I am loading a bunch of rows into MySql in C#. In MS Sql I can feed a DataReader to SqlBulkCopy, but the MySqlBulkCopy only presents itself as a bootstrap for a load from file. So, my current solution is using a prepared command in a transacted loop. Is there a faster way to accomplish bulk loading of MySql using a DataReader source?

    Read the article

  • Magento Connect getting a 404

    - by sanders
    Hello Everyone I am using magento 1.4.0.1 I want to install new features using magento connect but whenever I go to System magento Connect magento Connect manager I get a 404 I have read that it could have to do with rights. But the rights of which folders? Thanks very much.

    Read the article

  • Why is Gmail not showing my text/html alternative?

    - by Stijn Sanders
    I'm creating an outgoing e-mail message (TIdMessage) with add two TIdText objects, one with ContentType:='text/plain' and one ContentType:='text/html', and also a TIdAttachment object. This seems to work for Outlook, which shows the HTML content, but for some odd reason, GMail keeps showing me the text/plain version by default. I've tried adding the text/html version first, I've tried adding '; charset=iso-8859-1' to the content type string, but I can't seem to find what else is different with other e-mails that GMail is showing the HTML from rightaway.

    Read the article

  • TTCPServer limited to 10 connections?

    - by Stijn Sanders
    I've created a TCP server NT-Service in Delphi 6, I've tried Indy components, Ararat Synapse components, and am now trying just plain old TTcpServer to see which would perform best while using the least resources. I'm surprised to see that the live instance of the service (running on Windows Server) is still limited to 10 connections! Any new connections are forcibly disconnected. Have I missed something? Do I need to set a property or override a method of TCustomTcpServer?

    Read the article

  • Storing an object to use in multiple classes

    - by Aaron Sanders
    I am wondering the best way to store an object in memory that is used in a lot of classes throughout an application. Let me set up my problem for you: We have multiple databases, 1 per customer. We also have a master table and each row is detailed information about the databases such as database name, server IP it's located and a few config settings. I have an application that loops through those multiple databases and runs some updates on them. The settings I mentioned above are updated each loop iteration into memory. The application then runs through series of processes that include multiple classes using this data. The data never changes during the processes, only during the loop iteration. The variables are related to a customer, so I have them stored in a customer class. I suppose I could make all of the members shared or should I use a singleton for the customer class? I've never actually used a singleton, only read they are good in this type of situation. Are there better solutions to this type of scenario? Also, I could have plans for this application to be multithreaded later. Sorry if this is confusing. If you have questions, let me know and I will answer them. Thanks for your help.

    Read the article

  • jquery fade popupwindow

    - by sanders
    Hello, I am using the popupwindow plugin for jquery to show a form in a popupwindow. How can I close this window after submitting? This is the link I am talking about. I can open a link in a pupup window. But after submitting I want it to open in its parent window.

    Read the article

  • CSS: semi-transparent background, but not text

    - by Stijn Sanders
    Is there a way in CSS to make the background of an element semi-transparent, but still have the text of the element non-transparent? (Without separating the text and background in two elements positioned over eachother.) I've tried <p style="position:absolute;background-color:green;filter:alpha(opacity=60);opacity:.6;"><span style="color:white;filter:alpha(opacity=100);opacity:1;">Hello world</span></p> But it looks like child elements are subjected to the opacity of their parent(s), so 'opacity:1' is still drawn as 'opacity:.6' from the parent.

    Read the article

  • Setting selected item in custom Zend_Form_Element

    - by sanders
    Hello Everyone, I have created my own little form element for inputting time's. Since I need this on a few places in my application, i decided to create a seperate element for it. Here is the code so fa: class EventManager_Form_Element_Time extends Zend_Form_Element { public function init() { parent::init(); $this->addDecorator('ViewScript', array( 'viewScript' => 'time.phtml' )); $this->addValidator(new Zend_Validate_Regex('/^[0-9]+:[0-9]+:[0-9]+$/')); } public function setValue($value) { if(is_array($value)) { @list($hours, $minutes, $seconds) = $value; $value = sprintf('%s:%s:%s', $hours, $minutes, $seconds); } return parent::setValue($value); } } The corresponding view script, which I have created is: <?php @list($hours, $minutes, $seconds) = explode(':', $this->element->getValue()); ?> <dt> <?= $this->formLabel($this->element->getName(), $this->element->getLabel()); ?> </dt> <dd> <select id="<?= $this->element->getName();?>"> <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> </select> <select id="<?= $this->element->getName();?>"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <input id="<?= $this->element->getName(); ?>" type="hidden" name="<?= $this->element->getName(); ?>[]" value="00" /> <?php if(count($this->element->getMessages()) > 0): ?> <?= $this->formErrors($this->element->getMessages()); ?> <?php endif; ?> </dd> My problem is that sometimes i want to set a default selected value to my selecboxes when I populate my form. The question is how? Is there anyone that could help me out with this? Thanks.

    Read the article

  • c# create an arbitrary length generic parameter string e.g. ?,?,?

    - by Sky Sanders
    I know I am forgetting to remember how to do this and it is late. I want to, in an elegant manner, build a placeholder list for a munged sql command. Have a command with an arbitrary number of parameters, need to build ?,?,? Did I mention that it was a wet brain fart? this is what came out: Regex.Replace(new string('?', _command.Parameters.Count), @"\?\?", @"\?,\?"); You are welcome to make me feel like more of an idiot if you just remember me what I am forgetting. ;-)

    Read the article

  • F# Higher-order property accessors

    - by Nathan Sanders
    I just upgraded my prototyping tuple to a record. Someday it may become a real class. In the meantime, I want to translate code like this: type Example = int * int let examples = [(1,2); (3,4); (5,6)] let field1s = Seq.map (fst >> printfn "%d") examples to this: type Example = { Field1 : int Field2 : int Description : string } let examples = [{Field1 = 1; Field2 = 2; Description = "foo"} {Field1 = 3; Field2 = 4; Description = "bar"} {Field1 = 5; Field2 = 6; Description = "baz"}] let field1s = Seq.map Description examples The problem is that I expected to get a function Description : Example -> string when I declared the Example record, but I don't. I've poked around a little and tried properties on classes, but that doesn't work either. Am I just missing something in the documentation or will I have to write higher-order accessors manually? (That's the workaround I'm using now.)

    Read the article

  • Does F# documentation have a way to search for functions by their types?

    - by Nathan Sanders
    Say I want to know if F# has a library function of type ('T -> bool) -> 'T list -> int ie, something that counts how many items of a list that a function returns true for. (or returns the index of the first item that returns true) I used to use the big list at the MSR site for F# before the documentation on MSDN was ready. I could just search the page for the above text because the types were listed. But now the MSDN documentation only lists types on the individual pages--the module page is a mush of descriptive text. Google kinda-sorta works, but it can't help with // compatible interfaces ('T -> bool) -> Seq<'T> -> int // argument-swaps Seq<'T> -> ('T -> bool) -> int // type-variable names ('a -> bool) -> Seq<'a> -> int // wrappers ('a -> bool) -> 'a list -> option<int> // uncurried versions ('T -> bool) * 'T list -> int // .NET generic syntax ('T -> bool) -> List<'T> -> int // methods List<'T> member : ('T -> bool) -> int Haskell has a standalone program for this called Hoogle. Does F# have an equivalent, like Fing or something?

    Read the article

  • What are the rules governing how a bind variable can be used in Postgres and where is this defined?

    - by Craig Miles
    I can have a table and function defined as: CREATE TABLE mytable ( mycol integer ); INSERT INTO mytable VALUES (1); CREATE OR REPLACE FUNCTION myfunction (l_myvar integer) RETURNS mytable AS $$ DECLARE l_myrow mytable; BEGIN SELECT * INTO l_myrow FROM mytable WHERE mycol = l_myvar; RETURN l_myrow; END; $$ LANGUAGE plpgsql; In this case l_myvar acts as a bind variable for the value passed when I call: SELECT * FROM myfunction(1); and returns the row where mycol = 1 If I redefine the function as: CREATE OR REPLACE FUNCTION myfunction (l_myvar integer) RETURNS mytable AS $$ DECLARE l_myrow mytable; BEGIN SELECT * INTO l_myrow FROM mytable WHERE mycol IN (l_myvar); RETURN l_myrow; END; $$ LANGUAGE plpgsql; SELECT * FROM myfunction(1); still returns the row where mycol = 1 However, if I now change the function definition to allow me to pass an integer array and try to this array in the IN clause, I get an error: CREATE OR REPLACE FUNCTION myfunction (l_myvar integer[]) RETURNS mytable AS $$ DECLARE l_myrow mytable; BEGIN SELECT * INTO l_myrow FROM mytable WHERE mycol IN (array_to_string(l_myvar, ',')); RETURN l_myrow; END; $$ LANGUAGE plpgsql; Analysis reveals that although: SELECT array_to_string(ARRAY[1, 2], ','); returns 1,2 as expected SELECT * FROM myfunction(ARRAY[1, 2]); returns the error operator does not exist: integer = text at the line: WHERE mycol IN (array_to_string(l_myvar, ',')); If I execute: SELECT * FROM mytable WHERE mycol IN (1,2); I get the expected result. Given that array_to_string(l_myvar, ',') evaluates to 1,2 as shown, why arent these statements equivalent. From the error message it is something to do with datatypes, but doesnt the IN(variable) construct appear to be behaving differently from the = variable construct? What are the rules here? I know that I could build a statement to EXECUTE, treating everything as a string, to achieve what I want to do, so I am not looking for that as a solution. I do want to understand though what is going on in this example. Is there a modification to this approach to make it work, the particular example being to pass in an array of values to build a dynamic IN clause without resorting to EXECUTE? Thanks in advance Craig

    Read the article

  • Why is CoRegisterClassObject creating two extra threads?

    - by Stijn Sanders
    I'm trying to fix a problem that only recently happens on a number of machine's on a VPN. They each run a client application I wrote that exposes a COM automation object. For some strange reason I haven't been able to discover yet, one thread in the application takes up all of the available CPU time, slowing other operation on the machine. In observing the application's strange behaviour, I've noticed it's the third thread started, and if I debug on my machine I notice the first call to CoRegisterClassObject created two extra threads. If the second of these two threads is the one that gets into an infinite loop, I'm not at all shure how to fix this. Where could I check next about what's wrong? Could it have started by one of the recent patches rolled out by Microsoft this last 'patch tuesday'? I had a go with ProcessExplorer to extract a stack trace of the thread: ntoskrnl.exe!ExReleaseResourceLite+0x1a3 ntoskrnl.exe!PsGetContextThread+0x329 WLDAP32.dll!Ordinal325+0x1231 WLDAP32.dll!Ordinal325+0x129e WLDAP32.dll!Ordinal325+0x1178 ntdll.dll!LdrInitializeThunk+0x24 ntdll.dll!LdrShutdownThread+0xe9 kernel32.dll!ExitThread+0x3e kernel32.dll!FreeLibraryAndExitThread+0x1e ole32.dll!StringFromGUID2+0x65d kernel32.dll!GetModuleFileNameA+0x1ba

    Read the article

  • Get current Apache version string for display

    - by Stijn Sanders
    I'm writing an Apache module and want to get a string with the Apache name version and other details. Much like what gets added to outgoing headers, e.g.: Server: Apache/2.2.13 (Win32) I've tried code like this: apr_table_get(request_rec->headers_out,"Server") But that doesn't seem to work. Is there an API call I haven't found or am I doomed to get version resource data from httpd.exe?

    Read the article

  • Leading zeroes in php

    - by sanders
    Hello, I would like to present a list from 0 to 59 of with the numbers 0 to 9 have a leading zero. This is my code but it doesn't work so far. Any idea's? for($i=0; $i<60; $i++){ if($i< 10){ sprintf("%0d",$i); } array_push($this->minutes,$i); }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >